Bug 288637 - New streams are not shown in pop-up list
Summary: New streams are not shown in pop-up list
Status: RESOLVED NOT A BUG
Alias: None
Product: kmix
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: VHI major
Target Milestone: ---
Assignee: Christian Esken
URL:
Keywords:
: 310494 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-12-10 09:43 UTC by Antonio Rojas
Modified: 2013-02-04 19:07 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.10


Attachments
Patch to show new pulseaudion streams in pop up window (470 bytes, patch)
2012-12-13 01:59 UTC, Eugene Shalygin
Details
More correct patch (973 bytes, patch)
2012-12-20 23:46 UTC, Eugene Shalygin
Details
3 different playback streams for amarok. (373.24 KB, image/png)
2012-12-24 17:44 UTC, Alex Tsi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antonio Rojas 2011-12-10 09:43:00 UTC
Version:           unspecified (using Devel) 
OS:                Linux

In KDE 4.8 the output streams are shown in the pop-up that you get when you click the kmix icon (not the full kmix window wih tabs). However this doesn't work if the streams are started when kmix is already running (which is the usual situation). If I restart kmix, all streams are correctly shown

Reproducible: Always

Steps to Reproduce:
start a new playback stream when kmix is already running

Actual Results:  
it is not shown in the pop-up window

Expected Results:  
it is shown in the pop-up window
Comment 1 Christian Esken 2011-12-12 23:40:03 UTC
SVN commit 1268427 by esken:

Show new MPRIS2 Streams (Stream hotplug)
CCBUGS: 288637

 M  +55 -15    backends/mixer_mpris2.cpp  
 M  +6 -5      backends/mixer_mpris2.h  
 M  +0 -6      core/volume.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1268427
Comment 2 Christian Esken 2011-12-12 23:50:00 UTC
SVN commit 1268430 by esken:

Remove MPRIS2 Streams (Stream unplug)
CCBUGS: 288637

 M  +14 -0     backends/mixer_mpris2.cpp  
 M  +14 -0     core/mixset.cpp  
 M  +2 -0      core/mixset.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1268430
Comment 3 Christian Esken 2011-12-13 01:18:50 UTC
Strangely enough my changes only works for the MainWindow and not for the Tray-Popup. I need to look into that.
Comment 4 Christian Esken 2011-12-13 19:46:35 UTC
SVN commit 1268580 by esken:

Show and remove MPRIS2 Streams (Stream hotplugging)
BUGS: 288637

 M  +6 -0      apps/kmix.cpp  
 M  +2 -0      apps/kmix.h  
 M  +41 -30    backends/mixer_mpris2.cpp  
 M  +3 -5      backends/mixer_mpris2.h  
 M  +1 -0      gui/kmixdockwidget.cpp  
 M  +14 -18    gui/viewbase.cpp  
 M  +9 -0      gui/viewdockareapopup.cpp  
 M  +6 -0      gui/viewdockareapopup.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1268580
Comment 5 Antonio Rojas 2011-12-24 09:50:36 UTC
This is still valid in 4.8rc1
Comment 6 Christian Esken 2011-12-24 11:43:46 UTC
Thanks for the proper test. :-) I can confirm your observation.

The tray popup seems to work only correctly if at least one MPRIS2 application has registered BEFORE KMix is started. It looks like stream hotplugging is not properly initialized for the tray popup in the other case. Weird, but possibly a SIGNAL is not connected.

It is very interesting, as the Main Window always works correctly.
Comment 7 black_painkiller 2012-01-07 15:13:05 UTC
confirm also in kde4.8rc2

If I open for instance amarok or clementine, stream are not showed in widget popup (only on main sound control).

If I kill kmix and restart, the streams appear!
Comment 8 black_painkiller 2012-03-09 10:20:25 UTC
still present in kde 4.8.1 for Tray-Popup!
Comment 9 Dennis Schridde 2012-05-18 19:07:16 UTC
Still present in 4.8.3.

