Startup applications can not play audio
I want to launch a media player through "Startup Application Preferences". Login is set to automatic.
The application launches but there is no audio output to the speakers. I checked with pavucontrol and the app outputs something to PulseAudio. The audio is not muted and the correct output device and configuration/
I can make it work again by selecting a different audio profile in pavucontrol and then switch back to the original one.
However, when there is no audio app in "startup applications" and I wait a bit after login, I can start the media player and it works as expected.
Also, when I launch the media player through a script on startup and I add a "sleep 5" before starting the media player, sound also works. With "sleep 2", it sometimes works, sometimes not. But I don't want to play with random delays because I can never be sure that the delay is large enough to make it work.
There seems to be a race condition involved.
Can anyone confirm this behavior? Any fix/workaround for this?
I am running
- Ubuntu 22.04.1
- Intel NUC 12 i5
- Speakers connected to the headphone port
- Any media player that uses PulseAudio (e.g. paplay)
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Christian Stussak
- Solved:
- Last query:
- Last reply: