Bug 136378 - KMix Global Shortcuts for adjusting sound levels and mute doesn't work.
Summary: KMix Global Shortcuts for adjusting sound levels and mute doesn't work.
Status: RESOLVED FIXED
Alias: None
Product: kmix
Classification: Applications
Component: general (show other bugs)
Version: 2.6
Platform: unspecified Linux
: HI normal
Target Milestone: ---
Assignee: Christian Esken
URL:
Keywords:
: 137810 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-10-27 11:52 UTC by Miika Koskinen
Modified: 2007-12-30 14:41 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
A patch for reverting the broken Accelerator change (1.33 KB, patch)
2006-12-01 21:40 UTC, Christian Esken
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Miika Koskinen 2006-10-27 11:52:13 UTC
Version:           2.6 (using KDE 3.5.5, Kubuntu (edgy) 4:3.5.5-0ubuntu3)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.17-10-generic

When assigning a keyboard shortcut keys for Global Shortcuts (Settings->Configure Global Shortcuts), they do not work. In earlier version they worked fine. After installing kubuntu 6.10 Edgy with new KDE version they didn't work anymore.
Comment 1 David Rosenstrauch 2006-10-27 17:13:30 UTC
I can confirm this as well (on Arch Linux).  Very annoying bug!  I use those volume shortcut keys constantly!
Comment 2 Christian Esken 2006-10-27 19:16:45 UTC
Some application must be holding the keyboard shortcuts. Unfortunately there is no way to find out which.
So please try this: Stop AND disable KMilo (KDE control center => KDE components => Services). The logout and login again. Try to use the keys or reassign them.

If this doesn't help, please try this: Quit KMix (CTRL-q) and close all KMix Panelapplets. Then open a Konsole and delete the KMix configuraton like this:
cd ~/.kde/share/config/; rm kmixrc kmix_panelapplet_*rc

Start KMix and/or the PanelApplet and reassing the keys. Please report back on success or failure.
 
Comment 3 David Rosenstrauch 2006-10-30 20:39:43 UTC
I tried all of these suggestions, but none of them fixed the problem.

And I've pretty much determined that the problem is not that they key is being assigned elsewhere, as you thought, since:

1) it doesn't matter which key combinations I assign here; none of them work.
2) when I assign a key combo for "Toggle Mute Of Master Channel" in kmix, that key shortcut doesn't work either.

So I think that the problem must be somewhere in changes made to kmix and/or the global shortcut key system in 3.5.5.

