Hi Andrea, On Tue, Jan 12, 2016 at 09:49:03PM -0800, Andrea Venturi wrote: > hello, > > i've tested the experimental github branch for I2S DAI mainline linux > driver on: > https://github.com/mripard/linux/tree/sunxi/wip/a20-i2s > > my HW setup actually is: > > - an Olimex A20-SOM with EValuation > Board: https://www.olimex.com/Products/SOM/A20/A20-SOM-EVB/ > - the Audio DAC is a PCM5102x based low cost > device: > http://www.aliexpress.com/item/PCM5102-DAC-Decoder-I2S-Player-Assembled-Board-32Bit-384K-Beyond-ES9023-PCM1794/32579339671.html > > let me state in advance i've no economic interest at all in these specific > vendors or products! :-) > > BTW the PCM510x DAC is a pretty simple device with no cfg at all on the > software side (there's no I2C or SPI bus [*]) and it does need only three > wires on the I2S side (BITCLK, LRCLK and DATAIN) as the local system clock > is "generated" internally with some kind of PLL. > > so, as technically speaking, the "simple sound card" need two entries for > the two "legs" (DAI+CODEC) of an audio connection, i had to put in place a > pretty simple "stub" driver of the PCM codec (patch 0001); this PCM510x > codec driver needs to be enabled in kernel config for module creation. > (also the I2S sunxi DAI has to be enabled there) > > then in patch 0004 there are the DTS entries for the A20-OLIMEX-SOM EVB > entries enabling the I2S DAI based audio card (the patched DTS enables also > the analog audio codec here) > > at this point, as per my tests,we could alreay have a bitstream when doing > a playback with aplay but with wrong clocks (slower) on BITCLK and LRCLK > pins. > > AFAICS this is happening for two reasons: > > - the 4 clock (PLL2x1 .. PLL2x8) entries in DTSI about i2s0 on the clk > compatible = "allwinner,sun4i-a10-mod1-clk" are reversed , look at others > clk entries for spdif/ac97 to see they do not match (patch 0002) > - the mod1_clk clock composite driver was not able to set parent rate > for a missing flag (patch 0003), thanx to mripard for the hint on IRC.
Thanks for testing this and for this valuable feedback. I've taken the patches 2 and 3 in my branch. I'll test it on my setup (with a "real" codec) and see if it fixes the issues I was seeing, and if it does, I'll submit the patches. > after these four patches applied, the playback is working "flawlessly" (a > part of some "scratching frames" in the playback start.. some kind of audio > muting would be useful at start). Usually, it's the codec itself that has a digital mute feature. In your case, since afaik you don't have any kind of control over it, the DAC are probably always enabled and you'll have that click. > a (not so subtle) issue come to mind if both analog audio codec and I2S DAI > try to playback two streams with incompatible sample rate (44100 and 48000 > for example), i suppose the latest starting would reprogram the PLL2 in a > way not compatible with the first one. some kind of locking preventing this > issue would be needed in the long run.. That's something that can be adressed easily using a clock notifer that would reject any clock change rate while the device is in use. Unfortunately, that will probably have to be duplicated across the consumer drivers (i2s, codec, spdif) since it's a consumer level interface (not that it's something really hard to do). > i post this mail for further consideration and tests from the linux-sunxi > community; as i've been told by Maxime Ripard, we are still far from having > a mainlining of this driver because it would need a proper submission to > relevant linux group of interests and maintainers (Alsa and ARM i suppose), > and that's something i'm actually not really ready to properly tackle! :-) Yeah, it wasn't working on my setup, which is my I never submitted it. If the issues you found were the source and everything works, I'll do it. > me, i'm actually considering to test and implement also the "I2S slave > mode" where clocks come from "codec" (with a different HW codec, of course > and report if something useful comes out..) Feel free to do so :) Thanks! Maxime -- Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: Digital signature
