This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 489049 - Not changing output device while device is in use
Not changing output device while device is in use
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: gnome-media (Show other bugs)
11
All Linux
low Severity medium
: ---
: ---
Assigned To: Bastien Nocera
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 501599
  Show dependency treegraph
 
Reported: 2009-03-06 17:22 EST by Michael Monreal
Modified: 2009-09-16 11:48 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 501599 (view as bug list)
Environment:
Last Closed: 2009-09-16 11:48:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michael Monreal 2009-03-06 17:22:11 EST
Use case: you have some song playing in e.g. totem and plug in your usb headset. You change the output to the usb headset. Playback will continue on the old output until you play another song.
Comment 1 Lennart Poettering 2009-03-19 08:05:48 EDT
Where did you change output to the USB headset? If you do that with pavucontrol then the stream will be moved right away.

I figure you have been using gnome-volume-control for this? Reassigning then.
Comment 2 Michael Monreal 2009-03-19 10:54:31 EDT
(In reply to comment #1)
> I figure you have been using gnome-volume-control for this?

Right.
Comment 3 Bastien Nocera 2009-03-25 08:48:25 EDT
pulseaudio-0.9.15-3.test5.fc11.x86_64
pavucontrol-0.9.7-5.fc11.x86_64

Nope, if I change the default output in pavucontrol (Output devices, drop-down, and tick "Default"), the stream still isn't moved to the correct sink. I tested both with the GStreamer pulse sink (using Totem) and using the ALSA connector (using "mplayer -ao alsa").

As it's easily reproduceable, feel free to ask me for whatever logs you might need.
Comment 4 Lennart Poettering 2009-03-30 10:37:16 EDT
Bastien, the "default" sink in PA is actually a misnomer. It is more of a "fallback" sink for the cases where module-stream-restore knows no other rule. Also, changing the default sink has no effect at all on existing streams.

http://pulseaudio.org/wiki/WritingVolumeControlUIs#TheDefaultDevices

If you want to change all running streams to a new sink you need to update all m-s-r rules and activate them with the "apply_now" flag when doing so.
Comment 5 Bastien Nocera 2009-03-30 21:22:12 EDT
And how do you go about that?
Comment 6 Lennart Poettering 2009-03-31 07:23:13 EDT
Call pa_ext_stream_restore_read() to get all entries and patch them, then write them back with pa_ext_stream_restore_write().
Comment 7 Bastien Nocera 2009-05-01 12:58:01 EDT
Upstream and patch are at:
http://bugzilla.gnome.org/show_bug.cgi?id=581024

Please test with this build:
http://koji.fedoraproject.org/koji/taskinfo?taskID=1331590
Comment 8 Matthias Clasen 2009-05-01 22:15:38 EDT
Tested successfully, tag request has been filed.
Comment 9 Michael Monreal 2009-05-02 10:47:03 EDT
I also tested the latest build from koji and it basicly works as intended now. A few things:

1.) when plugging the usb headset in while sound is playing on the internal card, the sound skips for a second, then resumes as normal (I guess while hal/pulse load the usb audio driver). 

2.) after switching, sound first plays correctly on the new output for about a second, then it stops and/or sounds very bad for about 2-3 seconds before sounding nice again.

3.) switching sound does reset the sound volume to 100% which is probably not what should happen... either keep the volume of the old device or keep track of saved volumes for every device?

Any of those worth filing new bugs for?
Comment 10 Bastien Nocera 2009-05-02 11:01:56 EDT
(In reply to comment #9)
> I also tested the latest build from koji and it basicly works as intended now.
> A few things:
> 
> 1.) when plugging the usb headset in while sound is playing on the internal
> card, the sound skips for a second, then resumes as normal (I guess while
> hal/pulse load the usb audio driver). 

My guess as well, worth filing a bug against PA or the kernel.

> 2.) after switching, sound first plays correctly on the new output for about a
> second, then it stops and/or sounds very bad for about 2-3 seconds before
> sounding nice again.

I saw that in apps that use pulsesink, my guess is it's a PA bug, don't think very many people did what we're doing before.

> 3.) switching sound does reset the sound volume to 100% which is probably not
> what should happen... either keep the volume of the old device or keep track of
> saved volumes for every device?

That's not normal, and I haven't seen that problem. Is it the app volume, or the hardware volume changing?

> Any of those worth filing new bugs for?
Comment 11 Michael Monreal 2009-05-02 11:38:52 EDT
(In reply to comment #10)
> That's not normal, and I haven't seen that problem. Is it the app volume, or
> the hardware volume changing?

Here's what I did:

- started totem, set app volume to 100% and started a song
- set the global output volume to 75% using the tray icon. Totem now reports a volume level of just 8% (why that? totem bug?)
- inserted headset, opened sound preferences, switched output

=> totem, tray icon, "output volume" in sound preferences *all* show 100% volumes now

Switching output device back I can reproduce the same thing every time.

(Issues 1 and 2 reported as Bug 498726 and Bug 498728.)
Comment 12 Bug Zapper 2009-06-09 07:58:08 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 13 Bastien Nocera 2009-09-16 11:48:06 EDT
The original bug was fixed for F11, so closing.

Note You need to log in before you can comment on or make changes to this bug.