Jump to content

pcm5102 dac not showing on armbian 5.65 [SOLVED]


dony71

Recommended Posts

i'm using banana-pi-m2+

already enable i2s0 by changing dtb file in /boot/dtb and can see i2s module load

but aplay -l still not showing 

anybody help?

 

root@bananapim2plus:~# lsmod
Module                  Size  Used by
snd_soc_hdmi_codec     16384  0
dw_hdmi_i2s_audio      16384  0
sun8i_dw_hdmi          16384  0
dw_hdmi                28672  2 dw_hdmi_i2s_audio,sun8i_dw_hdmi
cec                    40960  2 dw_hdmi_cec,dw_hdmi
sun8i_codec_analog     24576  1
sun4i_codec            32768  3
sun4i_i2s              16384  0
snd_soc_core          118784  4 sun4i_codec,sun4i_i2s,sun8i_codec_analog,snd_soc_hdmi_codec
snd_pcm_dmaengine      16384  1 snd_soc_core
snd_pcm                69632  5 sun4i_i2s,snd_pcm_dmaengine,snd_soc_hdmi_codec,snd_soc_core
snd_timer              24576  1 snd_pcm
snd                    45056  9 snd_soc_hdmi_codec,snd_timer,snd_soc_core,snd_pcm
soundcore              16384  1 snd

Link to comment
Share on other sites

I manage to get this working using released Armbian 5.65 (kernel 4.14.78).

Somehow armbian kernel never include pcm5102a driver module, so have to compile it manually as compiling via menuconfig also not working (Kconfig not include "CONFIG_SND_SOC_PCM5102A=m" ).

After successfully compiled snd-soc-pcm5102a.ko (see attached file), copy it at /lib/module/kernel/4.14.78-sunxi/kernel/sound/soc/codecs/

Copy sun8i-h3-I2S-out.dts (attached file) in /boot/overlay-user and convert it to dtbo file with armbian-add-overlay

Enable i2s in board dtb (for my board sun8i-h3-bananapi-m2-plus.dtbo).

You have to convert dtbo file to dts file first to be readable and change to "status = "okay";" under i2s@01c22000 section

(see attached sun8i-h3-bananapi-m2-plus.dts) and convert it back to dtbo file.

After reboot then pcm5102 i2s device will show up :)

 

snd-soc-pcm5102a.ko

sun8i-h3-I2S-out.dts

sun8i-h3-bananapi-m2-plus.dts

Link to comment
Share on other sites

@Igor for improvement, you might want to create patch on sun4i-i2s.c and include in armbian kernel

this code will add 20bit and 24bit audio resolution

here is the code https://github.com/dony71/linux-sunxi/blob/sunxi-wip/sound/soc/sunxi/sun4i-i2s.c

also i have example overlay for allwinner H3 for pcm5102a codec here https://github.com/dony71/linux-sunxi/blob/sunxi-wip/arch/arm/boot/dts/sun8i-h3-I2S-master.dts

 

Link to comment
Share on other sites

On 11/16/2018 at 5:26 AM, dony71 said:

I manage to get this working using released Armbian 5.65 (kernel 4.14.78).

After successfully compiled snd-soc-pcm5102a.ko (see attached file), copy it at /lib/module/kernel/4.14.78-sunxi/kernel/sound/soc/codecs/

Could you please tell how how did you compile snd-soc-pcm5102a.ko?

On my NanoPi Neo I

- changed the .dtb for the Neo

- did armbian-add-overlay ./sun8i-h3-I2S-out.dts

- now have in armbianEnv.txt: 

   user_overlays=sun8i-h3-I2S-out

- lsmod|grep i2s
     sun4i_i2s              16384  0
     snd_soc_core          118784  2 sun4i_i2s,sun8i_codec_analog
     snd_pcm                69632  3 sun4i_i2s,snd_pcm_dmaengine,snd_soc_core  

 

I think I do only need the .ko in my system - compiled for

ARMBIAN 5.65 stable Debian GNU/Linux 9 (stretch) 4.14.84-sunxi

