roc-toolkit icon indicating copy to clipboard operation
roc-toolkit copied to clipboard

Auto-detect appropriate audio backend

Open gavv opened this issue 5 years ago • 5 comments

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.

gavv avatar May 27 '19 16:05 gavv

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 avatar Jul 08 '20 23:07 enigmaro

@enigmaro Great, you're welcome, the issue is free.

gavv avatar Jul 09 '20 08:07 gavv

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.

gavv avatar Jul 09 '20 20:07 gavv

BTW if you want to receive offline messages on IRC, see here https://roc-streaming.org/toolkit/docs/about_project/contacts.html

gavv avatar Jul 09 '20 21:07 gavv

@enigmaro Hi! Do you still have plans on this?

gavv avatar Mar 05 '21 10:03 gavv