roc-toolkit
roc-toolkit copied to clipboard
Auto-detect appropriate audio backend
If the driver and device are omitted, roc-recv and roc-send tools select the default driver and device. When it is done, they always prefer PulseAudio over ALSA if both were enabled during build.
If the tools were built with PulseAudio support enabled but are running on a system without PulseAudio daemon installed, this becomes a problem.
To fix this, we should check at run time whether PulseAudio daemon is really available on the system and don't try to use it if it's not.
We already have sndio::BackendDispatcher
that selects an appropriate backend by calling probe()
on all supported backends and selecting the first one that returned true. When the driver and device are omitted, it calls probe(NULL, NULL)
.
Hence, all we need is to update PulseaudioBackend::probe()
so that it will return false if the driver and device are NULL and the PulseAudio daemon is not available on the system.
It's a question how we can check this. Probably we can do it somehow using libpulse API.
See also #251. It provides an overview of roc_sndio concepts.
Hello @gavv , I just looked at this project and it seems very exciting to contribute to. I was wondering if I could pick up on this issue if it has not been assigned to anyone else.
@enigmaro Great, you're welcome, the issue is free.
Hi, saw your message on IRC, but you're offline already, so answering here.
Is it a valid approach to check if the PulseAudio daemon is running during run time to check if a simple context connection can be made to the default PulseAudio Server?
Sounds good. Let's try it and see how it'll work.
BTW if you want to receive offline messages on IRC, see here https://roc-streaming.org/toolkit/docs/about_project/contacts.html
@enigmaro Hi! Do you still have plans on this?