Linux npi-neo 4.14.84-sunxi #3 SMP Sat Dec 1 07:18:41 CET 2018 armv7l GNU/Linux

 

I did try to see it in "only U-Boot/kernel" in the armbian-build-system - BUT failed :(
I did see that kernel-menuconfig, but dont know what to do with it and the patch:

 

 

For the Neo I have the PCM5102A-Hat from FriendlyARM

https://www.friendlyarm.com/index.php?route=product/product&product_id=169

and it is/was running fine with legacy kernel 3.4:

 

 

NanoPi_PCM5102A.jpg

Link to comment
Share on other sites

1 hour ago, guidol said:

Could you please tell how how did you compile snd-soc-pcm5102a.ko?

On my NanoPi Neo I

- changed the .dtb for the Neo

- did armbian-add-overlay ./sun8i-h3-I2S-out.dts

- now have in armbianEnv.txt: 

   user_overlays=sun8i-h3-I2S-out

- lsmod|grep i2s
     sun4i_i2s              16384  0
     snd_soc_core          118784  2 sun4i_i2s,sun8i_codec_analog
     snd_pcm                69632  3 sun4i_i2s,snd_pcm_dmaengine,snd_soc_core  

 

I think I do only need the .ko in my system - compiled for

ARMBIAN 5.65 stable Debian GNU/Linux 9 (stretch) 4.14.84-sunxi

Linux npi-neo 4.14.84-sunxi #3 SMP Sat Dec 1 07:18:41 CET 2018 armv7l GNU/Linux

 

I did try to see it in "only U-Boot/kernel" in the armbian-build-system - BUT failed :(
I did see that kernel-menuconfig, but dont know what to do with it and the patch:

 

 

For the Neo I have the PCM5102A-Hat from FriendlyARM

https://www.friendlyarm.com/index.php?route=product/product&product_id=169

and it is/was running fine with legacy kernel 3.4:

 

 

NanoPi_PCM5102A.jpg

You have to modify config PCM5102A like below on  cache\source\linux-mainline\v4.14.84\sound\soc\codecs\Kconfig

config SND_SOC_PCM5102A
    tristate "Texas Instruments PCM5102A CODEC - I2S"

then replace config-default.conf with attached

With this conf, script compilation will stop to overwrite kernel source to build patch

At that time, overwrite original Kconfig with the one you modified above

Then script compilation will stop again to ask whether you want to add pcm5102a to compile

Default is N, so you need to enter m for module compilation

 

config-default.conf.mod

Link to comment
Share on other sites

22 hours ago, dony71 said:

You have to modify config PCM5102A like below on  cache\source\linux-mainline\v4.14.84\sound\soc\codecs\Kconfig

config SND_SOC_PCM5102A
    tristate "Texas Instruments PCM5102A CODEC - I2S"

 

I did all this - after getting it into my brain the last night - AND IT WORKED :) Many Thanks!

-----------------------------------------------------------------------
BE HAPPY about a successful i2s mapping in dmesg (on NanoPi Neo)
-----------------------------------------------------------------------
root@npi-neo(192.168.6.24):~# dmesg|grep -i i2s
[    6.911751] asoc-simple-card sound_i2s: pcm5102a-hifi <-> 1c22000.i2s mapping ok

-----------------------------------------------------------------------
I enabled also ananlog-Codec (on NanoPi Neo)
-----------------------------------------------------------------------
root@npi-neo(192.168.6.24):/home/guido# aplay -l
**** Liste der Hardware-Geräte (PLAYBACK) ****
Karte 0: Codec [H3 Audio Codec], Gerät 0: CDC PCM Codec-0 []
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: I2Smaster [I2S-master], Gerät 0: 1c22000.i2s-pcm5102a-hifi pcm5102a-hifi-0 []
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0

I did wrote a new thread for the NanoPi Neo - it could be better found if anyone does earch for the information :

 

 

config-default.conf.mod_nanopineo

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines