FrankyPi
Posts: 11
Joined: Thu Dec 27, 2012 7:25 pm

Amixer doesn't change volume

Fri Jan 04, 2013 4:28 pm

Hi there,

I've a weird problem. :?
I'm setting up my Pi as an Internet radio streamer to be controled by my Android Smartphone.
The pythonScript I'm using for that worked fine so far, I was able to change channels, Play/Pause and to set the volume using 'amixer sset "Master0" XY'.
Now, after adding my Script to the autostart (init.d Autostart-Script) I can't set the Volume any more.
I can switch channels and when sending the amixer sset-command via SSH, I can even see the answer of amixer changing the volume. The only problem is that in reality it doesn't change the volume.

Any hints?

Best regards

FrankyPi

kalehrl
Posts: 350
Joined: Tue Jul 24, 2012 10:49 am

Re: Amixer doesn't change volume

Fri Jan 04, 2013 5:48 pm

Try restarting alsa-utils with:

Code: Select all

sudo /etc/init.d/alsa-utils restart

BerryPicker
Posts: 177
Joined: Tue Oct 16, 2012 3:03 pm
Location: The East of England

Re: Amixer doesn't change volume

Fri Jan 04, 2013 7:45 pm

Are you sure that you have a control = Master0 with contents = XY.
Maybe try amixer sget <control><contents> to check it is present.

kalehrl
Posts: 350
Joined: Tue Jul 24, 2012 10:49 am

Re: Amixer doesn't change volume

Fri Jan 04, 2013 8:58 pm

I struggled to adjust the volume using different command lines today.
The only thing that worked for me was issuing:

Code: Select all

alsamixer
adjusting the volume with UP and DOWN buttons and exiting.
And then finally:

Code: Select all

sudo /etc/init.d/alsa-utils restart
Nothing else worked and I tried a dozen command lines for adjusting the sound.

FrankyPi
Posts: 11
Joined: Thu Dec 27, 2012 7:25 pm

Re: Amixer doesn't change volume

Sat Jan 05, 2013 1:53 pm

Hi there,

thanks for the answers, but nothing helped so far.
Some code from SSH tries:

Code: Select all

pi@raspberrypi ~ $ amixer sset Master 0
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 0 [0%] [on]
  Front Right: Playback 0 [0%] [on]
pi@raspberrypi ~ $ esd stop
ERROR: Unknown command: stop
pi@raspberrypi ~ $ amixer restart
amixer: Unknown command 'restart'...
pi@raspberrypi ~ $ alsa-utils restart
-bash: alsa-utils: command not found
pi@raspberrypi ~ $ sudo /etc/init.d/alsa-utils restart
[ ok ] Shutting down ALSA...done.
[ ok ] Setting up ALSA...done.
pi@raspberrypi ~ $ alsa-utils
-bash: alsa-utils: command not found
pi@raspberrypi ~ $ amixer -h
Usage: amixer <options> [command]

Available options:
  -h,--help       this help
  -c,--card N     select the card
  -D,--device N   select the device, default 'default'
  -d,--debug      debug mode
  -n,--nocheck    do not perform range checking
  -v,--version    print version of this program
  -q,--quiet      be quiet
  -i,--inactive   show also inactive controls
  -a,--abstract L select abstraction level (none or basic)
  -s,--stdin      Read and execute commands from stdin sequentially

Available commands:
  scontrols       show all mixer simple controls
  scontents       show contents of all mixer simple controls (default command)
  sset sID P      set contents for one mixer simple control
  sget sID        get contents for one mixer simple control
  controls        show all controls for given card
  contents        show contents of all controls for given card
  cset cID P      set control contents for one control
  cget cID        get control contents for one control
pi@raspberrypi ~ $ amixer scontrols
Simple mixer control 'Master',0
Simple mixer control 'Capture',0
pi@raspberrypi ~ $ amixer scontents
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 0 [0%] [on]
  Front Right: Playback 0 [0%] [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch cswitch-joined penum
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 65536
  Front Left: Capture 18368 [28%] [off]
  Front Right: Capture 18368 [28%] [off]
pi@raspberrypi ~ $ amixer sset Capture 0
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch cswitch-joined penum
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 65536
  Front Left: Capture 0 [0%] [off]
  Front Right: Capture 0 [0%] [off]
pi@raspberrypi ~ $ amixer sset Capture 65000
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch cswitch-joined penum
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 65536
  Front Left: Capture 65000 [99%] [off]
  Front Right: Capture 65000 [99%] [off]
pi@raspberrypi ~ $ amixer sset Master 65000
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 65000 [99%] [on]
  Front Right: Playback 65000 [99%] [on]
pi@raspberrypi ~ $ amixer sset Master 0
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 0 [0%] [on]
  Front Right: Playback 0 [0%] [on]
pi@raspberrypi ~ $ alsamixer
pi@raspberrypi ~ $ sudo /etc/init.d/alsa-utils restart
[ ok ] Shutting down ALSA...done.
[ ok ] Setting up ALSA...done.
As you see, it's all working fine in Textmode. But in real, the sound volume didn't change anyhow.
@kaherl: I tried your idea too, Not only that it doesn't work, it would even be no solution to my problem, because I want to control volume via commandline <=via own python Server <=Network<=Selfmade Android App.

I'm wondering if esd could cause the problem, I installed it a while ago and tried to play arround with it but I think it didn't have any effect on the system. Might be it replaced alsamixer, where and how can I check that?

I didn't notice any changes after installation, just to be sure it's not that one causing my problem...

Perhaps I should go get some meditation skills before continueing with all that...

scphillips
Posts: 14
Joined: Thu Jan 10, 2013 5:08 pm

Re: Amixer doesn't change volume

Sat Jan 19, 2013 2:56 pm

I've just written a loooong blog post on my investigations into ALSA on the Raspberry Pispberry Pi. It might help you:
http://blog.scphillips.com/2013/01/soun ... with-alsa/

I'm not expert though :)

Stephen.

User avatar
phbcanada
Posts: 18
Joined: Tue Dec 11, 2012 1:16 pm

Re: Amixer doesn't change volume

Tue Feb 05, 2013 2:08 am

I'm having the same problem now. Can't adjust volume. Tried the utils restart but no diff. Tried reboot and power cycle - still no go.

Has anyone found a solution to this?

It was working fine last week. Not sure what has changed since then.

ashwee
Posts: 15
Joined: Tue May 28, 2013 6:28 pm

Re: Amixer doesn't change volume

Tue May 28, 2013 6:30 pm

http://ashman97.no-ip.org/?p=5 I managed it with that if that helps

I'm not good with scripts but the amixer you were using looked quite different and when I tried it it didn't work for me but this may be completely irrelevant

gbrlb
Posts: 1
Joined: Sun Oct 18, 2020 7:50 pm

Re: Amixer doesn't change volume

Sun Oct 18, 2020 7:56 pm

Hi. I also has the same problem, I solve partially using Pulse Audio Volume Control. It seems broken too but I can solve with the code:

Code: Select all

pulseaudio --check
pulseaudio -D
But when I restart I have to enter the code again.
I see the code here: https://classicforum.manjaro.org/index. ... ic=27044.0

Return to “Troubleshooting”