#qi-hardware IRC log for Saturday, 2013-07-13

--- Sat Jul 13 201300:00
mthlarsc: on the JZ4770, if I power down the DAC, user space gets blocked when playing samples16:46
mthas in, the application is stuck in place until I enable one of the outputs that thereby indirectly enable the DAC16:47
larscso the whole DMA is disabled?16:47
mthmy guess is that the fifos don't get read anymore and therefore don't issue interrupts anymore either16:47
larscIf the codec is the clock master16:48
larscand the clocks are disabled16:48
larscas well16:48
larscthe i2s core won't request any new samples anymore16:48
mthI was wondering if this is a bug in the pcm or i2s driver or whether I simply shouldn't power down the DAC16:48
mthoriginally the codec driver didn't power down the DAC, but I've been cleaning it up and then this problem suddenly appeared16:49
mththe codec driver enables the clock at codec probe and never disables it16:49
larscit probably shuts down more than just the DAC16:49
mthnot ALSA, in any case: if I add a single line that only resets the DAC standby bit, the problem disappears16:50
mthmaybe in the hardware there is also some kind of dependency graph?16:50
mthalthough the docs say they leave all that to software16:50
larscyea, I'd assume that the codec shutsdown it's I2S clock if the DAC is powered down16:51
larscor well the bit controls more than just the DAC16:51
mthso the I2S clock is sent by the codec to the AIC?16:52
larscThat's what I'd suspect16:53
larscIt's not unheard of that a codec tries to be smart and shutsdown the clocks if there is no active path over which audio could be played16:54
mththe AIC is configurd to output SYSCLK, is that the same clock used for I2S or a different clock?16:57
larsca different one, most likely16:57
larscsysclk is usually the master clock16:57
larscused by the codec to generate all other clocks16:57
mth"When use with the internal CODEC, the BIT_CLK and SYNC signals also with O_BIT_CLK and O_SYNC signals are provided by the internal CODEC from the SYSCLK, which is enabled by I2SCR.ESCLK and configured to 12MHz clock using CPM."16:58
mthso it seems there is a kind of loopback that derives the I2S clock from SYSCLK16:58
mthand perhaps powering down the DAC shuts down that loopback16:58
larscI wouldn't call it a loopback, but yes that's what is most likely happening17:01
mthyeah, it's more complex than just a wire, but the signal eventually gets sent back to the component where it came from17:03
larscwell it's comming from the cpm17:04
mththe AIC has a bit that controls whether it exports the SYSCLK or not17:24
mthso it's not coming directly from the CPM, but via the AIC17:24
mthanyway, do you have an idea on how to fix this?17:25
mththere doesn't seem to be a way to implicitly control the I2S clock17:26
larsckeep the DAC powered17:26
mthso one option would be to have the DAC enabled while playing with no outputs17:26
mthbut it would waste some power17:26
larschow often do you think somebody plays audio with all outputs disabled?17:26
larscI mean it's not really a valid usecsae17:27
mthI do it quite often, if I'm playing games in the train17:27
mthI don't want to bother other people with the sound effects17:27
mthand often I'd rather disable sound than plug in headphones17:27
larscBut it would be better if the application would allow you disable sound altogether17:28
mthsome do, but not every application has that option17:28
larscMaybe you can somehow redirect audio to the null plugin17:29
larscYou do have a centeral deamon that handles stuff like volume right?17:29
mthI guess it's not trivial to have the samples consumed at the right rate if the dma is not running17:29
mthwe have pwswd, which handles global hotkeys17:29
mthbut it's not guaranteed that all volume changes go through that17:30
larscbut if you change the alsa config to use the null plugin is audio is off you'd save even more power17:30
larscif audio is off17:31
larscalthough I'm not sure how well that would work with already active streams17:32
mthmaybe I'm over-optimizing and should just leave the DAC powered17:33
larscleave it powered :)17:33
mthit took me several days to get the microphone support correct...17:33
mthalthough that was mostly because I'm not very good with ALSA yet17:33
mthand there is very little documentation on ALSA17:33
mthI am quite happy with how it turned out in the end though17:34
mththe platform data can now specify whether you have 0, 1 or 2 mono mics, or two mic inptus combined into one stereo mic17:34
mthand the right controls are instantiated for every case17:35
mthwhile previously you'd see all controls, even for inputs that don't exist on your board17:35
larscsounds about right17:41
mthlarsc: this is what I came up with for the DAC power problem: http://www.treewalker.org/temp/force-sysclk.diff18:52
larschave you checked whether there is a similar problem for capture?18:56
mthno, I haven't tested capture at all yet18:56
--- Sun Jul 14 201300:00

Generated by irclog2html.py 2.9.2 by Marius Gedminas - find it at mg.pov.lt!