I would think that you should be able to recreate and confirm this on your system.  Are you not able to re-create, Christian?
Comment 4 Ray L. 2006-11-01 04:38:27 UTC
I can confirm this as well on OpenSuse 10.1. I tried several keys. I made sure they were not mapped to something else by finding one in KDE's Accessibility input actions dialog, made sure it worked there, then unmapped it and tried to use it in Kmix. I tried this with several different keys. No love in Kmix. Then I RE-mapped them back to their originals in the accessibility input actions dialog and tested them there again. They all work there again. KDE 3.5.5 release 19.1.
Comment 5 Christian Esken 2006-11-01 09:49:59 UTC
Ray, thanks for confirming (comment 4). So we now know there is a problem with Kubuntu and SuSE ... so this doesn't look like a packaging problem.
I am running here KDE3.5.4. fine and KMix is basically no different in those two versions. I am updating currently to check this issue.
David, Ray: Which KDE version did you use before?
Comment 6 Christian Esken 2006-11-01 11:13:06 UTC
I updated to KDE3.5.5 (more precisely: openSUSE 10.0 "KDE 3.5.5 release 19.1") and the keyboard shortcuts in KMix do still work.
There is only the issue that special keys (Multimedia, Browser, EMail, ...) fail to work in complete X11 since the update (probably a KDM configuration issue). Normal keys work though.
Comment 7 Christian Esken 2006-11-01 11:27:11 UTC
Comment about comment 6: The "special keys  fail to work in complete X11" 
is a non-issue (my fault): I didn't set the keyboard properly in SuSE's YaST configuration. So that works too.
Now that unfortunately means I cannot reproduce the problem. :-(
Comment 8 Miika Koskinen 2006-11-01 12:00:39 UTC
I installed KDE 3.5.5 with Kubuntu 6.10 on another completely different computer also and KMix shortcut keys didn't work on that computer either.
Comment 9 David Rosenstrauch 2006-11-01 15:15:56 UTC
Re: comment #5:

I was running KDE 3.5.4 up until 10/27, and the Kmix keys were working like a charm.  After my distro (www.archlinux.org) upgraded to 3.5.5 the keys no longer work.

I'm surprised to hear that you can't recreate this, Christian, since there's at least 3 people here who've confirmed this on 3 different distros.

Is it feasible for you to try to upgrade to openSuse 10.1?  Ray in comment #4 seems to be able to recreate the problem on that version of Suse.  I ask this because one commonality that I see for everyone who's been able to recreate the problem is that we're each running distros with very up-to-date s/w.  So perhaps we're each running a newer version of some other package that's somehow interfering with the keyboard shortcuts, which you're not seeing because you're on Suse 10.0.
Comment 10 Ray L. 2006-11-04 04:42:25 UTC
I see this one is still showing uncomfirmed. Is there anything else we can do to help?
Comment 11 Miika Koskinen 2006-11-04 08:26:58 UTC
Christian, have you tried to reproduce the problem with Kubuntu? I'm not sure about LiveCD desktop but I would guess you can just boot in LiveCD desktop and see it already there for yourself. I'm sure you can reproduce it since I had it on two different systems. It gives me tears to not be able to use the shortcut keys. :-)
Comment 12 Miika Koskinen 2006-11-09 21:09:23 UTC
To add on my previous post #11, yes the bug exists also in Kubuntu LiveCD mode, so it shoul be very easy to reproduce the problem for debugging.
Comment 13 Christian Esken 2006-11-14 00:24:41 UTC
Miika, I tested with Kubuntu 6.10 Live CD (KDE3.5.5). And what should I say: Keyboard shortcuts work flawlessy in Live CD, if you follow comment #2 (disable KMilo and then do a graphical re-login). 

We are stuck now. I cannot reproduce, so if somebody has any other idea, please speak up.

Christian

PS: The biggest problem was, that seems to be sheer luck whether Kubuntu supports Keyboard and mouse at all. I neeeded 5 reboots (and about 100 USB plugout/plugin actions until Kubuntu would recognize my mouse nad keyboard (and well: it *did* see my compact flash reader on the very same USB bus all the time). Because of this I am not too eager to repeat experiments with Kubuntu.

Comment 14 David Rosenstrauch 2006-11-14 18:24:40 UTC
Sorry - I tried everything you suggested, but it's still broken!  I even tried creating a brand new user account and testing there (in order to see if it was something in my user's configuration), but I still get the same problem.

So what to do next?  Maybe we should try to figure out commonalities in the configuration of those of us affected by this bug.

For example, in my setup:

* hardware: Dell Optiplex GX620 (although I had the same problem on a GX520), Belkin USB KVM (for keyboard and mouse)
* OS = Arch Linux
* kernel version =  2.6.18.2
* KDE version = 3.5.5
* sound module = snd_intel8x0
* the keys that I'm trying to map in KMix:  Win-Up (alternate Ctrl-Atl-Up) for Volume Up; Win-Down (alternate Ctrl-Alt-Down) for Volume Down
* running in my KDE panel:  clock, kmix, knemo (network monitor), system monitor, taskbar, pager

Anyone have any other ideas on how to narrow this down?

And Christian, as far as on your end, if you have time to do more testing on this, perhaps you can try various additional different setups and configurations to try to recreate this on your end:

* try using a different distro or version of distro (e.g., maybe upgrade your OpenSuse to the latest version, or perhaps try installing one of the OS's that some of us have reported the problem under)
* try using a different machine
* try under a different user account
* try having another KDE dev see if they can recreate this
etc.

Beyond that, I really don't know.  I'm really surprised that we're having such difficulty just getting this to recreate, as it seems to be happening pretty reliably for many of us.  I'm open to any other ideas anyone else might have.  I'd really love to get this fixed ASAP, because it's a REALLY annoying bug!
Comment 15 David Rosenstrauch 2006-11-14 21:19:16 UTC
Hoo hah!  I think I just found the solution for this!!!

1.  Right-click on the KMix speaker icon in the system tray.
2.  Click on "Select Master Channel ..."
3.  Switch the master channel to a different setting (e.g., PCM), and then click "OK"
4.  Switch the master channel to the correct setting (e.g., Master), and then click "OK"

Your KMix global shortcut keys will now magically work again!!!

I have no idea exactly what setting is being changed by this (no visible changes appear in the kmixrc file).  But I'm guessing that what must be happening is that somehow the master channel got defaulted to some weird/wrong setting in KDE 3.5.5.  And so although KMix is probably actually registering that you've pressed your global shortcut key, and it probably actually is incrementing the volume on whatever is erroneously being considered the master channel, it's not actually changing the volume on the real master channel.  Switching the master channel to something else and then back again therefore seems to connect the shortcut keys with the correct master channel, and so - voila - volume control is restored!  Hooray!

No need to thank me, everyone, just send money.  :-)

Anyway, I'm assuming that this fix will work for everyone else as well, but please do report back success or failure here.

So Christian, I guess the only remaining issue to resolve here (assuming that this fix works for others as well) is:  what changed in KDE 3.5.5 that set the master channel incorrectly - and should there be a fix applied to fix this for the next release of KDE?

Enjoy your volume control, everyone!!!
Comment 16 Miika Koskinen 2006-11-15 08:47:18 UTC
Yes wonderful! Awesome finding David! I was yesterday again almost crying because I couldn't control the channels with keyboard. I'm really used to do that in certain situations and it has almost killed me to not being able to do that.

Indeed they work now after changing master channel by yourself once. The problem could indeed how David described. I almost feel stupid that I didn't try this by myself, because I've tried a lot of things.

Wow, what a nice morning to find out that my volume keys are now restored! Thanks David, you're the man! ;-)
Comment 17 Ray L. 2006-11-15 15:49:38 UTC
Yep. Works for me on openSUSE 10.1 KDE 3.5.5 build 39.1!! Thnx! Let's squash this sucker.
Comment 18 Ray L. 2006-11-15 16:04:47 UTC
Miika, David: Does your "mute of master channel" shortcut work? Mine does not, even though the volumes do. Please advise...
Comment 19 David Rosenstrauch 2006-11-15 16:14:27 UTC
Yes, mine is working fine.  It puts a black slash across the KMix speaker icon in the toolbar, and mutes the sound.
Comment 20 Miika Koskinen 2006-11-15 16:44:37 UTC
Ray, I was wondering about the mute thing also, but I found out that KMix doesn't seem to be able to mute my master channel at all, I mean there is no tick to mute the master channel in the graphical window. Therefore muting with keyboard shortcut doesn't mute master channel. If I choose PCM as master channel the muting works. PCM can be ticked to be muted in graphical mixed window too.

I remember I could do that earlier, but I changed sound card sometime ago so I'm not sure if that made the difference. I wish I was able to mute master channel also, but there just isn't a tickbox that could be clicked to mute it nor the global shortcut keys work when 'master' is selected as master channel.
Comment 21 David Rosenstrauch 2006-11-15 17:44:57 UTC
Hmmm ...

