AC3 5.1 toslink audio very choppy
I don't know that much about the audio stack so please tell me what to check if you want me to check something.
Setup: Denon AVR-2807 connected with a toslink cable to a ROG Crosshair VIII Impact mainboard (0d:00.4 Audio device: Advanced Micro Devices, Inc. [AMD] Starship/Matisse HD Audio Controller). Archlinux with iirc stock alsa & pipewire config.
Video with sound of the issue: https://cloud.frickel.club/s/bKeYyxMygH8nm4J. First the stereo profile is set up in pipewire, then I switch to the 5.1 profile, then I switch back to stereo.
Notice how the receiver shows the input sources flickering, seems related to the choppiness.
For this video I only play stereo music, but it happens when playing dts encoded media (not sure if this does just passthrough with the stock config) or just speaker-test -f 75 -c 6 -t pink -s 2
too.
With the 5.1 profile pipewire spams pipewire[405354]: spa.alsa: a52:2: mmap_commit wrote 512 instead of 1024
to the log twice a second but word on other issues is that it should be harmless. With the stereo profile this doesn't happen.
The one thing I thought of to try is try to rule out alsa vs pipewire. Following the description in #2648 I disabled pulseaudio, set the channel mode to 6 channels in alsamixer and ran aplay -D"plug:{SLAVE=\"a52:1,'hw:2,0'\"}" Nums_5dot1_24_48000.wav
with the file from https://samplemedia.linaro.org/Audio/multi-channel/. This results in clear and fully working sound from all speakers.
Playing the same aplay Nums_5dot1_24_48000.wav
with pipewire results in choppy audio. On the plus side, the choppy audio is actually playing on the correct speakers.