[pulseaudio-discuss] Changing default soundcard on attach/detach of soundcards

Colin Guthrie gmane at colin.guthr.ie
Tue Jun 15 15:56:06 PDT 2010


'Twas brillig, and Jason Taylor at 15/06/10 22:59 did gyre and gimble:
> On 16 June 2010 04:05, Colin Guthrie <gmane at colin.guthr.ie> wrote:
>> 'Twas brillig, and Jeremy Nickurak at 15/06/10 16:31 did gyre and gimble:
>>> On Tue, Jun 15, 2010 at 01:40, Colin Guthrie <gmane at colin.guthr.ie> wrote:
>>>> I really don't think this is wise. There are so many cases where this
>>>> doesn't work. If you are in the process of plugging something in, you
>>>> *expect* to have to take some action. You're in the mind set that you'll
>>>> need to take action to make the device work.
>>>
>>> Can't disagree strongly enough here.
>>>
>>> When you plug headphones into your laptop, the sound switches from the
>>> speakers to the headphones. No intervention. This should definitely be
>>> the same case with plugging in USB headphones.
>>
>> But speaker jacks are completely different to USB sound devices. You
>> cannot use them as a comparable example here.
>>
>> I mean, if I've got some USB speakers which have a jack socket on the
>> front of them (I'm looking at just such devices right now in front of
>> me) and I plug in some headphones to the jack socket on my computer, I
>> do not expect the sound to be moved across from playing on the USB
>> device to my internal device and subsequently on my headphones when this
>> happens.
>>
>> Added to this, there are numerous examples of when I really don't want,
>> nor would expect this to happen. e.g. I'm playing music and I get my USB
>> headset to make a VoIP call. My music playing happily on my USB Speakers
>> and I want it stay there, but as soon as I plug in my headset it
>> transfers. I'd much rather it stayed where it was. I may want to leave
>> my USB Headset plugged in (I often do).
>>
>> I don't think I'm out of the ordinary here. And there are countless
>> other scenarios where this just doesn't work OOTB.
>>
>> The general rule is if you can't do something automatically that works
>> every time, then don't do it automatically at all, but make it easy and
>> obvious to the user how to do it manually.
>>
> 
> I think we're close to wanting the same thing, if you have
> specifically told the music to go to the USB speakers it should, all
> other streams/clients that have not * specifically* been told which
> device to use should switch to the new *local* (not network sinks)
> device...
> 
> I think that covers the use you are suggesting while still keeping
> everything sane...
> 
> My example
> - Buy new laptop install linux
> - Plug in USB speakers first time... all sound (including currently
> playing streams) moves to USB speakers
> - Plug in USB headset first time all sound moves to Headset,
> - Set music to output to USB speakers as preferred device
> - Unplug headset
> - Plugin headset, music stays on speakers all other sound moves to headset
> - Remove headset
> - Attach bluetooth headset, music stays on speakers all other sound
> moves to bluetooth headset
> - Remove USB speakers, music moves to bluetooth headset
> 
> Thats what makes sense to me anyway

Why does the music move to the bluetooth headset in the final example?
You seem to suggest that if the priority lists for music is as follows
immediately before the BT headset is attached:

1. USB Speakers
2. USB Headset
3. Internal Audio

But afterwards plugging in the BT Headset, it's not clear as to whether
the list is:

1. USB Speakers
2. BT Headset
3. USB Headset
4. Internal Audio

or

1. USB Speakers
2. USB Headset
3. BT Headset
4. Internal Audio



Both lists would achieve the result you describe as the USB Headset is
not currently plugged in. I presume you mean the first example, in which
case I'd infer your logic for picking the insertion point of the new
device as being "immediately after the highest priority available
device". This would thus cause no immediate change, but certainly
ensures that it messes up any careful configuration the user does.

If we were to even begin to entertain this approach, I'd suggest that
the new device *must* appear at the end of the priority list, i.e.
*after* Internal Audio. Any other setup is pretty much guaranteed to
piss of people who want a configuration that stays the way they set it
and probably also manages to disappoint the people who want the latest
device to be the default too.


So I'm not personally convinced, but we can see what others
(specifically Lennart) think.

For me it's the lack of transparency as to how things work that I'm most
against, although it does obviously add to the complexity of
implementation too.

I'd be happy enough with a simple option of "new devices enter priority
lists at the top" which defaults to off, but can be turned on if the
user so desires. My only concern with such an option is that for the
vast majority of people, it really matters not one jot as they'll only
ever have maybe two or three devices, which really makes specifically
coding for this preference something that almost doesn't seem worth it.

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/]




More information about the pulseaudio-discuss mailing list