I am following this question to set my volume levels from the command line. I need to be able to set the volume from within a tmux session (actually from a node process running in tmux).
When I run amixer -D pulse sset Master 50%
straight in my ssh session, it works just fine.
$ amixer -D pulse sset Master 50%
Simple mixer control 'Master',0
Capabilities: pvolume pswitch pswitch-joined
Playback channels: Front Left - Front Right
Limits: Playback 0 - 65536
Mono:
Front Left: Playback 26214 [50%] [on]
Front Right: Playback 26214 [50%] [on]
If I open tmux, then run the same command, it fails:
$ tmux
...
$ amixer -D pulse sset Master 50%
ALSA lib pulse.c:242:(pulse_connect) PulseAudio: Unable to connect: Connection refused
amixer: Mixer attach pulse error: Connection refused
Within node, I'm just using the child_process.spawn
function which gives the same result as running from tmux, so I assume they are related.
What gives?