I'm working on an embedded system running a stripped down version of Ubuntu 22.04. We've recently updated some hardware in the embedded system and I'm working on getting our Ubuntu image working on the new hardware.
On the old hardware the pulseaudio service always ran without any issues, but on the new hardware I'm having an issue with pulseaudio not detecting Alsa card 0 when the service starts during boot. If I restart the service via systemctl --user restart pulseaudio.service
then it does detect Alsa card 0 and everything works.
My suspicion is that pulseaudio is checking for the existence of a character device in /dev/snd/
or maybe the presence of a file/folder in /proc/asound/
, but the device or file it's looking for does not exist yet and is created later by a kernel module being loaded.
To try to verify my suspicions, I'm trying to run strace on the service during boot. I've updated /usr/lib/systemd/user/pulseaudio.service and changed the the ExecStart line as follows:
ExecStart=strace -e trace=file -o /home/user/trace_erronly_fail.log -Z -f -tt /usr/bin/pulseaudio --daemonize=no --log-target=journal --log-level=debug
After running systemctl --user daemon-reload
, I try starting the service to test that the strace will work, but the service fails to start. The service status reports the following:
x pulseaudio.service - Sound Service
Loaded: loaded (/usr/lib/systemd/user/pulseaudio.service; enabled; vendor preset: enabled)
Active: failed (Result: core-dump) since Wed 2023-04-19 12:33:21 UTC; 2s ago
TriggeredBy: x pulseaudio.socket
Process: 1673 ExecStart=strace -e trace=file -o /home/user/trace_erronly_fail.log -Z -f -tt /usr/bin/pulseaudio --daemonize=no --log-target=journal --log-level=debug (code=dumped, signal=SYS)
Main PID: 1673 (code=dumped, signal=SYS)
CPU: 49ms
Apr 19 12:33:21 Ubuntu-V8 systemd[780]: pulseaudio.service: Scheduled restart job, restart counter is at 5.
Apr 19 12:33:21 Ubuntu-V8 systemd[780]: Stopped Sound Service.
Apr 19 12:33:21 Ubuntu-V8 systemd[780]: pulseaudio.service: Start request repeated too quickly.
Apr 19 12:33:21 Ubuntu-V8 systemd[780]: pulseaudio.service: Failed with result 'core-dump'.
Apr 19 12:33:21 Ubuntu-V8 systemd[780]: Failed to start Sound Service.
Seems like it's raising a SIGSYS signal, which according to man 7 signal
is raised when there's a bad system call.
I'm not really sure why it's having this issue. I am able to run the ExecStart command manually without it raising the SIGSYS signal, so it only does it when it's run as a systemd service.
So, how can I get strace to work when run as a systemd service?