Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Multiple sound devices and regular programs (i.e. browsers)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Wed Feb 01, 2017 3:34 pm    Post subject: Multiple sound devices and regular programs (i.e. browsers) Reply with quote

Hi.

I just wanted to collect info on how people around here deal with multiple sound devices in day to day average Joe operations.

Nowadays, having a system, PC, media-box, phone or whatever which makes use of multiple sound devices is no longer uncommon. There's the case when you have a PC with a regular sound card and you plug some kind of wifi dongle or an hdmi capable TV to it, etc.

From my point of view, there are two ways to deal with this kind of setup.

First, there's the program-by-program support for handling audio devices. Media programs, such as VLC, have had builtin support to handle multiple sound devices on the fly for ages. Most alsa command line players have some way to specify the sound device as well.

Then, there's audio daemons like pulseaudio or jackd, which should be able to switch the default audio device on the fly, or specify to which device send the audio stream of a given process on the fly. The program doesn't need to handle devices in this case, but it does need to support pulse or jack, I suppose. I know there are those so-called "sinks" to make any random program which outputs to alsa magically compatible with pulseaudio. I don't know how well that works, though.

The problem with the former solution is that, most userland programs do not have support to directly handle audio devices, they just use the default audio output, whatever that is. Browsers are the typical example. This wasn't so important in the past, but nowadays typical use cases involve playing all kind of media stuff directly in the browser.

Having some kind of computer at home where personA is working/hearing music/using VoIP while personB is playing some video on youtube is not strange, and they can perfectly be using the same browser, but different windows in two separate screens.

As far as I know, for those of use using ALSA, the only way to do this is to use two different browsers this way: launch browserA, do whatever, edit ~/.asoundrc, launch browserB and do whatever else.

Plainly said, and I'd really love to be proven wrong, as of 2017, there's no tool or mechanism to swap or route audio devices on the fly within alsa. Right?

I don't really plan to use pulseaudio or something like that. I am more thinking aloud than seeking for a solution.

Cheers!
Back to top
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6639
Location: The soundosphere

PostPosted: Thu Feb 02, 2017 4:14 am    Post subject: Reply with quote

I would love to hear more about this as well. I use jack, and I think it has the potential of being embedded as the default Linux sound system to better handle multiple sound sources. Maybe someone could get Paul Davis to chime in on this...
_________________
decibel Linux: https://decibellinux.org
Github: https://github.com/Gentoo-Music-and-Audio-Technology
Facebook: https://www.facebook.com/decibellinux
Discord: https://discord.gg/73XV24dNPN
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Thu Feb 02, 2017 8:09 am    Post subject: Reply with quote

Unless things have changed dramatically in these last couple of years (admittedly I've been busy with something else and I haven't payed much attention to this) jack is yet another layer on top of alsa, just like pulse.

There are quite a few problems with this design. Plus there's no technical reason why alsa can't do this itself without a man in the middle. It's just a matter of being able to route streams to devices, which alsa can do. You just need some flexibility there and a way to configure it without having to close every single program and reopen it after having listed your devices with some random command line tool, modified asoundrc and saved it, and then again, and again.

It seems too 80-ish.

We get lots of plugins and silly stuff that one one use, but we are lacking the basic stuff for nowadays standards. That's my impression anyway.
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Thu Feb 02, 2017 10:05 am    Post subject: Reply with quote

Alsa without any other sound server active can mix multiple audio outputs to one sound card with hit's own sound server Dmix. Alsa should be able to accept too multiple sound sources output to multiple audio cards but I haven't test any of those cases with multiple users in sync.

With Pulseaudio I don't know if two users can start an instance of Pulseaudio each to his name but a different user of the one who own Pulseaudio can use it if it's audio output is started with the Pulseaudio owner privileges, using sudo for exemple.

Starting Pulseaudio as a system server may resolv the multiple users access problem to it but it is not recommanded.

As a lonely man, I have no need to open more than one user session and rarely have to output more than one audio source to more than one sound card at a time.

:o
_________________
Paul
Back to top
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6639
Location: The soundosphere

PostPosted: Thu Feb 02, 2017 3:39 pm    Post subject: Reply with quote

No, actually, jack isn't on top of anything. It is a standalone audio server/routing system, which can incorporate alsa - which I do in all my sessions in order to access some devices handled by snd-usb-audio.

But yes, alsa could definitely do this, too, if someone would build a Linux sound server designed for all the things you mentioned based on alsa. There's almost always more than one way to do anything. :)
_________________
decibel Linux: https://decibellinux.org
Github: https://github.com/Gentoo-Music-and-Audio-Technology
Facebook: https://www.facebook.com/decibellinux
Discord: https://discord.gg/73XV24dNPN
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum