audio-problem on RaspberryPi4 with aarch64

This forum is for topics dealing with problems with software specifically in the AArch64 repo.

audio-problem on RaspberryPi4 with aarch64

Postby hp4 » Fri Oct 23, 2020 11:18 am

Hi,
audio works fine on my 1 year old RaspberryPi4 running Archlinux-32Bit.
On my new RaspberryPI4 I've installed aarch64 according to the official installation procedure, but I can't get audio working with pulseaudio. I can play an audio file with aplay, but not with paplay: pulseaudio doesn't detect a soundcard with it's udev module.

I'm not an audio-expert but it seems to me that the HW is not correctly identified on the 64Bit system (/dev/scd/controlC1 misssing??) and the driver identifies completely different cards/devices/subdevices.

Can anybody help with the audio-configuration? Do I need to add something to /boot/config.txt ?

Thanks in advance
HP

I've observed the following differences
_______________________________________________________________________________
ls /dev/snd on 32Bit
by-path controlC0 controlC1 pcmC0D0p pcmC1D0p seq timer
_______________________________________________________________________________
ls /dev/snd on 64Bit
by-path controlC0 pcmC0D0p pcmC0D1p seq timer

_______________________________________________________________________________

"lsmod | grep snd" on 32Bit

snd_soc_core 192512 1 vc4
snd_compress 20480 1 snd_soc_core
snd_pcm_dmaengine 16384 1 snd_soc_core
snd_bcm2835 24576 4
snd_pcm 98304 6 vc4,snd_pcm_dmaengine,snd_bcm2835,snd_soc_core
snd_timer 32768 1 snd_pcm
snd 73728 11 snd_compress,snd_timer,snd_bcm2835,snd_soc_core,snd_pcm
_______________________________________________________________________________
"lsmod | grep snd" on 64Bit

snd_bcm2835 36864 0
snd_usb_audio 307200 0
snd_usbmidi_lib 40960 1 snd_usb_audio
snd_hwdep 20480 1 snd_usb_audio
snd_rawmidi 49152 1 snd_usbmidi_lib
snd_seq_device 20480 1 snd_rawmidi
mc 69632 4 videodev,snd_usb_audio,videobuf2_v4l2,videobuf2_common

