Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5384

Troubleshooting • Bookworm, KMS, and Headless Audio

$
0
0
For context, I'm working on updates to Running A Program At Start Up A Beginner's Guide specifically in regard to audio applications prior to login.

Test system:
  • 4B
  • Raspberry Pi OS 32bit with desktop.
  • The following in /etc/rc.local:

    Code:

    aplay /usr/share/sounds/alsa/Front_Center.wav >/tmp/rcl.log 2>&1
    (Yes, above exit 0.)
  • The following in $HOME/.bashrc:

    Code:

    cat /tmp/*.logaplay /usr/share/sounds/alsa/Front_Center.wav
  • OS set (via raspi-config) to
    • Boot to command line without automatic login.
    • Use the 3.5mm jack for audio.
Under Bullseye/legacy things work as expected whether or not a monitor is connected. aplay works from rc.local, sound is heard, log contains no errors, audio is played on manual login (even if over serial).

Under Bookworm with a monitor connected things works as expected.

Under Bookworm with no monitor connected the log shows aplay: main:831: audio open error: Unknown error 524. Audio plays as expected on manual login. Adding video=HDMI-A-1:1024x768@60D does not help. (does something need to be added to indicate audio?).

The choice of PulseAudio or Pipewire makes no difference.

Booting to commandline or desktop makes no difference.

Automatic login setting makes no difference.

cron and systemd services behave the same way as rc.local.

Seems to me that this is a bug introduced in Bookworm. I'd expect the configured audio output (unless it's HDMI, obviously) to function regardless of whether a monitor has been detected or not. As it does on Bullseye/legacy.

It's a real PITA if you want to start audio stuff from anything other than a logged in session (i.e. from cron, rc.local, systemd, ...).

Any thoughts anyone? The search for a hack will continue...

Statistics: Posted by thagrol — Fri Aug 16, 2024 4:31 pm



Viewing all articles
Browse latest Browse all 5384

Trending Articles