Power & Source of Big Ideas

NanoPi-NEO-AIr not seeing NanoHAT PCM5102A

Moderators: chensy, FATechsupport

If I do this it come back like this:

Code: Select all

root@NanoPi-NEO-Air:/home/pi# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Dummy [Dummy], device 0: Dummy PCM [Dummy PCM]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 1: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 1: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 2: Codec [H3 Audio Codec], device 0: CDC PCM Codec-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: allwinnerhdmi [allwinner,hdmi], device 0: 1c22800.i2s-i2s-hifi i2s-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
root@NanoPi-NEO-Air:/home/pi#


I thought it my be the hat but I have another one and I switch it and I get the same thing so it must be the NanoPi-NEO-Air. I had to solder the pins on it and I looked at them real good and they seem like they are all good. The RS232 works on it that's how I got this text. But do have it on WiFi too.

Any one know what could be wrong?

The green LED is lit on the sound board. I guess that says it should be working.

-Raymond Day
you need the right linux image with support for the pcm5102a hat.
which image do you use?

you could also take a look here:
https://forum.armbian.com/topic/9009-in ... nline-4xx/
I used "nanopi-neo-air_eflasher_friendlycore-xenial_4.14_armhf_20181120.img" does this one support the PCM5102A?

-Raymond Day
As it booted up I seen:

[FAILED] Failed to start Load Kernel Modules.
See 'systemctl status systemd-modules-load.service' for details.

So I did that and got this back:

