Raise/Lower volume and mixer audio channel choice
Mike Teehan
detox.genie at gmail.com
Sat Apr 14 17:23:05 UTC 2007
On Friday 13 April 2007 06:54:53 pm Andy Harrison wrote:
> On 4/13/07, Mike Teehan <detox.genie at gmail.com> wrote:
> > On Thursday 05 April 2007 12:51:22 pm Andy Harrison wrote:
> > > My laptop has some volume buttons bound to XF86AudioRaiseVolume and
> > > XF86AudioLowerVolume. They adjust the Master channel in the mixer
> > > panel, but I was wondering if it were possible to make them control
> > > the PCM channel instead?
> > >
> > > Running kubuntu-6.10, kde-3.5.6
> > >
> > > --
> > > Andy Harrison
> >
> > Okay, here's what I did to make a similar change on my system. I'm
> > running Feisty, but since we're both using KDE 3.5.6, it should be the
> > same. I am also assuming that you leave KMix running at all times.
> >
> > First, open 'System Settings' -> 'Accessibility' -> 'Input Actions'. This
> > will open the keyboard hotkey settings page.
> >
> > Next, we need to create a new Group to contain our new hotkeys. I called
> > mine 'KMix' because that's the program it is going to control.
> >
> > Inside this group, create a new action. Select the new action, and using
> > the 'General' tab, name it 'PCM Volume up', and set the 'Action type'
> > to 'Keyboard Shortcut -> DCOP Call (simple)'. Switch the the 'Keyboard
> > Shortcut' tab, and select your keyboard shortcut (this would be the
> > increase volume key for you). Finally, on the 'DCOP Call Settings', use
> > settings like these:
> > Remote application: kmix
> > Remote object: Mixer0
> > Called function: increaseVolume
> > Arguments: 1 (this determines which slider gets its volume increased)
> >
> > These settings should work, as long as PCM is slider #1 in KMix (Master
> > volume = slider #0) and kmix is running. YMMV.
> >
> > Create another action in the KMix group called 'PCM Volume down'. Setup
> > everything the same as the other action, only use Called
> > function 'decreaseVolume' instead of 'increaseVolume'. Hit 'Apply'.
> >
> > Let us know how it works out,
> > -- eMpTy
>
> I gave it a try and that does work. The only issue is that it no
> longer displays the volume percentage when I adjust the volume. Not a
> huge deal but there are times when you want to know the volume when
> there isn't any sound currently playing.
>
> --
>
> Andy Harrison
Easy enough. Install 'osdsh' through your package manager of choice. This
utility gives you the ability to display an OSD using a simple command. Mix
in a little dcop magic to read the PCM volume out of kmix, and your problem
is almost solved already.
Test it out with:
osdctl -s "PCM volume: `dcop kmix Mixer0 volume 1`"
If the above command doesn't work, or just stalls doing nothing, you need to
run 'osdsh' first. osdsh is the daemon that osdctl controls... if its not
running, no OSD.
Next, you need to alter your hotkeys. Change their type from "DCOP (simple)"
to "Command/URL (simple)". Now we're going to manually (command line-style)
issue the same dcop call that the hotkey used to do, and after run the
command above to display the new volume on-screen.
Set the volume down hotkey's command to:
dcop kmix Mixer0 decreaseVolume 1 && osdctl -s "PCM volume: `dcop kmix Mixer0
volume 1`"
Obviously, substitute "increaseVolume" for "decreaseVolume" in the other
hotkey.
Hopefully,
--eMpTy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kubuntu-users/attachments/20070414/40731f33/attachment.sig>
More information about the kubuntu-users
mailing list