Sound issues with the 5.10.x kernel (alsa)

Diederik de Haas didi.debian at cknow.org
Thu Feb 11 19:19:18 EST 2021


On maandag 8 februari 2021 13:22:56 CET Stefan Wahren wrote:
> Hi Diederik,
> 
> Am 08.02.21 um 12:47 schrieb Diederik de Haas:
> > Hi,
> > 
> > This is basically me forwarding the bug I reported on Debian's BTS:
> > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=978025
> > 
> > TL;DR: I have a RPi 3B+ running pure Debian Bullseye arm64 (~from
> > raspi.debian.net), named rpi-mpd, connected via HDMI cable to my AV
> > Receiver.
> can you please confirm that the bcm2835-audio driver causing the issues?

I'd still like to know how I can confirm that.
 
> > Playing music worked fine with kernel 5.9, but with 5.10.2-1 the music
> > (quality) became not good to quite horribly, because of (static) noise and
> > distortion.
> 
> I cannot explain why 5.10.9 works for you

Absence of vc4.ko turned out to be the reason.

> Currently i cannot see any of the fixes by Phil Elwell in linux-stable. 
> Could you please try?

So I managed to build an upstream kernel and booted that. I first want to have 
a clean upstream build to get a 'baseline' and verify that it does work. When I 
have that, I'll build a new kernel with the patches applied*.

Bc I'm *quite* new at building my own kernel, here's in short how I did it:
git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
cd linux
git checkout linux-5.10.y
git checkout -b clean-5.10-build
<specify EXTRAVERSION to easily distinguish different builds>
export ARCH=arm64
make defconfig
<from https://wiki.debian.org/RaspberryPi4#Build_a_kernel_as_a_Debian_package>
scripts/config --disable DEBUG_INFO
sed -i '/KBUILD_IMAGE/ s/.gz//' arch/arm64/Makefile
make -j `nproc` bindeb-pkg

and that gave me a .deb package with which I installed the kernel
First rebooted successfully the RPi3B+ I build it on (headless with serial console).
Then copied it to rpi-mpd and installed it. The rpi-mpd device is connected to 
my AV Receiver which is connected to my TV. With a Debian kernel I saw all 
the boot up messages and then a login prompt.
With my new (5.10.15) kernel, I either saw a couple or even none of the boot 
up msgs, but I did get a login prompt. I operate it through ssh though.

While it did boot up, I now have only 1 soundcard: vc4hdmi
I reference that one also in the Debian bug, but I didn't understand what it 
was for or how to use it. And that is still the case.

$ uname -a
Linux rpi-mpd 5.10.15didi-clean-dirty #1 SMP PREEMPT Wed Feb 10 21:11:17 CET 2021 aarch64
(-dirty is bc of uncommitted changes)
$ cat /proc/cmdline 
video=HDMI-A-1:1920x1080M at 60,margin_left=48,margin_right=48,margin_top=48,
margin_bottom=48 dma.dmachans=0x7ff5 bcm2709.boardrev=0xa020d3 
bcm2709.serial=0xXX bcm2709.uart_clock=48000000 bcm2709.disk_led_gpio=29 
bcm2709.disk_led_active_low=0 smsc95xx.macaddr=B8:27:EB:B4:EB:14 
vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  console=tty0 
console=ttyS1,115200 root=/dev/mmcblk0p2 rw fsck.repair=yes net.ifnames=0 
cma=64M rootwait
$ cat /proc/asound/cards
 0 [vc4hdmi        ]: vc4-hdmi - vc4-hdmi
                      vc4-hdmi
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: vc4hdmi [vc4-hdmi], device 0: MAI PCM vc4-hdmi-hifi-0 [MAI PCM vc4-hdmi-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
$ aplay /usr/share/sounds/alsa/Front_Right.wav 
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
aplay: main:830: audio open error: No such device

part of mpd.log:
Feb 11 12:55 : exception: Failed to open "My ALSA Device" (alsa); Failed to open ALSA device "default": Invalid argument
Feb 11 12:55 : exception: Failed to open "My ALSA Device" (alsa); Failed to open ALSA device "default": Invalid argument
<change audio_output type "alsa" name property from "My ALSA Device" to "vc4hdmi" and restart mpd>
Feb 11 12:58 : zeroconf: No global port, disabling zeroconf
ALSA lib pcm_direct.c:1206:(snd1_pcm_direct_initialize_slave) requested or auto-format is not available
ALSA lib pcm_dmix.c:1087:(snd_pcm_dmix_open) unable to initialize slave
Feb 11 12:59 : exception: Failed to open "vc4hdmi" (alsa); Failed to open ALSA device "default": Invalid argument
Feb 11 12:59 : exception: Failed to open "vc4hdmi" (alsa); Failed to open ALSA device "default": Invalid argument

With the Debian kernels I also have an ALSA soundcard (bcm2835 iirc)

>From this point on, I'd need some help to get audio working.
If you need more info or want me to runs certain command, just ask and I'll 
happily do/supply them.
I think this is the very first time I've successfully build a kernel and booted
up with it, so please don't think "surely he must've done X"

Cheers,
  Diederik

*) is there a way that I can (f.e.) 'git am' those posts/patches? They're small 
patches so I could modify the code manually, but surely there's a better way.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-rpi-kernel/attachments/20210212/0365a2f5/attachment.sig>


More information about the linux-rpi-kernel mailing list