Mainline A10/A20 audio driver


zador.blood.stained
 Share

3 3

Recommended Posts

Looks like A10/A20 audio codec support got merged to linux-next tree. Igor, can you please add these patches?

I'll try to find all related bits.

There are too many commits to link them one by one.

Here is merge commit, it's easier to remove not needed bcm2835 and sun6i stuff from it.

https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit?id=2030deefd5bfb68317732d8f64c69c7cb5169e9d

Link to post
Share on other sites

Donate and support the project!

Thanks.

Looks like driver itself (sun4i-codec) was merged separately. 

https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/sound/soc/sunxi

Posted kernel itself, of course, works, but without includes I won't be able to quickly compile and test this module and without required CONFIG_SND_SOC* options especially

 

Edit: compiled 4.3 with all these patches, looks like it's not ready yet

[    8.380136] sun4i-codec 1c22c00.codec: Missing dma channel for stream: 0
[    8.380164] sun4i-codec 1c22c00.codec: ASoC: pcm constructor failed: -22
[    8.380176] sun4i-codec 1c22c00.codec: ASoC: can't create pcm CDC PCM :-22
[    8.380186] sun4i-codec 1c22c00.codec: ASoC: failed to instantiate card -22
[    8.380423] sun4i-codec 1c22c00.codec: Failed to register our card
[    8.380519] sun4i-codec: probe of 1c22c00.codec failed with error -22

Edit 2: Of course DMA engine is not enabled by default... really, who needs to make CONFIG_SND_SUN4I_CODEC depend on CONFIG_DMA_SUN4I if you can just spend another 2 hours recompiling kernel?

Link to post
Share on other sites

Okay. Kernel 4.3 + allwinner-audio-4.x patch + 6 patches related to sun4i-codec + enabling CONFIG_DMA_SUN4I (and of course enabling CONFIG_SND_SUN4I_CODEC) in kernel config + understanding new weird mixer controls = onboard sound works.

➜  ~  % dmesg | grep sun4i-codec
[    8.566444] sun4i-codec 1c22c00.codec: Codec <-> 1c22c00.codec mapping ok
➜  ~  % aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sun4icodec [sun4i-codec], device 0: CDC PCM Codec-0 []
  Subdevices: 0/1
  Subdevice #0: subdevice #0

Edit: for reference, proper mixer config looks like this right now:

post-480-0-45557900-1446976225_thumb.png

 

Edit 2: Patches for sun4i-codec [file removed]

Link to post
Share on other sites

Hi,

 

I'd quite like to switch from legacy to mainline due to various improvements I read about. I need adio-output via the 3,5mm-audio-jack though.

Do I understand this thread correctly that audio will work with Mainline-Kernel 4.4 (once it is released) on Banana-Pi  3,5mm-audio-jack?

 

Cheers, Bernie_O.

Link to post
Share on other sites

Hi,

meantime I switched to mainline kernel (4.6.3) and audio output via 3,5mm jack works. However: when I stop playing music, there is quite some noise coming out of the speakers which is not the case with legacy kernel. Muting the devices and turning volume to zero (like the default-setting right after armbian-installation) doesn't help.

Is this a known issue?

Cheers, Bernie_O.

Link to post
Share on other sites

I found a solution:

There seems to be a voltage difference between ground on AV jack and actual ground on Banana Pro which is responsible for that noise: http://forum.lemaker.org/forum.php?mod=viewthread&tid=23054&page=1#pid91781

My device is a Banana Pi, but I suspected that there is a similar voltage difference.

By connecting a cable from ground pin on AV jack and GPIO-ground (PIN 9) the noise is gone :-)

Cheers, Bernie_O

Link to post
Share on other sites

On 12.8.2016 at 6:20 PM, Bernie_O said:

I found a solution:

There seems to be a voltage difference between ground on AV jack and actual ground on Banana Pro which is responsible for that noise: http://forum.lemaker.org/forum.php?mod=viewthread&tid=23054&page=1#pid91781

My device is a Banana Pi, but I suspected that there is a similar voltage difference.

By connecting a cable from ground pin on AV jack and GPIO-ground (PIN 9) the noise is gone :-)

Cheers, Bernie_O

Just for the record:

the noise is actually a result of the mainline kernel powering down the audio subsystem when not in use. Disabling this as described in the below quoted post works also with my Banana Pi. With using a cable (as described above) the noise is gone, but still there is quite a loud "plop" when the audio-subsystem changes its power-state. Disabling the powering down of the audio subsystem removes also the "plop" - so I removed my cable.... and the "plop" :-)

Cheers, Bernie_O

Link to post
Share on other sites

Guest
This topic is now closed to further replies.
 Share

3 3