Bug 392385 - Task bar showing audio icon for windows which do not play any sound
Summary: Task bar showing audio icon for windows which do not play any sound
Status: RESOLVED DOWNSTREAM
Alias: None
Product: plasmashell
Classification: Plasma
Component: Task Manager and Icons-Only Task Manager widgets (other bugs)
Version First Reported In: 5.12.2
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: 1.0
Assignee: Eike Hein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-27 04:18 UTC by Alexander Wilms
Modified: 2018-06-20 17:04 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
xprop output for Keepass (47.24 KB, text/plain)
2018-03-27 07:02 UTC, Alexander Wilms
Details
xprop output for VLC (12.11 KB, text/plain)
2018-03-27 07:02 UTC, Alexander Wilms
Details
Keepass desktop file (636 bytes, application/x-desktop)
2018-03-27 07:06 UTC, Alexander Wilms
Details
VLC desktop file (6.96 KB, application/x-desktop)
2018-03-27 07:07 UTC, Alexander Wilms
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Wilms 2018-03-27 04:18:40 UTC
I've noticed this with a few applications, e.g. KeePassXC and VLC from Flathub.
Even though the application doesn't play any sound, there's a speaker icon in the task bar entry.

This doesn't happen with the VLC version in Fedora's rpm repos.
Comment 1 Kai Uwe Broulik 2018-03-27 06:42:28 UTC
When this happens, please provide the output of pacmd list-sink-inputs
Comment 2 Alexander Wilms 2018-03-27 06:51:04 UTC
I had Keepass and VLC running, and after I started playing an mp3 in VLC, an speaker icon appeared in both of their task bar entries:

1 sink input(s) available.
    index: 292
        driver: <protocol-native.c>
        flags: START_CORKED FIX_RATE                                                            
        state: RUNNING                                                                          
        sink: 0 <alsa_output.pci-0000_00_1b.0.analog-stereo>                                    
        volume: front-left: 65536 / 100% / 0,00 dB,   front-right: 65536 / 100% / 0,00 dB       
                balance 0,00                                                                    
        muted: no
        current latency: 417,96 ms
        requested latency: 40,00 ms
        sample spec: float32le 2ch 48000Hz
        channel map: front-left,front-right
                     Stereo
        resample method: copy
        module: 11
        client: 163 <VLC media player (LibVLC 3.0.1)>
        properties:
                media.role = "video"
                media.name = "audio stream"
                application.name = "VLC media player (LibVLC 3.0.1)"
                native-protocol.peer = "UNIX socket client"
                native-protocol.version = "32"
                application.id = "org.VideoLAN.VLC"
                application.version = "3.0.1"
                application.icon_name = "vlc"
                application.language = "de_DE.UTF-8"
                application.process.id = "2"
                application.process.user = "awilms"
                application.process.host = "Samsung-Laptop"
                application.process.binary = "vlc"
                window.x11.display = ":99.0"
                application.process.machine_id = "Samsung-Laptop"
                application.process.session_id = "2"
                module-stream-restore.id = "sink-input-by-media-role:video"
Comment 3 Kai Uwe Broulik 2018-03-27 06:53:59 UTC
state: RUNNING ← it should be state: CORKED when nothing is playing.

You got the icon on both applications even though only VLC owns an audio stream? In addition to the state being wrong this could be an issue with mapping the application to its desktop file since it's sandboxed/a flatpak. What happens when you chose "New Instance" in either of the context menus?
Comment 4 Alexander Wilms 2018-03-27 06:55:04 UTC
Also, pressing pause/play makes the icon dis-/reappear. Could this maybe related to the fact that both applications are executed by running `flatpak run ...`?
Comment 5 Kai Uwe Broulik 2018-03-27 06:55:58 UTC
Possible. Can you provide the xprop output of both VLC and keepass windows and their .desktop files?
Comment 6 Alexander Wilms 2018-03-27 06:58:34 UTC
I was playing auddio while running `pacmd list-sink-inputs`.

I cannot start a new instance for VLC, but I can for Keepass. Afterwards, both task bar entries of Keepass show the audio icon.
Comment 7 Kai Uwe Broulik 2018-03-27 07:02:08 UTC
Didn't you say you got an audio icon when the application did *not* play any sound? I'll see if I can install those from flathub and reproduce myself.
Comment 8 Alexander Wilms 2018-03-27 07:02:13 UTC
Created attachment 111671 [details]
xprop output for Keepass
Comment 9 Alexander Wilms 2018-03-27 07:02:33 UTC
Created attachment 111672 [details]
xprop output for VLC
Comment 10 Alexander Wilms 2018-03-27 07:03:42 UTC
Yes, I meant that Keepass had this icon, even though it didn't play any sound.
Comment 11 Alexander Wilms 2018-03-27 07:06:56 UTC
Created attachment 111673 [details]
Keepass desktop file
Comment 12 Alexander Wilms 2018-03-27 07:07:15 UTC
Created attachment 111674 [details]
VLC desktop file
Comment 13 Kai Uwe Broulik 2018-03-27 07:11:08 UTC
The problem is indeed the flatpak runtime. The PID reported to PulseAudio for VLC player is "2" (kthreadd) and the WM_PID on Keepass is also 2, so it cannot tell. Not sure how/if this could be fixed on our side.
Comment 14 Alexander Wilms 2018-03-27 07:12:01 UTC
Should I file a bug report against flatpak?
Comment 15 Kai Uwe Broulik 2018-03-27 07:12:43 UTC
That would be great! Let's see what they have to say.
Comment 16 Alexander Wilms 2018-03-27 07:23:38 UTC
Done: https://github.com/flatpak/flatpak/issues/1523
Comment 17 Kai Uwe Broulik 2018-03-27 08:05:42 UTC
Let's close this for now until we have a word from them.
Comment 18 Alexander Wilms 2018-06-20 15:13:02 UTC
There've been two comments on the Flatpak bug report by Flatpak developers, mentioning that NET_WM_PID is not useful for differentiating between containerized applications and that GTK doesn't even set NET_WM_PID when run in a sandbox any more.

Is there another, better way to differentiate between applications?
Comment 19 Eike Hein 2018-06-20 16:17:47 UTC
Currently no. I think we need to ask the Flatpak devs what their plans are.
Comment 20 Alexander Wilms 2018-06-20 17:04:43 UTC
Matthias Clasen told me that asking pulseaudio would be the best option and someone else commented that Unity8 queried pulseaudio with the application ID. Though I assume in that case, two VLC windows would still have the same indicator, even though only one might be playing a sound.