Not sure what the setup is for you guys, but on my box I have 4 output channels:  Master, Master Mono, Headphone, and PCM, all of which can be muted (have a green mute radio button above them).  (Screenshot at: http://www.darose.net/KMixWindow.png if you're interested.  I didn't attach it to this bug report, since it's not really relevant to the main bug.)  So given that, I have no problem muting Master.

I guess you guys must have a different setup that's preventing muting the master.

Anyway, we should probably take this discussion either off-line, or to another bug report (if needed), since it's not relevant to the main bug.
Comment 22 Christian Esken 2006-11-24 20:25:02 UTC
Ray, could you please do the test described in comment 4 again. Just don't try it with "KDE's Accessibility input actions dialog", but use kscd or Amarok's global shorcuts.
Comment 23 Ray L. 2006-11-26 03:35:58 UTC
Okay Christian. I did so in Amarok with the mute key. Same exact test (only I did it in Amarok this time) with the same results. Except of course we've already gotten the volume keys working, so this was just the mute shortcut I was playing with. 
Comment 24 Samuel Gilbert 2006-11-26 21:13:44 UTC
I had the exact same problem using KDE 3.5.5 freshly compiled on Linux (x86_64) release 2.6.17-gentoo-r8.  Fourtunately, the trick in <a href="http://bugs.kde.org/show_bug.cgi?id=136378#c15">comment 15</a> solved the problem.  However, I don't think it's acceptable to switch the master channel back and forth to have the global shortcuts work.
Comment 25 Ray L. 2006-11-26 22:46:52 UTC
Umm I should be more specific with my phrase "same results" from my comment 23. The mute key STILL does not work. Only the volumes, and those were from using comment 15 of course.
Comment 26 raphael 2006-12-01 09:33:35 UTC
*** This bug has been confirmed by popular vote. ***
Comment 27 Christian Esken 2006-12-01 19:23:50 UTC
*** Bug 137810 has been marked as a duplicate of this bug. ***
Comment 28 Christian Esken 2006-12-01 19:30:24 UTC
This bug report is weird. I'll try to summarize the current status:

There are several very interesting aspects in this:
1) People report it broken in *various* distributions (SuSE, KUbuntu, Arch Linux)
1a) So this is not a packaging issue of a certain distribution
1b) It works perfect for me in SuSE10.0 (reported as broken). This is independent of whether I use the "official" SuSE pacakges or compile it myself.
1c) It works perfect for me in KUbuntu 6.10 Live CD (reported as broken)
1d) As it works for me, it doesn't sound like a general KMix problem.
2) The shortcuts work in other applications, even those who use Global Shortcuts
3) It is not the ususal case (that some other unknown application has taken the shortcut). This was checked.
4) It is not a problem of special keys with specific keyboards (e.g. the infamous Logitech XF86AudioRaiseVolume issue). The problem is also there with regular key combinations (e.g. CTRL-m).
5) By using one or more reassignements of keyboard shortcuts, some people report success, some partial success, some none at all.

I am pretty stuck here, and would be very happy if someone could shed some light on this issue. I am trying to get some response on kde-core-devel.

To cut it short: Currently I have no idea what is going on.
Comment 29 David Rosenstrauch 2006-12-01 20:24:05 UTC
Well, the one definite that I can tell you is that this was working fine in 3.5.4, and only became a problem in 3.5.5.  So unfortunately that's probably the best way to tackle this.

So maybe it'd be possible to spot-check the code and see what was changed for 3.5.5 in some of the relevant areas - e.g., KMix, the global shortcuts, the area in KMix where the user assigns the master channel, areas in KDE or KMix where app config settings get loaded (i.e., maybe a relevant app setting is getting wiped out, or a default value was initialized wrong or not at all, or some new setting was introduced but never initialized until you manually switch the master channel, etc.)

You might also look and see if there were any bug fixes in these areas for 3.5.5 that might have had an impact.

Another possible avenue to follow up:  why does switching the master channel fix this?  What does switching the master channel do?  Does it write some necessary config setting somewhere?  And if so, why isn't that config setting set already?

Sorry I can't help more, but I'm not a KDE dev and don't know C++ well.  But I'll be happy to assist with what I can do, though (and have been) - testing the code and commenting here.  HTH.
Comment 30 Christian Esken 2006-12-01 21:38:54 UTC
Hello everybody, there is bad news and good news.

Bad news are that really is a bug and I see no workaround yet.

Good news are, that it looks fixable. There has only be exactly *one* source code change in KMix between 3.5.4 and 3.5.5 and this can be seen here: http://websvn.kde.org/branches/KDE/3.5/kdemultimedia/kmix/kmix.cpp?rev=581568&r1=511125&r2=581568 .
I missed that one when I first looked at it, so thanks for the encouragement, David.

My plan it to revert this. I somebody has KDE3.5.5 sources, *please* try. I'll create an attachment "revertBrokenGlobalAccell.diff for the reverting patch.

Target fix: KDE3.5.6 (expected January 23rd, 2007).


Comment 31 Christian Esken 2006-12-01 21:40:48 UTC
Created attachment 18745 [details]
A patch for reverting the broken Accelerator change
Comment 32 Christian Esken 2006-12-04 23:35:45 UTC
Hello everybody,

I am in urgent need of feedback. Please, please everyone post the number of their sound devices. Proposed form is the output of 
      cat /proc/asound/cards

As far as I see there are actually multiple bugs described here:
1) Keys not working
2) Master not correct
3) Mute not working

I believe I have fixes for issue 1 and 2. But to verify this, I really need your input.
Comment 33 Christian Esken 2006-12-04 23:54:02 UTC
SVN commit 610680 by esken:

Fixing wrong master selection on start of KMix (if you have multiple
cards and master is not on first card). This will fix at least aspects
of bug 136378.
CCBUGS: 136378


 M  +9 -6      mixertoolbox.cpp  


--- branches/KDE/3.5/kdemultimedia/kmix/mixertoolbox.cpp #610679:610680
@@ -129,12 +129,6 @@
 			primaryKeyOfMixer.replace("=","_");
 			
 			mixer->setID(primaryKeyOfMixer);
-                        if ( Mixer::masterCard() == 0 ) {
-                           // We have no master card yet. This actually only happens when there was
-                           // not one defined in the kmixrc.
-                           // So lets set this here as master card.
-                           Mixer::setMasterCard(primaryKeyOfMixer);
-                        }
 
 		} // valid
 		else
@@ -190,6 +184,15 @@
 	    } // loop over sound card devices of current driver
 	} // loop over soundcard drivers
 
+        if ( Mixer::masterCard() == 0 ) {
+           // We have no master card yet. This actually only happens when there was
+           // not one defined in the kmixrc.
+           // So lets just set the first card as master card.
+           if ( Mixer::mixers().count() > 0 ) { 
+              Mixer::setMasterCard( Mixer::mixers().first()->id());
+           } 
+        }
+
 	ref_hwInfoString = i18n("Sound drivers supported:");
 	ref_hwInfoString.append(" ").append( driverInfo ).append(	"\n").append(i18n("Sound drivers used:")) .append(" ").append(driverInfoUsed);
 
Comment 34 Christian Esken 2006-12-05 00:27:56 UTC
Please don't be confused about my commit (comment 33). Feedback is still needed  as described in comment 32.
Comment 35 Ray L. 2006-12-05 02:11:02 UTC
Here is my info for your comment 32:

0 [Audigy2        ]: Audigy2 - Audigy 2 ZS [SB0350]
                      Audigy 2 ZS [SB0350] (rev.4, serial:0x20021102) at 0x3000, irq 233




Comment 36 David Rosenstrauch 2006-12-05 04:08:34 UTC
I had this problem on 2 machines:

[darose@davidrlin ~]$ cat /proc/asound/cards
 0 [ICH7           ]: ICH4 - Intel ICH7
                      Intel ICH7 with AD1981B at 0xfeabfa00, irq 19

[darose@darsys10 ~]$ cat /proc/asound/cards
 0 [I82801DBICH4   ]: ICH4 - Intel 82801DB-ICH4
                      Intel 82801DB-ICH4 with STAC9752,53 at 0xf4fff800, irq 5
Comment 37 Drlik Zbynek 2006-12-05 07:58:53 UTC
 0 [ICH6           ]: ICH4 - Intel ICH6
                      Intel ICH6 with AD1981B at 0xd0581000, irq 233
 1 [Modem          ]: ICH-MODEM - Intel ICH6 Modem
                      Intel ICH6 Modem at 0x2400, irq 209
Comment 38 Kostas Liakakis 2006-12-05 21:52:03 UTC
I got whetever keys defined for increase/decrease/mute volume as global shortcuts in kmix working again just by addring a MasterMixerDevice=0 in kmixrc. This is what the patch posted suggests. Switching the master device back and forth has the same effect.

For the record, I have:
kostas@nx8220 ~ $ cat /proc/asound/cards
 0 [ICH6           ]: ICH4 - Intel ICH6
                      Intel ICH6 with AD1981B at 0xc8c01000, irq 21

Thanks everybody, I was troubled with this for quite a while now :)

-K.

Comment 39 Gregor Goestl 2006-12-05 21:57:17 UTC
0 [NVidia         ]: HDA-Intel - HDA NVidia
                     HDA NVidia at 0xfe024000 irq 217
