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 689931 - Improve icons in the input/output selectors.
Improve icons in the input/output selectors.
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Sound
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Control center sound maintainer(s)
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-12-09 14:53 UTC by Giovanni Campagna
Modified: 2013-02-18 13:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add a GIcon accessor for GvcMixerUIDevices (3.07 KB, patch)
2012-12-09 14:53 UTC, Giovanni Campagna
needs-work Details | Review
sound: show a different icon for different input/output ports (3.81 KB, patch)
2012-12-09 14:54 UTC, Giovanni Campagna
committed Details | Review
Add a GIcon accessor for GvcMixerUIDevices (7.83 KB, patch)
2013-02-03 17:39 UTC, Giovanni Campagna
committed Details | Review
GvcMixerCard: fix freeing mixer ports (1.82 KB, patch)
2013-02-15 21:58 UTC, Giovanni Campagna
accepted-commit_now Details | Review

Description Giovanni Campagna 2012-12-09 14:53:01 UTC
Currently, for internal devices, pulseaudio gives just audio-card for a pa_card / GvcMixerCard, which means that the input selector shows audio-card for all devices, not caring if they're a microphone, a laptop speaker or headphones.
We should take advantage of the GvcMixerUIDevice internal abstraction and find something better.
Comment 1 Giovanni Campagna 2012-12-09 14:53:24 UTC
Created attachment 231073 [details] [review]
Add a GIcon accessor for GvcMixerUIDevices

This will allow to have different icons for internal audio cards
(which are flagged generically as "audio-card"), depending on which
port is in use (ie. headphones or speakers).
Comment 2 Giovanni Campagna 2012-12-09 14:54:08 UTC
Created attachment 231074 [details] [review]
sound: show a different icon for different input/output ports

Use the new API in libgnome-volume-control to create the icon shown
next to the port name in the selector. This avoids ugly audio-card icons,
and shows a speaker, microphone or headphones as appropriate.
Comment 3 David Henningsson 2012-12-09 16:55:56 UTC
Review of attachment 231073 [details] [review]:

See bug 689635.

I guess this patch is an improvement over the current situation (even if comparing strings is somewhat hacky), but we really want to get the right icon from PulseAudio in the first place, by reading it from the port properties.
Comment 4 Bastien Nocera 2012-12-10 09:03:36 UTC
Review of attachment 231073 [details] [review]:

Agreed with David here. I also think that we'll want to export the translated name of the port too, so we could show "Headphones" in the volume popup.
Comment 5 Bastien Nocera 2012-12-10 09:06:01 UTC
Review of attachment 231074 [details] [review]:

That would be fine by me, after the problem of exporting port icons is fixed properly.
Comment 6 Bastien Nocera 2013-01-18 00:01:14 UTC
David, is this ready to go in?
Comment 7 David Henningsson 2013-01-18 03:38:43 UTC
Bastien, as a last-minute patch I was able to get the port icons exported from PulseAudio into 3.0, which is now released. So we should really get the icons from there instead. 

I'm fine with both merging (this could be a better fallback for older versions, i e 2.0) and not merging (to encourage Giovanni to read the port icons out of PulseAudio instead).
Comment 8 Giovanni Campagna 2013-02-03 17:39:04 UTC
Created attachment 235122 [details] [review]
Add a GIcon accessor for GvcMixerUIDevices

This will allow to have different icons for internal audio cards
(which are flagged generically as "audio-card"), depending on which
port is in use (ie. headphones or speakers).
This requires the new icon information, which is only exported by
PulseAudio 3.0. If it's not available, we fallback to card icons
like before.
Comment 9 David Henningsson 2013-02-03 20:23:18 UTC
Review of attachment 235122 [details] [review]:

Good work!

I haven't done more than a read through, but I wonder if port->icon_name is correctly freed?
Comment 10 Giovanni Campagna 2013-02-03 21:19:49 UTC
Well, I don't know, because I could not find the place where GvcMixerCardPort is freed...
Comment 11 David Henningsson 2013-02-05 07:58:52 UTC
Right. Now that I think of it, I discovered that too, and added that when I wrote my patches for supporting dynamic ports (see https://bugzilla.gnome.org/show_bug.cgi?id=689359 ). I never finished those patches though, as I got busy with other things :-/
Comment 12 Giovanni Campagna 2013-02-15 21:58:01 UTC
Created attachment 236312 [details] [review]
GvcMixerCard: fix freeing mixer ports

Allocated GvcMixerCardPorts were never freed.
Comment 13 Bastien Nocera 2013-02-18 09:17:11 UTC
Review of attachment 236312 [details] [review]:

Looks good
Comment 14 Bastien Nocera 2013-02-18 09:26:17 UTC
Review of attachment 235122 [details] [review]:

And as David mentioned, the freeing is missing from this patch (the subsequent patch should be merged into this one).

::: gvc-mixer-ui-device.c
@@ +33,3 @@
         GvcMixerCard               *card;
         gchar                      *port_name;
+        char                       *icon_name; 

trailing whitespace here.
Comment 15 Bastien Nocera 2013-02-18 09:26:47 UTC
Review of attachment 236312 [details] [review]:

Please make sure to merge it in with the other patch.
Comment 16 Giovanni Campagna 2013-02-18 13:41:03 UTC
Attachment 235122 [details] pushed as 74c0862 - Add a GIcon accessor for GvcMixerUIDevices
Comment 17 Giovanni Campagna 2013-02-18 13:44:06 UTC
Attachment 231074 [details] pushed as 3e71962 - sound: show a different icon for different input/output ports