Jump to content

NanoPi NEO Audio output on analog and SPDIF not working


phi

Recommended Posts

Hi there!

 

I just downloaded the available image for the NanoPi Neo

root@nanopineo:~# uname -a
Linux nanopineo 3.4.112-sun8i #24 SMP PREEMPT Thu Aug 4 20:56:33 CEST 2016 armv7l armv7l armv7l GNU/Linux

Audio output is only supported for HDMI (but there is no HDMI connector on the PCB).

Analog output and SPDIF are not available in the device list.

root@nanopineo:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndhdmi [sndhdmi], device 0: SUNXI-HDMIAUDIO sndhdmi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
root@nanopineo:~#

It is mentioned that also analog should work, but it is not listed as device as you can see above.

root@nanopineo:~# dmesg | grep -i audio
[    1.510615] [DAUDIO]sunxi-daudio cannot find any using configuration for controllers, return directly!
[    1.510990] [I2S]snddaudio cannot find any using configuration for controllers, return directly!
[    1.511022] [DAUDIO0] driver not init,just return.
[    1.518650] asoc: sndhdmi <-> sunxi-hdmiaudio.0 mapping ok
root@nanopineo:~#

dmesg says, that there is a missing configuration. But i do not know how i can solve this?!

 

As far as i know i have to load the following kernel modules for SPDIF:

root@nanopineo:~# lsmod
Module                  Size  Used by
sunxi_spdif             7037  0
sunxi_spdma             3703  0
sunxi_sndspdif          3885  0
sndspdif                2743  0
root@nanopineo:~#

But this also shows in dmesg following errors:

[ 1579.722937] [SPDIF]sndspdif cannot find any using configuration for controllers, return directly!
[ 1590.633569] [SPDIF] driver not init,just return.
[ 1647.232710] [SPDIF]sunxi-spdif cannot find any using configuration for controllers, return directly!
root@nanopineo:~#
 

Btw. i also have no "/etc/asound.conf" 

 

 

Could anyone give me a little support how i can solve this to get audio output on the analog line out and the SPDIF output?

 

Thanks!

 

Link to comment
Share on other sites

I am already one step further...

 

I found something about a FEX file!

root@nanopineo:~# bin2fex /boot/script.bin /tmp/custom.fex
fexc-bin: /boot/script.bin: version: 0.1.2
fexc-bin: /boot/script.bin: size: 35300 (81 sections)
root@nanopineo:~# nano /tmp/custom.fex

Then i changed the following part, see red text (from 0 --> 1):

[audio0]
audio_used = 1
lineout_vol = 31
cap_vol = 5
audio_hp_ldo = "none"
adcagc_used = 0
adcdrc_used = 0
dacdrc_used = 0
adchpf_used = 0
dachpf_used = 0

[spdif0]
spdif_used = 1
spdif_dout = port:PA17<2><1><default><default>

after saving....

root@nanopineo:~# fex2bin /tmp/custom.fex /boot/bin/custom.bin
root@nanopineo:~# ln -sf /boot/bin/custom.bin /boot/script.bin
root@nanopineo:~# reboot

...

root@nanopineo:~# modprobe sndspdif
root@nanopineo:~# modprobe sunxi-sndspdif
root@nanopineo:~# modprobe sunxi-spdma
root@nanopineo:~# modprobe sunxi-spdif
root@nanopineo:~# lsmod
Module                  Size  Used by
sunxi_spdif             7037  1
sunxi_spdma             3703  1
sunxi_sndspdif          3885  0
sndspdif                2743  1
root@nanopineo:~# dmesg
...
[  326.637928] asoc: sndspdif <-> spdif0 mapping ok
root@nanopineo:~# cat /proc/asound/cards
 0 [sndhdmi        ]: sndhdmi - sndhdmi
                      sndhdmi
 1 [sndspdif       ]: sndspdif - sndspdif
                      sndspdif
root@nanopineo:~# 

Did not checked if it is really working yet, but analog still not present!

Link to comment
Share on other sites

I can t solve your problem with the analog output., but how did you connect the spdif output, via toslink-transmitter?

 

Regards

 

My amplifier has a SPDIF input (cinch). I just connected GND (pin #12) and SPDIF (pin #7) on the pin header to one cinch connector and pluged it in...

But if you have a SPDIF to TOSLINK converter it should work!

 

Same for analog line out on two cinch connectors: LineOutR (pin #10) + GND & LineOutL (pin #11) + GND

Link to comment
Share on other sites

@phi

Please try replacing /var/lib/alsa/asound.state with this file and reload ALSA configuration after that.

 

i have tried this, but it does not help.

I assume that at least the "audiocodec" should be listed unter available sound devices... but there is nothing!

 

I also tried "Jessie" with the old 3.4.112 Legacy kernel instead of "Xenial".

"audiocodec" is listed as sound device! :)

If i reboot the nanopi i can hear some "plop" on my speakers... that is new! :) ...but i did not get any sound out of it!

Tried again to replace asound.state, but again no difference!

 

Also tried Jessie and Xenial with Vanilla kernel... no sound device at all after reboot, but not did any deeper investigations because it was marked as preview/beta "for experts only"... these images are not for me ;)

Link to comment
Share on other sites

Also tried Jessie and Xenial with Vanilla kernel... no sound device at all after reboot, but not did any deeper investigations because it was marked as preview/beta "for experts only"... these images are not for me ;)

There is no audio driver in mainline for H3, so you don't need to investigate anything.

 

I also tried "Jessie" with the old 3.4.112 Legacy kernel instead of "Xenial".

"audiocodec" is listed as sound device! :)

If i reboot the nanopi i can hear some "plop" on my speakers... that is new! :) ...but i did not get any sound out of it!

Tried again to replace asound.state, but again no difference!

If you have audio device listed in output of "aplay- l", please try running

speaker-test -c 2 -D hw:0

Assuming it's listed as card 0

 

I didn't test analog audio in Xenial, but it worked for me in Jessie (on OrangePi+2e, but it's the same SoC and audio related settings), and here replacing asound.state worked too on prebuilt images.

Link to comment
Share on other sites

There is no audio driver in mainline for H3, so you don't need to investigate anything.

 

If you have audio device listed in output of "aplay- l", please try running

speaker-test -c 2 -D hw:0

Assuming it's listed as card 0

 

I didn't test analog audio in Xenial, but it worked for me in Jessie (on OrangePi+2e, but it's the same SoC and audio related settings), and here replacing asound.state worked too on prebuilt images.

 

Hi!

 

if i start speaker-test in the console everything looks good, but i can't hear anything. No noises at all...

 

Rechecked it also with the image from FriendlyARM: nanopi-neo-linux-rootfs-core-qte-sd4g-20160804.img

With the image from FA i can hear some noise toggling between right and left speaker.

 

But thanks for your support so far!

Link to comment
Share on other sites

Something is (still) wrong regarding analogue audio on Friendly arm boards. I spent some time on this issue and trying to figure out, but failed. I know audio is working on FA images but I guess it must be kernel related which is odd. I checked configuration, alsa settings, ... everything looks o.k. but no sound :)

Link to comment
Share on other sites

Hi,

 

I have a nanoPI v1.2 and my analogue audio is not working too ... is there any progress?

 

aplay lists the snddaudio device but no sound on the analogue ports ...

**** List of PLAYBACK Hardware Devices **** 
card 0: audiocodec [audiocodec], device 0: SUNXI-CODEC sndcodec-0 []
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 1: sndhdmi [sndhdmi], device 0: SUNXI-HDMIAUDIO sndhdmi-0 []
 Subdevices: 1/1
 Subdevice #0: subdevice #0

I don't know if I am doing something wrong ... I have connected the lineoutl/lineoutr and GND to a 3,5mm jack with headphones connected.

But there's nothing. Is an amplifier indispensable?

 

https://imagebin.ca/v/385h3CzmZY3H

Link to comment
Share on other sites

Hi,

 

I have a nanoPI v1.2 and my analogue audio is not working too ... is there any progress?

 

aplay lists the snddaudio device but no sound on the analogue ports ...

**** List of PLAYBACK Hardware Devices **** 
card 0: audiocodec [audiocodec], device 0: SUNXI-CODEC sndcodec-0 []
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 1: sndhdmi [sndhdmi], device 0: SUNXI-HDMIAUDIO sndhdmi-0 []
 Subdevices: 1/1
 Subdevice #0: subdevice #0

I don't know if I am doing something wrong ... I have connected the lineoutl/lineoutr and GND to a 3,5mm jack with headphones connected.

But there's nothing. Is an amplifier indispensable?

 

https://imagebin.ca/v/385h3CzmZY3H

 

Have you made any progress on this issue? Using the same pins and it isn't working, too...

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