SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2013-05-31 13:38:09

folti
#! Member
Registered: 2013-05-26
Posts: 82

Mute and unmute on one keybinding? sound notification disapeared.

waldorf 11 64 bit


i bought new keyboard because i wanted ps2 keyboard (start system by any keyboard key, because my machine isn't near my table).


it has many hotkeys, among others, volume wheel and mute button.

i managed to put the volume wheel in function by adding


<keybind key="XF86AudioLowerVolume">
<action name="Execute">
<execute>amixer -c 0 set Master 5%- unmute</execute>
</action>
</keybind>
<keybind key="XF86AudioRaiseVolume">
<action name="Execute">
<execute>amixer -c 0 set Master 5%+ unmute</execute>
</action>
</keybind>
<keybind key="XF86AudioMute">
<action name="Execute">
<execute>amixer -c 0 set Master mute</execute>
</action>
</keybind>

problem 1:

no notification area window when raising/lowering/muting volume.

problem 2:


i wanted the key for muting ("XF86AudioMute") to also UNMUTE. so i added

<keybind key="XF86AudioMute">
<action name="Execute">
<execute>amixer -c 0 set Master toggle</execute>
</action>
</keybind>

after that, vlc or totem gave no sound. when tried to stat pavucontrol, nothing happens. it only shows window of pavucontrol, in the window says 'establishing connection....' and it does NOT start pulse audio server.

reinstalled vlc and totem (also tried 'purge' instead of 'remove' in apt-get xxxx.

no sound.

then i just erased keybinding for Master toggle (unmute), restarted, and everything is ok.


interesting thing is that  i can mute/unmute with middle mouse button. but i can't find mute/unmute mousebinding in rc.xml

now pressing the 'mute' button on keyboard works (because of the defined keybinding), but unmuting (Master toggle) doesn't work, even if i define it like before. when keybinding for unmute is entered  in rc.xml, pulse again crashes...

bug?


so...

1: how to get notification window abot raising/lowerin/muting volume back?
2: how to define 'unmute' option in rc.xml?

Last edited by folti (2013-05-31 15:45:01)

Offline

Be excellent to each other!

#2 2013-05-31 13:39:11

folti
#! Member
Registered: 2013-05-26
Posts: 82

Re: Mute and unmute on one keybinding? sound notification disapeared.

aha, keyboard is chicony 0420, if it means anything to anybody.

Offline

#3 2013-05-31 13:44:59

folti
#! Member
Registered: 2013-05-26
Posts: 82

Re: Mute and unmute on one keybinding? sound notification disapeared.

amixer -c 0 set Master mute

mute works in terminal

but

amixer -c 0 set Master toggle

doesn't work

Offline

#4 2013-05-31 14:33:57

folti
#! Member
Registered: 2013-05-26
Posts: 82

Re: Mute and unmute on one keybinding? sound notification disapeared.

ok, i figured out terminal command for unmute (toggle). it's:

amixer sset Master toggle

so i made another keybinding...

for mute:

<keybind key="XF86AudioMute">
<action name="Execute">
<execute>amixer -c 0 set Master mute</execute>
</action>
</keybind>

and for unmute/toggle:

<keybind key="XF86AudioMute">
<action name="Execute">
<execute>amixer sset Master toggle</execute>
</action>
</keybind>


and now...since two commands are binded to one same key, mute or unmute doesn't work. i see in notification area in tint2, when i press that key, it is switching between mute/unmute very fast.

that means keybinding and command works.

BUT, how can i have TWO functions on ONE button? so, when volume is, for example, 30%, i press 'mute' button and it mutes. how to get unmute/toggle by pressing SAME button?

Offline

#5 2013-05-31 14:47:03

xaos52
The Good Doctor
From: Planet of the @s
Registered: 2011-06-24
Posts: 4,602

Re: Mute and unmute on one keybinding? sound notification disapeared.

You could make your button press start a script.
And that script could test if your sound is currently muted or unmuted and reverse the setting.

Offline

#6 2013-05-31 15:25:35

folti
#! Member
Registered: 2013-05-26
Posts: 82

Re: Mute and unmute on one keybinding? sound notification disapeared.

ok, that's a good idea.

how should that script look like?

if i understood good:

1. script should test if there is sound louder than 0%
2. if it is, it should run 'mute' option (which is another script or just command?)
3. if it's not (if the sound is 0%), it should run 'unmute' option.

right?



ok, if i got that right, how to test sound level? what command?

Offline

#7 2013-05-31 15:46:26

folti
#! Member
Registered: 2013-05-26
Posts: 82

Re: Mute and unmute on one keybinding? sound notification disapeared.

changed name of topic, because i don't know what was happening with pulse.

Offline

#8 2013-05-31 15:55:03

folti
#! Member
Registered: 2013-05-26
Posts: 82

Re: Mute and unmute on one keybinding? sound notification disapeared.

or...

how can moving the volume wheel raise volume from mute?

maybe i sould define mute as 0% and unmute by spinnig the volume wheel in the 'up' direction?

but how to make a keybinding for 'mute' button to lower sound instantly?

Last edited by folti (2013-05-31 15:55:37)

Offline

#9 2013-05-31 16:26:50

xaos52
The Good Doctor
From: Planet of the @s
Registered: 2011-06-24
Posts: 4,602

Re: Mute and unmute on one keybinding? sound notification disapeared.

Here is an implementation.

Offline

#10 2013-05-31 16:59:52

folti
#! Member
Registered: 2013-05-26
Posts: 82

Re: Mute and unmute on one keybinding? sound notification disapeared.

hmmm....

i copied that script (from the second post) and called it 'zvuk'. i made it executable. it's location is /home/folti/scripts/zvuk

#!/bin/bash
#### Create ~/.pulse/mute if not exists
ls ~/.pulse/mute &> /dev/null
if [[ $? != 0 ]]
then
    echo "false" > ~/.pulse/mute
fi

####Create ~/.pulse/volume if not exists
ls ~/.pulse/volume &> /dev/null
if [[ $? != 0 ]]
then
    echo "65536" > ~/.pulse/volume
fi

CURVOL=`cat ~/.pulse/volume`     #Reads in the current volume
MUTE=`cat ~/.pulse/mute`          #Reads mute state

if [[ $1 == "increase" ]]
then
    CURVOL=$(($CURVOL + 3277)) #3277 is 5% of the total volume, you can change this to suit your needs.
    if [[ $CURVOL -ge 65536 ]]
    then
        CURVOL=65536        
    fi
elif [[ $1 == "decrease" ]]
then
    CURVOL=$(($CURVOL - 3277))
    if [[ $CURVOL -le 0 ]]
    then
        CURVOL=0        
    fi
elif [[ $1 == "mute" ]]
then
    if [[ $MUTE == "false" ]]
    then
        pactl set-sink-mute 0 1
        echo "true" > ~/.pulse/mute
    exit    
    else
        pactl set-sink-mute 0 0
        echo "false" > ~/.pulse/mute    
    exit
    fi
fi

pactl set-sink-volume 0 $CURVOL
echo $CURVOL > ~/.pulse/volume # Write the new volume to disk to be read the next time the script is run.

then i created EMPTY files ~/.pulse/volume and ~/.pulse/mute

(are these files meant to be empty?)


then i executed the script 'zvuk' and terminal output is:

folti@platon:~/scripts$ sh zvuk
zvuk: 4: zvuk: [[: not found
zvuk: 11: zvuk: [[: not found
/home/folti/.pulse/mute
/home/folti/.pulse/volume
zvuk: 19: zvuk: [[: not found
zvuk: 26: zvuk: [[: not found
zvuk: 33: zvuk: [[: not found
You have to specify a sink name/index and a volume

what does it mean i have to "specify a sink/name and a volume"? where? in the 'zvuk' script? and why aren't the files ~/.pulse/mute and ~/.pulse/volume found?

Offline

#11 2013-05-31 18:20:28

folti
#! Member
Registered: 2013-05-26
Posts: 82

Re: Mute and unmute on one keybinding? sound notification disapeared.

btw, where are the mousebindings defined except in rc.xml? it is obvious that there is some other conf file controlling audio options with mouse.

the middle button on the mouse is doing what i want the 'mute/unmute' button to do.

Offline

#12 2013-05-31 20:12:41

folti
#! Member
Registered: 2013-05-26
Posts: 82

Re: Mute and unmute on one keybinding? sound notification disapeared.

ahahhahhaha

ok, i'm sometimes an idiot big_smile

the ONLY thing i had to do was to bind 'toggle' (not mute and unmute). so, my rc.xml part related to mute/unmute has only ONE keybinding:

<keybind key="XF86AudioMute">
<action name="Execute">
<execute>amixer sset Master toggle</execute>
</action>
</keybind>


not

amixer -c 0 set Master toggle

like suggested on many other sites, but:

amixer sset Master toggle


xaos, thank You for your time and nerves smile


ok, now only the thing with notification diming window showing volume level.


how did it disapear after i defined keybinding for raising/lowering volume? so i can mark this solved...

Offline

#13 2013-05-31 20:29:49

rkwurth
#! Junkie
Registered: 2012-09-04
Posts: 365

Re: Mute and unmute on one keybinding? sound notification disapeared.

#! uses pnmixer, and you should be able to define your hotkeys in it's config gui, not in rc.xml. Doing so should make the indicators popup when you change volume, mute, etc.

Offline

#14 2013-05-31 20:46:58

folti
#! Member
Registered: 2013-05-26
Posts: 82

Re: Mute and unmute on one keybinding? sound notification disapeared.

here is mine pnmixer config file.

[PNMixer]
DisplayTextVolume=true
TextVolumePosition=1
MouseScrollStep=10
HotkeyVolumeStep=10
MiddleClickAction=0
CustomCommand=
VolumeControlCommand=pavucontrol
VolMuteKey=204
VolUpKey=204
VolDownKey=204
AlsaCard=(default)
DrawVolMeter=false
VolMeterPos=0
VolMeterColor=59624;28270;28270;
EnableHotKeys=false
VolMuteMods=0
VolUpMods=0
VolDownMods=0

[(default)]
Channel=Master

as you can see, VolMuteKey=204, VolUpKey=204, VolDownKey=204 are all the same. is that the problem? how to find out numbers for +/-/mute?

Offline

#15 2013-05-31 21:28:16

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 13,970

Re: Mute and unmute on one keybinding? sound notification disapeared.

@rkwurth:  The current version of PNMixer in Waldorf does not support setting hotkeys in its GUI; perhaps you're thinking about VolumeIcon, which had simple checkboxes allowing a Hobson's choice of either using the XF86 media keys or not?

@OP:  With the default settings, the XF86Volume{Up/Down/Mute} keys work as expected for most users...hopefully someone else has figured out how to make things work right with your keyboard.

Last edited by pvsage (2013-05-31 21:31:22)

Offline

#16 2013-05-31 21:35:17

folti
#! Member
Registered: 2013-05-26
Posts: 82

Re: Mute and unmute on one keybinding? sound notification disapeared.

ok, xev says that the keycodes are:

up-123
down-122
mute-121


but, when i enter these numbers instead of 204 (as shown above), after reboot, it says it vannot bind xf86up, xf86down and xf86mute.

is this happening because these are defined in rc.xml? should i delete keybindings in rc.xml  related to volUp, volDown and volMute?

what abot this option in pnmixer config:


EnableHotKeys=false

?

are these to be 'true'?



and these options? what do they control?


VolMuteMods=0
VolUpMods=0
VolDownMods=0

Offline

#17 2013-05-31 21:39:50

folti
#! Member
Registered: 2013-05-26
Posts: 82

Re: Mute and unmute on one keybinding? sound notification disapeared.

pvsage wrote:

@rkwurth:  The current version of PNMixer in Waldorf does not support setting hotkeys in its GUI; perhaps you're thinking about VolumeIcon, which had simple checkboxes allowing a Hobson's choice of either using the XF86 media keys or not?

@OP:  With the default settings, the XF86Volume{Up/Down/Mute} keys work as expected for most users...hopefully someone else has figured out how to make things work right with your keyboard.



so, i don't edit pnmixer config file?




hotkeys now work:) BUT, there is no notification (diming little window in upper right corner that dissapears after a few seconds) abot volume level, screen brightness....and they were there before i made keybindings in rc.xml


i think i called that thing OSD once, years ago...

Offline

#18 2013-05-31 21:43:16

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 13,970

Re: Mute and unmute on one keybinding? sound notification disapeared.

@folti:  If you have Pulseaudio installed (If you haven't removed it, you have it, as it's part of the base install) then I'm afraid someone else will have to come to your rescue; I've never had anything but trouble with Pulse, so removing it is one of the first things I did after a fresh install.

If you'd like to remove Puseaudio...sound always seems to be so much easier to configure without it...

Offline

#19 2013-05-31 21:48:21

folti
#! Member
Registered: 2013-05-26
Posts: 82

Re: Mute and unmute on one keybinding? sound notification disapeared.

it seems like that is solution other suggest also(removing pulse). i'll have problems with wireless bluetooth sound card, so i would rather give up OSD notifications that going through A2DP bluetooth config again (lot of work).

ok, i'm satisfied for now, but i will not mark this topic solved untill i find a solution for OSDnotify.

Offline

#20 2013-05-31 21:54:51

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 13,970

Re: Mute and unmute on one keybinding? sound notification disapeared.

Try this.  As I've mentioned, I don't do Pulse, so I haven't tried it myself:

VolMuteKey=XF86VolumeMute
VolUpKey=XF86VolumeUp
VolDownKey=XF86VolumeDown

I'm not sure what's responsible for the XF86Volume* keys being recognized without Pulse...it isn't in the Openbox rc.xml...

Offline

#21 2013-05-31 22:26:44

folti
#! Member
Registered: 2013-05-26
Posts: 82

Re: Mute and unmute on one keybinding? sound notification disapeared.

thanks for trying but no result.

i tried

VolMuteKey=XF86VolumeMute
bla
bla

and also

VolMuteKey=XF86AudioMute
bla
bla

and also combinations with

EnableHotKeys=false

and

EnableHotKeys=true

no notification window ;(


i installed notification-daemon, notify-osd, libnotify-bin, xbindkeys, xbindkeys-config


maybe it conflicts with OSD notifications. but i'm afraid (#!) to uninstall these packages, 'cause maybe my volume wheel will stop working. it's not taking considerable space on disk so...:) "if it ain't broken, don't fix it", says my russian friend:D


it's no big deal. i'm just curious why these notifications stopped working. i could say i have opsessive compulsive disorder in these things big_smile

if somebody is aware of conflict, please let me know.

pvsage, thanks for Your time:)

Offline

#22 2013-05-31 22:31:51

folti
#! Member
Registered: 2013-05-26
Posts: 82

Re: Mute and unmute on one keybinding? sound notification disapeared.

as i said on the other topic, i have a laptop with same waldorf version, and everything worked out of the box (except skype, of course:D, but that wasn't really a problem).


aaahhhh. my social life suffers because of linux. the variables are much *simpler* than humans to me, altough varables can really be pain in the a*s.


it's 1 am in croatia, so i'm going to sleep. thanks to everybody. c ya.

smile

Last edited by folti (2013-05-31 22:37:56)

Offline

#23 2013-05-31 22:37:29

folti
#! Member
Registered: 2013-05-26
Posts: 82

Re: Mute and unmute on one keybinding? sound notification disapeared.

one more thing, if it helps...

my /home/folti/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-notifyd.xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>

<channel name="xfce4-notifyd" version="1.0">
  <property name="notify-location" type="uint" value="2"/>
  <property name="theme" type="string" value="Smoke"/>
  <property name="initial-opacity" type="double" value="0.860000"/>
  <property name="expire-timeout" type="int" value="4"/>
</channel>

which is identical to settings in xfce4-notifyd-config GUI tool.

i'm thinking, maybe some notifyd themes mess up OSD. i'll try that tomorow and get back with the results.

now really good night and nice greetings from croatia. smile



edit:

when i run

notify-send something

it displays 'something' in notify window. so it's working. just not working for volume up/down/mute and brightmess levels.

Last edited by folti (2013-05-31 22:42:28)

Offline

#24 2013-05-31 23:46:06

rkwurth
#! Junkie
Registered: 2012-09-04
Posts: 365

Re: Mute and unmute on one keybinding? sound notification disapeared.

pvsage, folti - Please excuse me, I referred to the project's github wiki, according to which the current version does allow for hotkey configuration (maybe it's time to upgrade, amirite?!)

It looks like the volume indicator is produced by xfce4-volumed, which according to apt-cache show,

This is a volume keys control daemon for Xfce Desktop environment. It controls
the volume using multimedia keys, for the card configured in xfce4-mixer. It
also provides volume change notifications.

That's why binding keys in rc.xml isn't triggering the notifications- they aren't produced by a change in volume, but by the standard multimedia keys being pushed. As a solution, you may consider trying other applications (i.e. volumeicon, which has it's own volume popup thing), or maybe just fandangling some xmodmap config where whatever key you want to use to change volume also sends a keypress for whatever xfce4-volumed's looking for.

Of course, begin by checking that xfce4-volumed is actually running- I can't imagine the daemon would be looking for something other than XF86AudioLowerVolume & friends, so for example check your openbox/autostart file to confirm it's being started as it should.

Last edited by rkwurth (2013-05-31 23:59:06)

Offline

Be excellent to each other!

#25 2013-06-01 12:25:52

folti
#! Member
Registered: 2013-05-26
Posts: 82

Re: Mute and unmute on one keybinding? sound notification disapeared.

returned pnmixer config to previous state.


rkwurth, in autostart file, my volumed looks like this:

## Volume keys daemon
xfce4-volumed &

##Enable notifications daemon
xfce4-notifyd &

that means it is enabled, right?


another thing...i have gmail  watcher extension in iceweasel. when i receive new mail, notification in 'smoke' theme pops up. 'smoke' theme is chosen theme for notfications. is that due iceweasel or system?

also,

notify-send hello

produces hello in notification window. so...it means notify works. right? (that would mean that xfce4-notifyd is really started during OS loading, right?


if all of your answers to my questions ("right?") is yes, would you agree that i need to bind notifications to hotkeys?

Last edited by folti (2013-06-01 12:26:53)

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo