You are not logged in.
Hey, I am currently trying to move to i3 from GNOME. I am setting it up. The issue is I can't change the default sound device in i3. I try "pamixer" which doesn't work but "pavucontols" works under gnome but doesn't under i3? I would want to change it though the CLI. Are there any way to fix this? Can I use "amixer"?
I think I am using ASLA but then why PluseAudio applications that control it, work?
Last edited by MathCubes (2016-01-14 01:21:15)
Offline
pacmd is your better choice from the command line
edit: Here is a simple script that I bind my media control keys to in i3wm
#!/bin/bash
oldvolume=$(pacmd dump |awk '( $1 ~ "set-sink-volume" && $0 ~ "analog" ){ print $3 }')
oldmute=$(pacmd dump |awk '( $1 ~ "set-sink-mute" && $0 ~ "analog" ){ print $3 }')
case $1 in
increase)
newvolume=$(($oldvolume + 0x400))
if (($newvolume >0x10000)) ; then
newvolume=$((0x10000))
fi
pacmd set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo $(printf '0x%x' $((newvolume)) )
;;
decrease)
newvolume=$(($oldvolume - 0x400))
if (($newvolume < 0 )) ; then
newvolume=$((0x0000))
fi
pacmd set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo $(printf '0x%x' $((newvolume)) )
;;
mute)
if [[(($oldmute == 'yes' ))]] ; then
pacmd set-sink-mute alsa_output.pci-0000_00_1b.0.analog-stereo 0
else
pacmd set-sink-mute alsa_output.pci-0000_00_1b.0.analog-stereo 1
fi
;;
*)
echo "usage pavolume increase | decrease | mute"
esac
Edit 2: Meant only as an example. I am sure my pci addresses might not be the same as yours.
Last edited by ewaller (2016-01-14 04:03:35)
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
PulseAudio is running upon login on GNOME, but not if you startx with i3.
systemctl --user enable pulseaudio
If pulse is running, you can use either pacmd/pactl/pavucontrol/pamixer/ponymix
Last edited by tom.ty89 (2016-01-14 07:57:19)
Offline
I am controlling sound with keyboard sound keys using xbindkeys, this is in my .xbindkeysrc
"pactl set-sink-volume @DEFAULT_SINK@ +5%"
XF86AudioRaiseVolume
"pactl set-sink-volume @DEFAULT_SINK@ -5%"
XF86AudioLowerVolume
"pactl set-sink-mute @DEFAULT_SINK@ toggle"
XF86AudioMute
hope this helps, you can check by running pactl command in terminal first before binding keys.
Arch is home!
https://github.com/Docbroke
Offline
Personally I hate using pactl for increasing/decreasing volume, because it allows the volume to go beyond 100% by default and the steps aren't at fixed points. IMHO pamixer/ponymix do it in a much better way for those.
Last edited by tom.ty89 (2016-01-14 09:07:02)
Offline
pacmd is your better choice from the command line
edit: Here is a simple script that I bind my media control keys to in i3wm
#!/bin/bash oldvolume=$(pacmd dump |awk '( $1 ~ "set-sink-volume" && $0 ~ "analog" ){ print $3 }') oldmute=$(pacmd dump |awk '( $1 ~ "set-sink-mute" && $0 ~ "analog" ){ print $3 }') case $1 in increase) newvolume=$(($oldvolume + 0x400)) if (($newvolume >0x10000)) ; then newvolume=$((0x10000)) fi pacmd set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo $(printf '0x%x' $((newvolume)) ) ;; decrease) newvolume=$(($oldvolume - 0x400)) if (($newvolume < 0 )) ; then newvolume=$((0x0000)) fi pacmd set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo $(printf '0x%x' $((newvolume)) ) ;; mute) if [[(($oldmute == 'yes' ))]] ; then pacmd set-sink-mute alsa_output.pci-0000_00_1b.0.analog-stereo 0 else pacmd set-sink-mute alsa_output.pci-0000_00_1b.0.analog-stereo 1 fi ;; *) echo "usage pavolume increase | decrease | mute" esac
Edit 2: Meant only as an example. I am sure my PCI addresses might not be the same as yours.
Okay. How do I use the sound device that I am using? I often switch back in forth through my speakers on my desk and headphones.
Offline
Check the output of pacmd dump
The information you need is in there. Post it if you need help.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
PulseAudio is running upon login on GNOME, but not if you startx with i3.
systemctl --user enable pulseaudio
If pulse is running, you can use either pacmd/pactl/pavucontrol/pamixer/ponymix
Thanks it wasn't now I just need to put it into my i3 conf file.
Offline
i3 conf file?
Offline