I would expect the small popup when clicking the kmix systray icon to show all playing applications / output streams. Currently it does not show any streams at all, but just the default output device.
Comment 10 Thomas 'PointedEars' Lahn 2012-08-04 21:51:29 UTC
Confirmed for kmix=4:4.8.4-2 i386 on Debian.
Comment 11 Christian Esken 2012-08-14 06:59:37 UTC
Not sure why this is assigned to Colin. I'll take it over.
Comment 12 Christian Esken 2012-10-03 23:30:54 UTC
Fixed for KDE 4.10
Comment 13 Antonio Rojas 2012-11-22 17:25:20 UTC
Still doesn't work in 4.10 beta 1 with pulseaudio. I only see "event notifications" in the popup, all streams are shown in the full window
Comment 14 Christian (Fuchs) 2012-11-23 14:47:22 UTC
*** Bug 310494 has been marked as a duplicate of this bug. ***
Comment 15 Christian Esken 2012-12-04 21:07:05 UTC
To A Rojas. Can you try to disable the tray menu and then enable it again from the KMix configuration dialog. Do the streams show up then?
Comment 16 Christian Esken 2012-12-04 22:44:43 UTC
Git commit 1dfbbeb37fe03ed58b7be8ecdf22b376e3633830 by Christian Esken.
Committed on 04/12/2012 at 23:42.
Pushed by esken into branch 'master'.

Fix resizing of the Sound Menu, after hotplug or application stream changes.
I still have not the faintest idea why the Widget refuses to resize itself,
so I now recreate the Sound Menu each time it pops up.

M  +0    -2    apps/kmix.h
M  +27   -28   gui/kmixdockwidget.cpp
M  +2    -2    gui/kmixdockwidget.h
M  +8    -2    gui/viewdockareapopup.cpp

http://commits.kde.org/kmix/1dfbbeb37fe03ed58b7be8ecdf22b376e3633830
Comment 17 Christian Esken 2012-12-04 22:45:55 UTC
This is an urgent call for testing!!!
With the patch I just did, it works for me reliably. Please test.
Comment 18 Christian (Fuchs) 2012-12-04 23:03:45 UTC
It still doesn't show new streams in the popup here (just fetched the most recent version from git, which is   
repository:  git://anongit.kde.org/kmix  at the commit:  dfbbeb37fe03ed58b7be8ecdf22b376e3633830
which should include your changes) 

Thanks for looking into this.
Comment 19 Christian Esken 2012-12-04 23:55:42 UTC
Thanks for the quick check, Fuchs. I tested with "ALSA+MPRIS2", and it works 100% perfect. When using "Pulseaudio", it doesn't work. I will look into it.

Work note: Probably the streams are not correctly labeled as streams, or there is an unfortunate mixup of Master Control and Streams.
Comment 20 Eugene Shalygin 2012-12-06 13:34:26 UTC
Still does not work in 4.9.90.
Comment 21 Alex Tsi 2012-12-11 05:48:32 UTC
Just tested with latest git version. It doesn't work for me either (kde 4.8.4). I use pulseaudio.

When i log in the only stream shown (no matter what application runs afterwards) is the events.
Starting amarok, killing kmix and starting kmix again, makes amarok stream appear, but the events stream is now gone. Now, opening e.g. smplayer, no new stream appears. Killing kmix and starting it again makes amarok and smplayer streams appear, but events stream not shown again.

That said, kmix just shows the streams that where "running" the moment it started, and after it start, no matter what other applications start, no other stream appears.

Notice that if i press the "mixer" button and go to "playback streams" tab, all streams appear correctly.
Comment 22 Alex Tsi 2012-12-11 05:57:05 UTC
Also if a smplayer is running and the stream appears in the popup, if i terminate smplayer the stream is gone from the popup, as expected. Starting smplayer again and the stream doesn't appear in the popup. 
However, smplayer is the last stream shown in the popup and i terminate it, then the stream dissapears, and finally the "events" stream appears. That's a weird behavior.
This of course applies for every application, not only smplayer.
Comment 23 Eugene Shalygin 2012-12-13 01:59:51 UTC
Created attachment 75809 [details]
Patch to show new pulseaudion streams in pop up window

