home-assistant / plugin-audio

Pulseaudio implementation for Home Assistant
Apache License 2.0
24 stars 13 forks source link

Use new-style s6-rc to initialize ALSA to avoid race conditions #156

Closed agners closed 6 months ago

agners commented 6 months ago

It seems that particularly on ODROID-N2 the startup of Pulseaudio and the initial ALSA initialization races: Pulseaudio is not aware of the analog audio outputs, hence breaking Audio support on the 3.5mm Jack.

According to s6-overlay documentation, /etc/cont-init.d should get initialized before the s6-rc services. However, this seems not to be the cases. Probably because the "base" dependency was missing.

In any case, just modernize the initialization by using the new-style s6-rc oneshot type for the initial ALSA initialization. Also make sure to start the udev listener before initial ALSA initialization to avoid any possible race condition.

Fixes: #157