Hello,

I've bought some small I2S audio amplifiers to play music on speakers. They work fine on a Raspberry Pi 3B+, following a tutorial from Adafruit. Then I tried to use them on a NanoPi NEO that has dedicated I2S pins. My first effort was with Armbian but that doesn't have any support for I2S so I looked for other options. I found the "official" OS image on the FriendlyElec wiki page and downloaded and installed nanopi-neo_sd_friendlycore-focal_4.14_armhf_20210618.img onto the SD card. It should be based on Ubuntu 20.04, the kernel is "Linux NanoPi-NEO 4.14.111 #193 SMP Thu Jun 10 18:20:47 CST 2021 armv7l armv7l armv7l GNU/Linux".

At least alsamixer shows some output and even input channels, one of them is named DAC. There are even multiple sound cards, one of them has "hdmi" in the name. I think I've tried all of them with speaker-test but couldn't hear anything.

What are the correct settings to make the I2S output work with common audio playback software like mpg123 or speaker-test?

I did a web search but found nothing. This forum doesn't want to search because it thinks that "i2s" is a too common term. So if it's so common here, I guess somebody should be able to tell me how it works. ;-)

Here's the output of 'aplay -l':

Code: Select all

**** 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


And the output of 'aplay -L':

Code: Select all

null
    Discard all samples (playback) or generate zero samples (capture)
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