(the snd.ko module is not listed because it's a kernel-builtin)
_______________________________________________________________________________

aplay -l (on 32Bit)
hape@pallas's password:
aplay: device_list:274: no soundcards found...
[root@merkur hape]# ssh pulse@pallas aplay -l
pulse@pallas's password:
**** List of PLAYBACK Hardware Devices ****
card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
Subdevices: 3/4
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
Subdevices: 3/4
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3

_______________________________________________________________________________
aplay -l (on 64Bit)
**** Liste der Hardware-Geräte (PLAYBACK) ****
Karte 0: ALSA [bcm2835 ALSA], Gerät 0: bcm2835 ALSA [bcm2835 ALSA]
Sub-Geräte: 7/7
Sub-Gerät #0: subdevice #0
Sub-Gerät #1: subdevice #1
Sub-Gerät #2: subdevice #2
Sub-Gerät #3: subdevice #3
Sub-Gerät #4: subdevice #4
Sub-Gerät #5: subdevice #5
Sub-Gerät #6: subdevice #6
Karte 0: ALSA [bcm2835 ALSA], Gerät 1: bcm2835 IEC958/HDMI [bcm2835 IEC958/HDMI]
Sub-Geräte: 1/1
Sub-Gerät #0: subdevice #0
_______________________________________________________________________________
hp4
 
Posts: 45
Joined: Thu May 30, 2013 12:09 pm

Re: audio-problem on RaspberryPi4 with aarch64

Postby darksky » Fri Oct 23, 2020 8:44 pm

Did you install pulseaudio-alsa?

Seems like I also had to remove ~/.config/pulse directory also when I was messing with it. It will create a new one.

After I got it going the sound was choppy and also had to modify /etc/pulse/default.pa and add tsched=0 on the line below:

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect tsched=0
.else
darksky
 
Posts: 35
Joined: Thu Oct 15, 2020 5:57 pm

Re: audio-problem on RaspberryPi4 with aarch64

Postby hp4 » Fri Oct 23, 2020 10:46 pm

pulseaudio-alsa has been installed and I've tried the tsched=0-option and removed the .config-files, but it didn't help.

What seems strange to me is the fact taht the 32Bit-archlinux detects 2 soundcards (HDMI and headphones, both supplied by the bcm2835-HW) while the 64Bit-archlinux only detects 1 card with 2 devices (but no headphones?). Both systems have different driver concepts, e.g. snd.ko ist built in the kernel in the 64Bit while it is loadable in the 32Bit-system. Although not being a driver-expert I suppose that it's a driver problem. Is there any possibility to check, whether the "aplay -l"-results are correct for the 64Bit-archlinux? If the card-names are read from the HW-device (bcm2835) they should be the same as in the 32Bit-system?
hp4
 
Posts: 45
Joined: Thu May 30, 2013 12:09 pm

Re: audio-problem on RaspberryPi4 with aarch64

Postby darksky » Sat Oct 24, 2020 3:14 pm

I do not have that image installed right now so I can not look at the devices. In the program alsamixer is your volume turned all the way up?
darksky
 
Posts: 35
Joined: Thu Oct 15, 2020 5:57 pm

Re: audio-problem on RaspberryPi4 with aarch64

Postby hp4 » Sat Oct 24, 2020 3:48 pm

alsa and alsamixer are ok and I can play audiofiles with aplay.

But pulseaudio doesn't work, because module-udev doesn't see any soundcard.

To ne this seems to be a 64Bit-image-problem because it works on another Raspi4 with 32Bit-image.

And obviously both images show completely different Audio-HW in /proc and /dev, although the HW is the same!

I don't have much alsa-experience, but I'm wondering:

is alsa-sw free to interprete the same HW in different ways depending on the kernel-image?
is there any other way to show the HW-structure like lsusb or lspci? Or is "aplay -l" the only option?
hp4
 
Posts: 45
Joined: Thu May 30, 2013 12:09 pm

Re: audio-problem on RaspberryPi4 with aarch64

Postby darksky » Sat Oct 24, 2020 7:13 pm

I was wrong, I still had the aarch64 image and my devices are the same as yours so they are correct.

$this->bbcode_second_pass_code('', '[alarm@alarm ~]$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 7/7
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
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 IEC958/HDMI [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0')

I remember when I first built the image I also had no sound. I do remember uninstalling and re-installing the related files, turning up the volume as it was muted, removing ~/.config/pulse directory and doing the fix for choppy sound. Here is what I have related installed. Try uninstalling all the programs and reinstalling, remove ~/.config/pulse directory and reboot:

$this->bbcode_second_pass_code('', '[alarm@alarm ~]$
[alarm@alarm ~]$ pacman -Ss pulse | grep installed
extra/alsa-card-profiles 13.99.2+13+g7f4d7fcf5-1 [installed]
extra/libpulse 13.99.2+13+g7f4d7fcf5-1 [installed]
extra/pulseaudio 13.99.2+13+g7f4d7fcf5-1 [installed]
extra/pulseaudio-alsa 1:1.2.2-2 [installed]
[alarm@alarm ~]$
[alarm@alarm ~]$ pacman -Ss alsa | grep installed
extra/alsa-card-profiles 13.99.2+13+g7f4d7fcf5-1 [installed]
extra/alsa-lib 1.2.4-3 [installed]
extra/alsa-plugins 1:1.2.2-2 [installed]
extra/alsa-topology-conf 1.2.4-2 [installed]
extra/alsa-ucm-conf 1.2.4-2 [installed]
extra/alsa-utils 1.2.4-2 [installed]
extra/pulseaudio-alsa 1:1.2.2-2 [installed]
extra/zita-alsa-pcmi 0.3.2-3 [installed]')
darksky
 
Posts: 35
Joined: Thu Oct 15, 2020 5:57 pm

Re: audio-problem on RaspberryPi4 with aarch64

Postby hp4 » Sun Oct 25, 2020 8:12 am

I followed your recommendations and now it seems to work.

My "aplay -l"-results are the same : 1 card with 2 devices on 64Bit

What I don't understand:

What is different in the 32-Bit-Archlinux environment (2 Soundcards detected) ? Is there any reason to implement it differently? Otherwise it's simply confusing.....

Where have the headphones gone? (32Bit : "card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]")

Are sounddevices a virtual sw-concept independent on the real underlying hw?
hp4
 
Posts: 45
Joined: Thu May 30, 2013 12:09 pm

Re: audio-problem on RaspberryPi4 with aarch64

Postby darksky » Fri Oct 30, 2020 5:39 pm

@hp4 this will blow your mind even farther with the new 5.10-rc1 with the new VC4 I compiled and playing with. You will get a black screen until the vc4 mods load. The sound does not work via the hdmi yet (what a surprise!) but does via the onboard audio jack. One has to use the mainline bcm2711-rpi-4-b.dtb (It now boots) instead of the one from RPi to get the vc4 modules to load. Heres the new device list:

$this->bbcode_second_pass_code('', '[ray@pi4 ~]$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 7/7
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
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 IEC958/HDMI [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: vc4hdmi0 [vc4-hdmi-0], device 0: MAI PCM vc4-hdmi-hifi-0 [MAI PCM vc4-hdmi-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: vc4hdmi1 [vc4-hdmi-1], device 0: MAI PCM vc4-hdmi-hifi-0 [MAI PCM vc4-hdmi-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
[ray@pi4 ~]$
[ray@pi4 ~]$ uname -a
Linux pi4 5.10.0-rc1-1 #1 SMP PREEMPT Mon Oct 26 15:37:14 CDT 2020 aarch64 GNU/Linux')
darksky
 
Posts: 35
Joined: Thu Oct 15, 2020 5:57 pm

Re: audio-problem on RaspberryPi4 with aarch64

Postby hp4 » Fri Nov 06, 2020 9:19 pm

@darksky : thanks for this info. But it's also a serious blow to my view of Linux as an operating system based on reasonable and understandable (device-)concepts (as opposed to windows). To my impression even a moderately experienced user should be able to trace back problems from an application to a specific driver being responsible for a well defined device/HW. But this seems to get completely lost when drivers deceive the user by inventing fantasy devices which have no correspondence to any hardware.To my opinion the audio-kernel developers should have invented an abstraction layer with objects not named as devices/cards, but mapped to physical devices in an understandable way. E.g. the simplest question for the 64Bit-SW would be : where have the headphones gone? Or did they never exist, even in the 32Bit-SW which is pretending to know about them? At least when it comes to plugging in some external connectors, you have to have a clear understanding of the corressponding devices....or at least "aplay -l" should be replaced by a "lsusb"/"lspci"-like command for the hardware
hp4
 
Posts: 45
Joined: Thu May 30, 2013 12:09 pm

Re: audio-problem on RaspberryPi4 with aarch64

Postby lategoodbye » Sun Nov 08, 2020 10:57 am

AFAIK aarch64 uses the mainline kernel, while the 32bit version contains the vendor kernel from the raspberry pi foundation. It will took some time until the necessary parts (vchiq, bcm2835-audio) are ported for BCM2711 into the mainline kernel.
lategoodbye
 
Posts: 116
Joined: Sat Dec 29, 2018 1:24 am


Return to ARMv8

Who is online

Users browsing this forum: No registered users and 16 guests