Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-detect appropriate audio backend #198

Closed
gavv opened this issue May 27, 2019 · 5 comments
Closed

Auto-detect appropriate audio backend #198

gavv opened this issue May 27, 2019 · 5 comments
Assignees
Labels
easy hacks The solution is expected to be straightforward even if you are new to the project enhancement help wanted An important and awaited task but we have no human resources for it yet sound io Audio I/O
Milestone

Comments

@gavv
Copy link
Member

gavv commented May 27, 2019

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 gavv changed the title Auto-detect appropriate driver Auto-detect appropriate audio backend Jul 4, 2019
@gavv gavv added help wanted An important and awaited task but we have no human resources for it yet easy hacks The solution is expected to be straightforward even if you are new to the project good for newcomers labels Jul 4, 2019
@gavv gavv added the sound io Audio I/O label Sep 12, 2019
@gavv gavv removed the hacktoberfest label Nov 4, 2019
@enigmaro
Copy link
Contributor

enigmaro commented Jul 8, 2020

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.

@gavv
Copy link
Member Author

gavv commented Jul 9, 2020

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

@gavv
Copy link
Member Author

gavv commented Jul 9, 2020

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
Copy link
Member Author

gavv commented Jul 9, 2020

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

@gavv
Copy link
Member Author

gavv commented Mar 5, 2021

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

@gavv gavv assigned enigmaro and unassigned enigmaro Mar 7, 2023
@gavv gavv closed this as completed Mar 7, 2023
@gavv gavv added this to the 0.2.0 milestone Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy hacks The solution is expected to be straightforward even if you are new to the project enhancement help wanted An important and awaited task but we have no human resources for it yet sound io Audio I/O
Projects
Status: Done
Development

No branches or pull requests

2 participants