[tim-janik/beast] No sound without -p alsa=pulse (#119)
BEAST for a very long time now refused to produce audio out of the box without the command line args -p alsa=pulse - I am using (setup by Cadence)
JACK as primary sound server
PulseAudio bridged to JACK
Problems have been reported by other users (#92#80). Since the new Electron UI doesn't have command line args, the workaround cannot be used there, so the new UI has no sound.
In order to make this work out-of-the-box: why does the workaround work, whereas auto-detected audio output fails?
First of all, it doesn't matter if you use -p alsa=default or -p alsa=pulse. The default device is pulse. So this is the first device the ALSA driver tries to open during auto detect. But open fails during auto detect. The reason here is that during auto detect, BEAST tries to open the default device in full duplex mode. Why doesn't this work?
Using printf()s in the alsa pcm driver, I found that although read_handle and write_handle can be opened for pulse, the following fails
In any case, the auto detection will try all available devices in duplex mode, and settle for some audio device that I don't use - instead of the default device - like for instance onboard audio which is not connected.
If I on the other hand specify -p alsa=pulse, BEAST will try to open the audio output in duplex mode, and fail. Then it will try to open pulseaudio in output-only mode, and succeed.
Some ideas how to make it work out-of-the-box:
adapt alsa driver so that it still works if snd_pcm_link fails
merge JACK driver
allow explicit driver selection in the UI (effectively allowing users to force PulseAudio output)
force default device if default device is present, even if this has no full duplex mode