1 [AudioPCI       ]: ENS1371 - Ensoniq AudioPCI
                     Ensoniq AudioPCI ENS1371 at 0x9c00, irq 66

I want to use the first channel on the second device (AudioPCI) as Master Channel. But it always is set back to the first device.
Comment 40 Miika Koskinen 2006-12-06 15:23:34 UTC
Here is my output:

 0 [CMI8738MC6     ]: CMI8738-MC6 - C-Media PCI CMI8738-MC6
                      C-Media PCI CMI8738-MC6 (model 55) at 0xdc00, irq 5

I'm glad to hear you have progressed with the fixing of this troublesome bug.
Comment 41 Gary Murphy 2007-01-31 22:18:29 UTC
Just confirming that the bug exists on Mandriva 2007.0, and that the Master
Channel Select trick fixes it.
Comment 42 Jiri Kraus 2007-04-16 20:28:46 UTC
I am using the beta of kubuntu feisty, and for me only muting is not working. The output of cat /proc/asound/cards:
 0 [Audigy         ]: Audigy - Audigy 1 [SB0090]
                      Audigy 1 [SB0090] (rev.3, serial:0x531102) at 0xb000, irq 22
 1 [U0x46d0x8b4    ]: USB-Audio - USB Device 0x46d:0x8b4
                      USB Device 0x46d:0x8b4 at usb-0000:00:1d.2-1, full speed
If i can do anything more, please ask.
Comment 43 Miika Haapalainen 2007-04-24 21:48:21 UTC
I just upgraded from the most up-to-date version of Kubuntu Edgy to Kubuntu Feisty and here's what I have:
Previously KMix was working perfectly (on Kubuntu Edgy). Shortcut keys were also working perfectly.
BUT, just after I updated to Feisty, Kmix mute stopped working. No matter if I tick the mute on from Kmix menu (right-click, select mute) OR by pressing Fn+F3 (which is the mute key in my F&S Amilo). Tried to change master channel back and fort without any success.
Comment 44 Sebastian Turzański 2007-04-24 23:06:11 UTC
Miika be sure to shut down kmix between changes.
Comment 45 Christian Esken 2007-04-28 12:17:40 UTC
Miika, please report the KDE and KMix version (before and after upgrade).
Comment 46 Christian Esken 2007-06-16 21:04:10 UTC
Miika,

I have a couple of questions I urgnetly need to fix this:

1) Are only the multimedia keys affected?
2a) Is the shortcut for the Master affected? (Menu -> Settings -> Global Shortcuts)
2b) Is the shortcut for normal controls (e.g. PCM) affected? (KMix main menu -> PCM slider -> right click -> Global Shortcuts)
3) Is Kmilo running? (kcontrol -> KDE components -> Services -> Lower list "KDE sevices at start" -> KMilo
   if it is running:
    a) Stop it
    b) Disable it
    c) Logout from KDE
    d) Login again
    e) Try it and report back


Comment 47 Christian Esken 2007-06-16 23:08:40 UTC
Also everybody who has trouble might try to run KMix with a fresh setup:

1) Quit kmix (CTRL-q)
2) In a Konsole:
   mv ~/.kde/share/config/kmixrc ~
3) Start kmix again

Please report back
Comment 48 Christian Esken 2007-10-05 15:56:58 UTC
Here is an outlook how I will handle this bug report.

I believe that the reasons for all the problems are divers. Some bugs in KMix, some bugs in KMilo, Soundcard Driver Issues, other applications that take away global shortcuts and many more issues.

Because of that, I am going to not touch this bug report in KDE3 any more. When KDE4 is out, I will close this bug report. If issues come up, please do not reopen this bug report, but open a new bug report.

  Christian
Comment 49 Christian Esken 2007-12-30 14:41:20 UTC
KDE4 is about to be released. As announced, I am closing this bug report.

If issues come up, please do not reopen this bug report, but open a new bug report.

--------
PS: I decided to set the resolution code to "FIXED". This is due to the fact, that global shortcuts are handled centrally in KDE4. If there is a global shortcut conflict (within KDE4 applications), KDE4 shows which application holds the Shortcut and offers to reassign the Shortcut.