Pulseaudio-discuss Archive

List Statistics

  • Total Threads: 273
  • Total Posts: 1059
  #1  
11-06-2010 10:37 PM
Pulseaudio-discuss member admin is online now
User
 

Hi everybody,

I've got an onboard soundcard and two usb soundcards and I'd like it
if pulseaudio could switch automatically the default sound card (or
default sink to be more precise) depending on the soundcards that are
currently plugged in. Is this possible?

In case it's not clear what I want, let me explain it on an example:

I've got three soundcards: my onboard card (sd1), my usb card (sd2)
and my headset (sd3) and I want the default card to be the one with
the highest numbering in the sdX naming scheme that is currently
attached to the system.



Thanks,

Geralt.
_______________________________________________
___________________________________________________

Posted on the Pulseaudio-discuss mailing list. Go to https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss to subscribe.

  #2  
13-06-2010 04:43 PM
Pulseaudio-discuss member admin is online now
User
 

Dnia 2010-06-11, piÄ… o godzinie 23:37 +0200, Geralt pisze:
> I've got three soundcards: my onboard card (sd1), my usb card (sd2)
> and my headset (sd3) and I want the default card to be the one with
> the highest numbering in the sdX naming scheme that is currently
> attached to the system.

Eh? No idea what sdX mean here.

If you want your audio to be heard over headset, then usb card, then
onboard card, depending on which are available, just set them as
fallbacks with pavucontrol or gnome-volume-control in the reverse
direction (that's - connect your usb card, set it as fallback, then
connect your headset and set that as fallback). That should be enough in
at least with a recent enough PA.

--

_______________________________________________
___________________________________________________

Posted on the Pulseaudio-discuss mailing list. Go to https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss to subscribe.

  #3  
13-06-2010 10:08 PM
Pulseaudio-discuss member admin is online now
User
 

'Twas brillig, and Geralt at 11/06/10 22:37 did gyre and gimble:
> Hi everybody,
>
> I've got an onboard soundcard and two usb soundcards and I'd like it
> if pulseaudio could switch automatically the default sound card (or
> default sink to be more precise) depending on the soundcards that are
> currently plugged in. Is this possible?
>
> In case it's not clear what I want, let me explain it on an example:
>
> I've got three soundcards: my onboard card (sd1), my usb card (sd2)
> and my headset (sd3) and I want the default card to be the one with
> the highest numbering in the sdX naming scheme that is currently
> attached to the system.

Bascially you want a priority list of defaults and the current default
to the the highest priority available device to be the one used?

This is possible but no GUI exists on Gnome to exploit it just yet.

This is the routing policy used under KDE, and the PA module
module-device-manager implements this in PulseAudio.

Sadly my proposal to make PA's routing policy work in a (IMO) much more
sensible way, has not yet been endorsed by Lennart so I've not started
working on it. I'm pretty confident that even with some issues it
creates, it's a far more sensible configuration system than is currently
available.

The behaviour you describe would work perfectly under this setup, even
if the priority list itself is never actually exposed to the user via
confirguration GUIs.

Even the current module-default-device-restore does not actually work on
hotplug etc. (as the default is worked out at startup and then set, so
it's idea of the "default device" is lost).

Here is my proposal:
http://colin.guthr.ie/2010/02/this-is-the-route-to-hell/


Hopefully when Lennart is less busy, we can revisit the discussions and
I can convince him I'm right!

Col


--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
Mandriva Linux Contributor [http://www.mandriva.com/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]

_______________________________________________
___________________________________________________

Posted on the Pulseaudio-discuss mailing list. Go to https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss to subscribe.

  #4  
13-06-2010 10:21 PM
Pulseaudio-discuss member admin is online now
User
 

Hi,

thanks for your replies :-)

> Dnia 2010-06-11, pi± o godzinie 23:37 +0200, Geralt pisze:
>> I've got three soundcards: my onboard card (sd1), my usb card (sd2)
>> and my headset (sd3) and I want the default card to be the one with
>> the highest numbering in the sdX naming scheme that is currently
>> attached to the system.
>
> Eh? No idea what sdX mean here.
>
I was refering to either sd1, sd2 or sd3.

> If you want your audio to be heard over headset, then usb card, then
> onboard card, depending on which are available, just set them as
> fallbacks with pavucontrol or gnome-volume-control in the reverse
> direction (that's - connect your usb card, set it as fallback, then
> connect your headset and set that as fallback). That should be enough in
> at least with a recent enough PA.
>
That's exactly what I want and thanks for mentioning pavucontrol, I
didn't know of this application (I've basically zero experience with
Pulseaudio, yet).