root@NanoPi-NEO-Air:~# systemctl status systemd-modules-load.service
● systemd-modules-load.service - Load Kernel Modules
Loaded: loaded (/lib/systemd/system/systemd-modules-load.service; static; ven
Active: failed (Result: exit-code) since Sat 2019-01-26 10:40:18 UTC; 58s ago
Docs: man:systemd-modules-load.service(8)
man:modules-load.d(5)
Process: 226 ExecStart=/lib/systemd/systemd-modules-load (code=exited, status=
Main PID: 226 (code=exited, status=1/FAILURE)

Warning: Journal has been rotated since unit was started. Log output is incomple
root@NanoPi-NEO-Air:~#

I guess it does mean that this kernel don't work with the PCM5102A sound hat.

Can a do some modprobe something like that?

-Raymond Day
Raymond Day wrote:
I used "nanopi-neo-air_eflasher_friendlycore-xenial_4.14_armhf_20181120.img" does this one support the PCM5102A?


did you enable I2S0 and the PCM5102A with npi-config like written in the Wiki about the PCM5102A?:
http://wiki.friendlyarm.com/wiki/index. ... 4.x_Kernel
I got it working!

Looked at http://wiki.friendlyarm.com/wiki/index.php/NanoHat_PCM5102A

Starting at "5.2 Under H3/H5 & Linux-4.x Kernel" I did npi-config and picked how they show in the photos there. Rebooted and did aplay /root/Music/test.wav -D plughw:4 and it plays music now.

Not sure why it install it as card 4.

Did not have to change the kernel looks like.

-Raymond Day
guidol wrote:
Raymond Day wrote:
I used "nanopi-neo-air_eflasher_friendlycore-xenial_4.14_armhf_20181120.img" does this one support the PCM5102A?


did you enable I2S0 and the PCM5102A with npi-config like written in the Wiki about the PCM5102A?:
http://wiki.friendlyarm.com/wiki/index. ... 4.x_Kernel


Wow we must of post this at about the same time.

-Raymond Day
Got the sound working but now I am trying to get squeezelite to work on this. But when I go to list all the devices it don't show card 4. It looks like this:

root@NanoPi-NEO-Air:/# squeezelite -l
Output devices:
null - Discard all samples (playback) or generate zero samples (capture)
default
sysdefault:CARD=Dummy - Dummy, Dummy PCM - Default Audio Device
dmix:CARD=Dummy,DEV=0 - Dummy, Dummy PCM - Direct sample mixing device
dsnoop:CARD=Dummy,DEV=0 - Dummy, Dummy PCM - Direct sample snooping device
hw:CARD=Dummy,DEV=0 - Dummy, Dummy PCM - Direct hardware device without any conversions
plughw:CARD=Dummy,DEV=0 - Dummy, Dummy PCM - Hardware device with all software conversions
sysdefault:CARD=Loopback - Loopback, Loopback PCM - Default Audio Device
front:CARD=Loopback,DEV=0 - Loopback, Loopback PCM - Front speakers
surround21:CARD=Loopback,DEV=0 - Loopback, Loopback PCM - 2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Loopback,DEV=0 - Loopback, Loopback PCM - 4.0 Surround output to Front and Rear speakers
surround41:CARD=Loopback,DEV=0 - Loopback, Loopback PCM - 4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Loopback,DEV=0 - Loopback, Loopback PCM - 5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Loopback,DEV=0 - Loopback, Loopback PCM - 5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Loopback,DEV=0 - Loopback, Loopback PCM - 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
dmix:CARD=Loopback,DEV=0 - Loopback, Loopback PCM - Direct sample mixing device
dmix:CARD=Loopback,DEV=1 - Loopback, Loopback PCM - Direct sample mixing device
dsnoop:CARD=Loopback,DEV=0 - Loopback, Loopback PCM - Direct sample snooping device
dsnoop:CARD=Loopback,DEV=1 - Loopback, Loopback PCM - Direct sample snooping device
hw:CARD=Loopback,DEV=0 - Loopback, Loopback PCM - Direct hardware device without any conversions
hw:CARD=Loopback,DEV=1 - Loopback, Loopback PCM - Direct hardware device without any conversions
plughw:CARD=Loopback,DEV=0 - Loopback, Loopback PCM - Hardware device with all software conversions
plughw:CARD=Loopback,DEV=1 - Loopback, Loopback PCM - Hardware device with all software conversions
sysdefault:CARD=Codec - H3 Audio Codec, - Default Audio Device
dmix:CARD=Codec,DEV=0 - H3 Audio Codec, - Direct sample mixing device
dsnoop:CARD=Codec,DEV=0 - H3 Audio Codec, - Direct sample snooping device
hw:CARD=Codec,DEV=0 - H3 Audio Codec, - Direct hardware device without any conversions
plughw:CARD=Codec,DEV=0 - H3 Audio Codec, - Hardware device with all software conversions
sysdefault:CARD=allwinnerhdmi - allwinner,hdmi, - Default Audio Device
dmix:CARD=allwinnerhdmi,DEV=0 - allwinner,hdmi, - Direct sample mixing device
dsnoop:CARD=allwinnerhdmi,DEV=0 - allwinner,hdmi, - Direct sample snooping device
hw:CARD=allwinnerhdmi,DEV=0 - allwinner,hdmi, - Direct hardware device without any conversions
plughw:CARD=allwinnerhdmi,DEV=0 - allwinner,hdmi, - Hardware device with all software conversions
sysdefault:CARD=I2Smaster - I2S-master, - Default Audio Device
dmix:CARD=I2Smaster,DEV=0 - I2S-master, - Direct sample mixing device
dsnoop:CARD=I2Smaster,DEV=0 - I2S-master, - Direct sample snooping device
hw:CARD=I2Smaster,DEV=0 - I2S-master, - Direct hardware device without any conversions
plughw:CARD=I2Smaster,DEV=0 - I2S-master, - Hardware device with all software conversions

root@NanoPi-NEO-Air:/#


DEV=0 or 1 but never any thing saying DEV=4

Is there a way to fix this?

-Raymond Day
whats the output of
aplay -l
and what is the content of your /etc/asound.conf ?
Sometimes after installting the pcm5102a - in mainline armbian - and reboot my pcm5102a changed from Card 0 to Card 1:

Code: Select all

root@npi-neo(192.168.6.24):~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Codec [H3 Audio Codec], device 0: CDC PCM Codec-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: I2Smaster [I2S-master], device 0: 1c22000.i2s-pcm5102a-hifi pcm5102a-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0


my /etc/asounf.conf :

Code: Select all

root@npi-neo(192.168.6.24):~# more /etc/asound.conf
pcm.!default {
    type hw
    card 1
    device 0
}

ctl.!default {
    type hw
    card 1
}

The out put is this:

root@NanoPi-NEO-Air:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e g happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
card 0: Dummy [Dummy], device 0: Dummy PCM [Dummy PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 1: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 1: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 2: Codec [H3 Audio Codec], device 0: CDC PCM Codec-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 3: allwinnerhdmi [allwinner,hdmi], device 0: 1c22800.i2s-i2s-hifi i2s-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 4: I2Smaster [I2S-master], device 0: 1c22000.i2s-pcm5102a-hifi pcm5102a-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
root@NanoPi-NEO-Air:~#


The file /etc/asound.conf looks like this. Wow says card 4 I will change it to 0 and maybe that will work.

pcm.!default {
type hw card 4
}
ctl.!default {
type hw card 4
}


I copied what you had in the /etc/asound.conf file and rebooted.

But it still says card 4 like this:

Welcome to Ubuntu 16.04.5 LTS 4.14.52
System load: 1.22 Up time: 5 min Local users: 2
Memory usage: 52 % of 491Mb IP: 192.168.86.250
CPU temp: 42°C
Usage of /: 10% of 29G

* Documentation: http://wiki.friendlyarm.com/Ubuntu
* Forum: http://www.friendlyarm.com/Forum/

Last login: Sat Jan 26 08:48:18 2019 from 192.168.86.54
root@NanoPi-NEO-Air:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Dummy [Dummy], device 0: Dummy PCM [Dummy PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 1: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 1: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 2: Codec [H3 Audio Codec], device 0: CDC PCM Codec-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 3: allwinnerhdmi [allwinner,hdmi], device 0: 1c22800.i2s-i2s-hifi i2s-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 4: I2Smaster [I2S-master], device 0: 1c22000.i2s-pcm5102a-hifi pcm5102a-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
root@NanoPi-NEO-Air:~#




I checked the /etc/asound.conf and it's still how I changed it to what you have.

Got this because I want to install it in a sound bar. But have to get it working good 1st.

-Raymond Day
I can play a song like this:

mpg123 '/home/odroid/Audeo/4 nice songs/02 - Fun Fun Fun.mp3' -D plughw:4

But I am trying to get it to work with squeezelite I don't get why it's not listing the Pcm5102a,DEV=4

root@NanoPi-NEO-Air:~# squeezelite -l
Output devices:
null - Discard all samples (playback) or generate zero samples (capture)
pulse - PulseAudio Sound Server
sysdefault:CARD=Dummy - Dummy, Dummy PCM - Default Audio Device
dmix:CARD=Dummy,DEV=0 - Dummy, Dummy PCM - Direct sample mixing device
dsnoop:CARD=Dummy,DEV=0 - Dummy, Dummy PCM - Direct sample snooping device
hw:CARD=Dummy,DEV=0 - Dummy, Dummy PCM - Direct hardware device without any conversions
plughw:CARD=Dummy,DEV=0 - Dummy, Dummy PCM - Hardware device with all software conversions
sysdefault:CARD=Loopback - Loopback, Loopback PCM - Default Audio Device
front:CARD=Loopback,DEV=0 - Loopback, Loopback PCM - Front speakers
surround21:CARD=Loopback,DEV=0 - Loopback, Loopback PCM - 2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Loopback,DEV=0 - Loopback, Loopback PCM - 4.0 Surround output to Front and Rear speakers
surround41:CARD=Loopback,DEV=0 - Loopback, Loopback PCM - 4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Loopback,DEV=0 - Loopback, Loopback PCM - 5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Loopback,DEV=0 - Loopback, Loopback PCM - 5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Loopback,DEV=0 - Loopback, Loopback PCM - 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
dmix:CARD=Loopback,DEV=0 - Loopback, Loopback PCM - Direct sample mixing device
dmix:CARD=Loopback,DEV=1 - Loopback, Loopback PCM - Direct sample mixing device
dsnoop:CARD=Loopback,DEV=0 - Loopback, Loopback PCM - Direct sample snooping device
dsnoop:CARD=Loopback,DEV=1 - Loopback, Loopback PCM - Direct sample snooping device
hw:CARD=Loopback,DEV=0 - Loopback, Loopback PCM - Direct hardware device without any conversions
hw:CARD=Loopback,DEV=1 - Loopback, Loopback PCM - Direct hardware device without any conversions
plughw:CARD=Loopback,DEV=0 - Loopback, Loopback PCM - Hardware device with all software conversions
plughw:CARD=Loopback,DEV=1 - Loopback, Loopback PCM - Hardware device with all software conversions
sysdefault:CARD=Codec - H3 Audio Codec, - Default Audio Device
dmix:CARD=Codec,DEV=0 - H3 Audio Codec, - Direct sample mixing device
dsnoop:CARD=Codec,DEV=0 - H3 Audio Codec, - Direct sample snooping device
hw:CARD=Codec,DEV=0 - H3 Audio Codec, - Direct hardware device without any conversions
plughw:CARD=Codec,DEV=0 - H3 Audio Codec, - Hardware device with all software conversions
sysdefault:CARD=allwinnerhdmi - allwinner,hdmi, - Default Audio Device
dmix:CARD=allwinnerhdmi,DEV=0 - allwinner,hdmi, - Direct sample mixing device
dsnoop:CARD=allwinnerhdmi,DEV=0 - allwinner,hdmi, - Direct sample snooping device
hw:CARD=allwinnerhdmi,DEV=0 - allwinner,hdmi, - Direct hardware device without any conversions
plughw:CARD=allwinnerhdmi,DEV=0 - allwinner,hdmi, - Hardware device with all software conversions
sysdefault:CARD=I2Smaster - I2S-master, - Default Audio Device
dmix:CARD=I2Smaster,DEV=0 - I2S-master, - Direct sample mixing device
dsnoop:CARD=I2Smaster,DEV=0 - I2S-master, - Direct sample snooping device
hw:CARD=I2Smaster,DEV=0 - I2S-master, - Direct hardware device without any conversions
plughw:CARD=I2Smaster,DEV=0 - I2S-master, - Hardware device with all software conversions

root@NanoPi-NEO-Air:~#


It list a lot but none are DEV=4

I don't know how it get's it's device list. Maybe it can't go up to 4 only 0 and 1 not sure.

-Raymond Day
Raymond Day wrote:
But I am trying to get it to work with squeezelite I don't get why it's not listing the Pcm5102a,DEV=4

root@NanoPi-NEO-Air:~# squeezelite -l
Output devices:
sysdefault:CARD=I2Smaster - I2S-master, - Default Audio Device

root@NanoPi-NEO-Air:~#


isnt that device-name useable without device-numer?

in this thread they used on a RPi the follwoing name for a card:

Code: Select all

~/squeezelite $ ./squeezelite -o sysdefault:CARD=GenericRJ -a 20:4:16:1 -s 192.168.1.13
"16" in -a 20:4:16:1 means force 16 bits

With Squeezelite I get a software volume
0 => no sound
1=> sound not weak, noisy
from around 12, the sound become less noisy but it is already very loud
20=> is close to max before the amp clips

Who is online

In total there are 5 users online :: 0 registered, 0 hidden and 5 guests (based on users active over the past 5 minutes)
Most users ever online was 5185 on Wed Jan 22, 2020 1:44 pm

Users browsing this forum: No registered users and 5 guests