markferry / multizone-audio

A config generator for a multizone audio system based on snapcast, Mopidy and MQTT.
32 stars 5 forks source link

RPi vc4-kms-v3d driver does not support hardware mixing #20

Open markferry opened 1 year ago

markferry commented 1 year ago

...or at least doesn't provide an Alsa dmixer.

https://forums.raspberrypi.com/viewtopic.php?t=324067

https://github.com/raspberrypi/linux/issues/4951

This applies to Debian 11-based RPi distros without pulseaudio. (OSMC does not support pulseaudio).

Observations

snapclient -s vc4hdmi fails with:

2023-06-14 16-34-12.160 [Info] (Player) Player name: alsa, device: hw:CARD=vc4hdmi,DEV=0, description: vc4-hdmi, MAI PCM i2s-hifi-0
2023-06-14 16-34-12.160 [Info] (Player) Direct hardware device without any conversions, idx: 18, sharing mode: unspecified, parameters: <none>
2023-06-14 16-34-12.160 [Info] (Player) Mixer mode: software, parameters: <none>
2023-06-14 16-34-12.160 [Info] (Player) Sampleformat: 48000:16:2, stream: 48000:16:2
2023-06-14 16-34-12.160 [Info] (Alsa) Using default buffer_time: 80 ms, default fragments: 4
2023-06-14 16-34-12.161 [Error] (Alsa) Exception: Can't set format: Invalid argument, supported: IEC958_SUBFRAME_LE , code: 0
2023-06-14 16-34-12.162 [Fatal] (Snapclient) Exception: Can't set format: Invalid argument, supported: IEC958_SUBFRAME_LE 
2023-06-14 16-34-12.162 [Notice] (Snapclient) Snapclient terminated.

Workaround

Use the Fake KMS and reenable ALSA compatibility.

dtoverlay must be set in /boot/config.txt:

[all]
dtoverlay=vc4-fkms-v3d,cma-512

/boot/config-user.txt:

dtparam=audio=on

/boot/cmdline.txt:

... snd_bcm2835.enable_headphones=1 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_compat_alsa=1
markferry commented 1 year ago

vc4-fkms-v3d doesn't support passthrough. This wasn't a problem for the study (which is 2.0 only) but is in the ballroom (which is 5.0)

https://forums.raspberrypi.com/viewtopic.php?t=342929