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 
(https://github.com/tim-janik/beast/issues/92 
https://github.com/tim-janik/beast/issues/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
```
   if (error == 0 && alsa->read_handle && alsa->write_handle &&
       snd_pcm_link (alsa->read_handle, alsa->write_handle) < 0)
     error = Bse::Error::DEVICES_MISMATCH;
```
This was observed already here: 
https://github.com/tim-janik/beast/issues/80#issuecomment-421115474

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


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/tim-janik/beast/issues/119
_______________________________________________
beast mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/beast

Reply via email to