After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 674925 - Moving running input stream fails
Moving running input stream fails
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Sound
3.4.x
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-04-27 09:17 UTC by David Henningsson
Modified: 2012-07-11 10:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for Moving running input streams correctly (3.71 KB, patch)
2012-04-27 09:18 UTC, David Henningsson
needs-work Details | Review
sound: Move running input streams when default source is changed (5.42 KB, patch)
2012-06-25 16:17 UTC, Bastien Nocera
needs-work Details | Review
Patch for Moving running input streams correctly (5.42 KB, patch)
2012-06-27 14:58 UTC, David Henningsson
none Details | Review
Patch for Moving running input streams correctly (5.42 KB, patch)
2012-06-27 15:06 UTC, David Henningsson
none Details | Review
Patch for Moving running input streams correctly (5.59 KB, patch)
2012-06-27 15:08 UTC, David Henningsson
committed Details | Review
Fix segfault (2.27 KB, patch)
2012-07-11 09:52 UTC, David Henningsson
committed Details | Review

Description David Henningsson 2012-04-27 09:17:26 UTC
When changing the default input source, active recording streams are not moved. The attached patch will fix that, which will make input and output behaviour consistent.
As a bonus, it will not destroy pulseaudio's input database when changing default sink anymore.
Comment 1 David Henningsson 2012-04-27 09:18:52 UTC
Created attachment 212939 [details] [review]
Patch for Moving running input streams correctly
Comment 2 Bastien Nocera 2012-06-25 16:09:49 UTC
Review of attachment 212939 [details] [review]:

This is racy actually. You shoud use separate new_default_stream variables (new_default_sink_stream and new_default_source_stream), and separate callbacks (even if they just end up calling gvc_mixer_control_stream_restore_cb() with a "is_sink" flag).

Also, remove the "BugLink:", just the URL is enough, and remove the Signed-off-by, it's not used in GNOME.
Comment 3 Bastien Nocera 2012-06-25 16:17:50 UTC
Created attachment 217223 [details] [review]
sound: Move running input streams when default source is changed

When changing the default input source, active recording streams
are not moved. This patch will fix that, which will make input
and output behaviour consistent.

As a bonus, it will not destroy pulseaudio's input database when
changing default sink anymore.
Comment 4 David Henningsson 2012-06-27 14:56:50 UTC
Review of attachment 217223 [details] [review]:

Hmm, I think you're correct about the race. 
(The set_default_sink is more likely to race with itself than with set_default_source, but in that case, it isn't a problem.)

However in this version the filtering is gone, which means that it will still destroy the database for other side.
Comment 5 David Henningsson 2012-06-27 14:58:56 UTC
Created attachment 217412 [details] [review]
Patch for Moving running input streams correctly

This is Bastien's version of the patch but with added filtering.
Comment 6 Bastien Nocera 2012-06-27 15:04:19 UTC
(In reply to comment #5)
> Created an attachment (id=217412) [details] [review]
> Patch for Moving running input streams correctly
> 
> This is Bastien's version of the patch but with added filtering.

I can't see where you're doing that. I can't see a difference between the 2 patches.
Comment 7 David Henningsson 2012-06-27 15:06:46 UTC
Created attachment 217413 [details] [review]
Patch for Moving running input streams correctly

Sorry. This one should be better.
Comment 8 David Henningsson 2012-06-27 15:08:25 UTC
Created attachment 217414 [details] [review]
Patch for Moving running input streams correctly

Forgot to run "git format-patch" after committing, so uploaded the old patch again. Argh!
Comment 9 Bastien Nocera 2012-06-27 15:14:47 UTC
Attachment 217223 [details] pushed as fe69f4f - sound: Move running input streams when default source is changed
Comment 10 David Henningsson 2012-07-11 09:52:22 UTC
Created attachment 218525 [details] [review]
Fix segfault

This seems to be a persistent one. The previous patch introduced a segfault, please apply the attached patch to fix it.
Comment 11 Bastien Nocera 2012-07-11 10:06:16 UTC
Comment on attachment 218525 [details] [review]
Fix segfault

Minus the first hunk