I do not know, am I right, but this small change fixes the problem
Comment 24 Eugene Shalygin 2012-12-13 02:05:02 UTC
> I do not know, am I right, but this small change fixes the problem
At least, IMO, it suggests that the problem is related to the flag isApplicationStream of the MixDevice object
Comment 25 Christian (Fuchs) 2012-12-13 12:44:09 UTC
(In reply to comment #23)
> Created attachment 75809 [details]
> Patch to show new pulseaudion streams in pop up window

Confirmed to work here
Comment 26 Alex Tsi 2012-12-13 14:02:09 UTC
Yeap, confirming it works for me too!Thanks a lot Eugene!
Comment 27 Alex Tsi 2012-12-13 14:07:51 UTC
However, i do not know if this is expected, but if i have the popup opened and a a new stream opens, then the popup becomes blank, and i have to close it and reopen it again in order to show the streams correctly. Maybe i should open a new bug about that?
Comment 28 Eugene Shalygin 2012-12-20 23:46:14 UTC
Created attachment 75947 [details]
More correct patch

Previous patch was incorrect: all new streams were supposed to be from applications. Perhaps this one is more correct
Comment 29 Alex Tsi 2012-12-24 17:36:45 UTC
I tried your latest patch and indeed it wirks, however sometimes i get multiple streams for the same application, although i do not know if this has to do with your patch. I attach a photo. If this is unrelated to the patch, please tell me so that i can file it as another bug.
Comment 30 Alex Tsi 2012-12-24 17:44:46 UTC
Created attachment 75997 [details]
3 different playback streams for amarok.

Only one of the streams seems to react to the volume. The rest just don't do anything, no matter if i slide them up or down.
Comment 31 Eugene Shalygin 2012-12-24 18:54:35 UTC
(In reply to comment #29)
Alex, I see only one way how the patch can lead to appeareance of several applications streams: it just uncovers another problem. However, I can not see a way for the such problem in current master branch code: list of the streams is cleaned every time and populated again. Can you check with master or 4.10 RC1? And I hope we will get responce from the developers after the holidays.
Comment 32 Alex Tsi 2012-12-27 13:25:53 UTC
Ok Eugene, i tried with master and it happened again. However, i also checked the  kmix window and found out that the streams where there too. So it is probably just a pulseaudio bug, and not a kmix one. If it happens again i'll try to get more infos (although it happens randomly and rarely).
Comment 33 Dennis Schridde 2012-12-28 12:30:00 UTC
(In reply to comment #32)
> Ok Eugene, i tried with master and it happened again. However, i also
> checked the  kmix window and found out that the streams where there too.
Maybe you can also compare with pavucontrol, and see whether the streams are shown there, too.
Comment 34 Christian Esken 2013-01-02 21:40:23 UTC
Trunk and KDE 4.10 RC2 contains a patch similar to Eugene's first patch, but only application streams are marked as streams.
Alex, I never had those "duplicated" streams, so I would ask you to compare with pavucontrol, like Dennis already suggested.
Comment 35 Eugene Shalygin 2013-01-04 18:20:21 UTC
(In reply to comment #33)
> Maybe you can also compare with pavucontrol, and see whether the streams are
> shown there, too.

I've observed a similar bug with Amarok. After picking playlist item manually, I saw many amarok streams in the Kmix window. Pavucontrol refused to start (just showed a black window of giant size) and there were many amarok clients in `pactl list` output. Sound from Amarok was produced by "LibVLC" client. So, must be Amarok and/or pulseaudio bug?
Comment 36 Christian Esken 2013-01-15 19:47:54 UTC
(In reply to comment #35)
> (In reply to comment #33)
> > Maybe you can also compare with pavucontrol, and see whether the streams are
> > shown there, too.
> 
> I've observed a similar bug with Amarok. After picking playlist item
> manually, I saw many amarok streams in the Kmix window. Pavucontrol refused
> to start (just showed a black window of giant size) and there were many
> amarok clients in `pactl list` output. Sound from Amarok was produced by
> "LibVLC" client. So, must be Amarok and/or pulseaudio bug?

I would guess so. And even Pavucontrol refuses to start. Wow.
Comment 37 Alex Tsi 2013-01-24 17:22:15 UTC
Sorry for not giving feedback back sooner, but i couldn't as i didn't have that problem anymore. Probably it's because i stopped using amarok.
So i guess it has nothing to do with kmix, but mostly with amarok (and probably pulseaudio).
Comment 38 Christian Esken 2013-02-04 19:07:04 UTC
Looks like some non KMix component was the cause. Closing