> 'Twas brillig, and Geralt at 11/06/10 22:37 did gyre and gimble:
>> Hi everybody,
>>
>> I've got an onboard soundcard and two usb soundcards and I'd like it
>> if pulseaudio could switch automatically the default sound card (or
>> default sink to be more precise) depending on the soundcards that are
>> currently plugged in. Is this possible?
>>
>> In case it's not clear what I want, let me explain it on an example:
>>
>> I've got three soundcards: my onboard card (sd1), my usb card (sd2)
>> and my headset (sd3) and I want the default card to be the one with
>> the highest numbering in the sdX naming scheme that is currently
>> attached to the system.
>
> Bascially you want a priority list of defaults and the current default
> to the the highest priority available device to be the one used?
>
> This is possible but no GUI exists on Gnome to exploit it just yet.
>
> This is the routing policy used under KDE, and the PA module
> module-device-manager implements this in PulseAudio.
>
> Sadly my proposal to make PA's routing policy work in a (IMO) much more
> sensible way, has not yet been endorsed by Lennart so I've not started
> working on it. I'm pretty confident that even with some issues it
> creates, it's a far more sensible configuration system than is currently
> available.
>
> The behaviour you describe would work perfectly under this setup, even
> if the priority list itself is never actually exposed to the user via
> confirguration GUIs.
>
> Even the current module-default-device-restore does not actually work on
> hotplug etc. (as the default is worked out at startup and then set, so
> it's idea of the "default device" is lost).
>
> Here is my proposal:
> http://colin.guthr.ie/2010/02/this-is-the-route-to-hell/
>
>
> Hopefully when Lennart is less busy, we can revisit the discussions and
> I can convince him I'm right!
>
That is exactly what I want, however I don't use KDE, is there still a
way to use youre pulseaudio module?



Geralt
_______________________________________________
___________________________________________________

Posted on the Pulseaudio-discuss mailing list. Go to https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss to subscribe.

  #5  
13-06-2010 10:59 PM
Pulseaudio-discuss member admin is online now
User
 

> Here is my proposal:
> http://colin.guthr.ie/2010/02/this-is-the-route-to-hell/

In my humble opinion....

Device by media.role is not that great.. it stand up for events, but
it should really be be per client (application)

The major use cases i have right now that suck... and are not solvable
without prior knowledge of how pa works
1 - If I plug in my USB or Bluetooth headset the music does not
change to headset like my analogue headset does...
2 - If I plug in a USB or Bluetooth microphone apps like *skype* can
not be set to use that mic without restarting skype?
3 - There no way to easily set the media role or an app that dosn't
have one (yes the all should have a role but they don't), pa could be
doing better here using desktop files and the role should be saved..
4 - Videos do not cork music

By default I think pa should:
- Move all inputs and outputs to any newly connected local device (ie
usb, bluetooth whatever) that appears after pa has started (unless the
per client device has been set of course)
- There should be a simple UI for setting a clients default media
role (if one has not been set), and this role should be remembered by
pa
- Streams should inherit media role from the client if they don't
have one set... ie firefox is set to video, so all its streams have a
media role of video
- A module to cork music when video is playing

Those 4 things would solve every problem I can think of and make pa
function as I think 90% desktop users expect

Cheers


--
"Weekends don't count unless you spend them doing something completely
pointless. " - Calven
_______________________________________________
___________________________________________________

Posted on the Pulseaudio-discuss mailing list. Go to https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss to subscribe.

  #6  
13-06-2010 11:37 PM
Pulseaudio-discuss member admin is online now
User
 

On Mon, 2010-06-14 at 09:59 +1200, Jason Taylor wrote:
> - Streams should inherit media role from the client if they don't
> have one set... ie firefox is set to video, so all its streams have a
> media role of video

No big issue with the rest of your proposals (besides the usual "who's
doing the work?" =p). However this one isn't a good idea, your web
browser plays tons of different things, alert sounds from web-apps,
videos (youtube and friends), audio from sites like pandora, game-sounds
from the various flash time-wasters. If this was classified as video, my
web-app giving me a new IM notification would cork my audio stream
(assuming your other proposals make it in)...

_______________________________________________
___________________________________________________

Posted on the Pulseaudio-discuss mailing list. Go to https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss to subscribe.

  #7  
14-06-2010 12:59 AM
Pulseaudio-discuss member admin is online now
User
 

> No big issue with the rest of your proposals (besides the usual "who's
> doing the work?" =p).

If it would be accepted I would attempt to brush off my rusty c skills..
I'm just not sure how welcome this work would be in pa...

> However this one isn't a good idea, your web
> browser plays tons of different things, alert sounds from web-apps,
> videos (youtube and friends), audio from sites like pandora, game-sounds
> from the various flash time-wasters. If this was classified as video, my
> web-app giving me a new IM notification would cork my audio stream
> (assuming your other proposals make it in)...

The "browser" classification as video was just a suggestion for such a
generic player, nothing else really fits IIMHO.., if the stream was
tagged with correct media.role, then pa would use that, the "video"
would be a fall back position. If you kept your browser with no media
role then nothing would happen as now.. which sucks when viewing a
youtube video and having to open the music player and stop it so you
can hear the video..

html5 tags like video/audio would really help here but thats probably
3 to 5 years away of having any significant role..

I just realized I missed one other use case... pa has no concept of
window order..
- With 2 streams of the same role (other then notification) are
active the stream that has the higher client in the window stack
should be the active stream, all other streams should be corked

Cheers

--
"Weekends don't count unless you spend them doing something completely
pointless. " - Calven
_______________________________________________
___________________________________________________

Posted on the Pulseaudio-discuss mailing list. Go to https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss to subscribe.

  #8  
14-06-2010 01:10 AM
Pulseaudio-discuss member admin is online now
User
 

>> No big issue with the rest of your proposals (besides the usual "who's
>> doing the work?" =p).
>
> If it would be accepted I would attempt to brush off my rusty c skills..
> I'm just not sure how welcome this work would be in pa...

I think its just like other open-source projects, ie. "patches
welcome". Lennart is quite harsh on the quality of said patches, but
once you've met that you're good to go I'd think. Your proposals cover
a whole lot of ground though, and would probably take quite a bit of
hacking.
>
>> However this one isn't a good idea, your web
>> browser plays tons of different things, alert sounds from web-apps,
>> videos (youtube and friends), audio from sites like pandora, game-sounds
>> from the various flash time-wasters. If this was classified as video, my
>> web-app giving me a new IM notification would cork my audio stream
>> (assuming your other proposals make it in)...
>
> The "browser" classification as video was just a suggestion for such a
> generic player, nothing else really fits IIMHO.., if the stream was
> tagged with correct media.role, then pa would use that, the "video"
> would be a fall back position. If you kept your browser with no media
> role then nothing would happen as now.. which sucks when viewing a
> youtube video and having to open the music player and stop it so you
> can hear the video..
>
> html5 tags like video/audio would really help here but thats probably
> 3 to 5 years away of having any significant role..
>
Well, for me its an 'unsolvable' problem which should probably be best
left alone. Flash on linux is problematic anyway, such that it may
make more sense just to download the video and watch it outside the
browser.
_______________________________________________
___________________________________________________

Posted on the Pulseaudio-discuss mailing list. Go to https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss to subscribe.

  #9  
14-06-2010 01:20 AM
Pulseaudio-discuss member admin is online now
User
 

> I think its just like other open-source projects, ie. "patches
> welcome". Lennart is quite harsh on the quality of said patches, but
> once you've met that you're good to go I'd think. Your proposals cover
> a whole lot of ground though, and would probably take quite a bit of
> hacking.

No problem, one bit at a time.. I'd at least want to know that it had
a chance of work being accepted though instead of .. thats not the
direction we want to go... ;)

I have my python hacks that work for me but it would be nice to get
this stuff in pa where it should be.

> Well, for me its an 'unsolvable' problem which should probably be best
> left alone. Flash on linux is problematic anyway, such that it may
> make more sense just to download the video and watch it outside the
> browser.

Probably its impossible to get this 100% right due to the ugly flash
issues, but 80% right would be nice start and anything to encourage
html5 and kill flash must be a "good thing" ... as long as it dosn't
screw up by default.

Cheers

--
"Weekends don't count unless you spend them doing something completely
pointless. " - Calven
_______________________________________________
___________________________________________________

Posted on the Pulseaudio-discuss mailing list. Go to https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss to subscribe.

  #10  
14-06-2010 09:22 AM
Pulseaudio-discuss member admin is online now
User
 

'Twas brillig, and Jason Taylor at 13/06/10 22:59 did gyre and gimble:
>> Here is my proposal:
>> http://colin.guthr.ie/2010/02/this-is-the-route-to-hell/
>
> In my humble opinion....
>
> Device by media.role is not that great.. it stand up for events, but
> it should really be be per client (application)
>
> The major use cases i have right now that suck... and are not solvable
> without prior knowledge of how pa works
> 1 - If I plug in my USB or Bluetooth headset the music does not
> change to headset like my analogue headset does...

With your analogue headset "music" does not change to it, all output
changes to it. I know what you're hinting at, but the two cannot be
compared unless you just talk about "all output".

With my proposal, "music" could be configured to move to the new
USB/bluetooth headset.

> 2 - If I plug in a USB or Bluetooth microphone apps like *skype* can
> not be set to use that mic without restarting skype?

Incorrect. When PA is used, Skype detects it and uses only it. It
(correctly) does not offer you the configuration choice inside Skype. It
is mostly up to tools like gnome-volume-control/pavucontrol etc. to
configure the Skype streams, but in the case of a USB or Bluetooth
headset, the PA module module-intended-roles kicks in and automatically
moves "voip" streams to "headset" devices. This currently works pretty
well (I don't have to do any configuration after setting up my bluetooth
headset for it to "just work" with Skype. It's quite nice, but not very
transparent. If you read the link I sent through, I believe I proposed
there (maybe it was afterwards on the list - can't quite recall) that
module-intended-roles becomes a passive module that simply injects brand
new (never seen before) devices into the appropriate place in the
priority list for the appropriate role. That way it's more transparent
to the user and the net functionality remains the same.

> 3 - There no way to easily set the media role or an app that dosn't
> have one (yes the all should have a role but they don't), pa could be
> doing better here using desktop files and the role should be saved..

PA *does* use .desktop files. That's what module-augment-properties does...

> 4 - Videos do not cork music

No they don't. Currently the automatic corking is implemented by
module-cork-music-on-phone. This could be made more generic with some
kind of simple "rules" file that could be parsed at startup to allow
"video corks music". That would be kinda sensible IMO.


> By default I think pa should:
> - Move all inputs and outputs to any newly connected local device (ie
> usb, bluetooth whatever) that appears after pa has started (unless the
> per client device has been set of course)

Perhaps, but I don't think everyone would agree here. I certainly would
not be appropriate for my crappy bluetooth headset here. It's acceptable
for phone streams, but really not for anything else.

> - There should be a simple UI for setting a clients default media
> role (if one has not been set), and this role should be remembered by
> pa

This could be done, but I'd personally rather not do it. An alternative
would be an independent "database" (like pci.ids or usb.ids) that could
"know" which apps are which roles, that we can update via the web and
bundle when we release, but I think letting users do this removes from
the simplicity that should underlie this system. If the user cares that
much, they can either edit the .desktop file or create a wrapper
script/alias that sets the relevant env vars to allow for role to be forced.

> - Streams should inherit media role from the client if they don't
> have one set... ie firefox is set to video, so all its streams have a
> media role of video

Not quite sure how easy this would be, but in theory if the client has a
proplist, it should be easy to make any streams that client creates
inherit that (I'd have to check to see if this is not done already!)

> - A module to cork music when video is playing

Should be trivial to do (although depending on the options and
combinations here it may be better to parse some simple rules (or just
rename module-cork-on-phone and call it module-auto-cork or something
and implement this extra rule (tho' I guess separate modules give users
more control).

> Those 4 things would solve every problem I can think of and make pa
> function as I think 90% desktop users expect

I think most points are valid. With the exception of the first one, the
others are not technically that much related to routing (the role points
are related if you assume most routing is role-based (at least
initially)) and as such are probably orthoganal to the routing overhaul
I suggest.

Certainly worth keeping in mind tho'.

Col


--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
Mandriva Linux Contributor [http://www.mandriva.com/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]

_______________________________________________
___________________________________________________

Posted on the Pulseaudio-discuss mailing list. Go to https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss to subscribe.





NewsArc Lists  |  Culture Pages   |  Computing Archive  |  Media-Pages
Link to this page on your blog or website by copying the HTML code below and pasting it into your site: