Hi,
So I got audio playing just fine, but I can't seem to change the volume. I'm trying to find a way to use amixer to change this, but I need some help. To play audio, I just type "aplay xyz.wav" and I get audio on headsets plugged into the 3.5mm jack. So I tried this to set volume, but I don't see any change in the listed values:
root@raspberrypi:/home/jdeltoft# amixer cset numid=1 -- 90%
numid=1,iface=MIXER,name='PCM Playback Volume'
; type=INTEGER,access=rw---R--,values=1,min=-10239,max=400,step=0
: values=-10239
| dBscale-min=-102.39dB,step=0.01dB,mute=1
root@raspberrypi:/home/jdeltoft# amixer cset numid=1 -- 10%
numid=1,iface=MIXER,name='PCM Playback Volume'
; type=INTEGER,access=rw---R--,values=1,min=-10239,max=400,step=0
: values=-10239
| dBscale-min=-102.39dB,step=0.01dB,mute=1
root@raspberrypi:/home/jdeltoft# sudo amixer cset numid=1 -- 10%
numid=1,iface=MIXER,name='PCM Playback Volume'
; type=INTEGER,access=rw---R--,values=1,min=-10239,max=400,step=0
: values=-10239
| dBscale-min=-102.39dB,step=0.01dB,mute=1
-
- Posts: 24
- Joined: Sun Jul 29, 2012 1:21 am
-
- Posts: 24
- Joined: Sun Jul 29, 2012 1:21 am
Re: Setting the volume for 3.5mm jack
Oh, and one other question that may be quick for someone that can answer the volume question is how to change it from Mono to stereo? This is my output of "amixer":
root@raspberrypi:/home/jdeltoft# amixer
Simple mixer control 'PCM',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
Playback channels: Mono
Limits: Playback -10239 - 400
Mono: Playback -10239 [0%] [-99999.99dB] [off]
root@raspberrypi:/home/jdeltoft# amixer
Simple mixer control 'PCM',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
Playback channels: Mono
Limits: Playback -10239 - 400
Mono: Playback -10239 [0%] [-99999.99dB] [off]
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6329
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Setting the volume for 3.5mm jack
Can you try updating firmware. There's been some improvements with ALSA volume/muting.
http://elinux.org/R-Pi_Troubleshooting# ... g_firmware
http://elinux.org/R-Pi_Troubleshooting# ... g_firmware
Re: Setting the volume for 3.5mm jack
I've added a link to the troubleshooting page to the Noob Image guide page might solve some issues. 

Noob is not derogatory the noob is just the lower end of the noob--geek spectrum being a noob is just your first step towards being an uber-geek 
If you find a solution please post it in the wiki the forum dies too quick

If you find a solution please post it in the wiki the forum dies too quick
Re: Setting the volume for 3.5mm jack
you could buy a cheap inline volume control from amazon
mine works fine
http://www.amazon.co.uk/gp/offer-listin ... dition=all
cheers
JG
mine works fine
http://www.amazon.co.uk/gp/offer-listin ... dition=all
cheers
JG
-
- Posts: 24
- Joined: Sun Jul 29, 2012 1:21 am
Re: Setting the volume for 3.5mm jack
Dom, thanks, I updated my firmware (and then had to get wifi working again
) But no help.
JG, thanks for the suggestion. I do want to have s/w control though and this seems to me to be something that should be totally trivial to get working.
I did try the troubleshooting link here also: http://elinux.org/R-Pi_Troubleshooting
It doesn't have anything about volume. It would help get sound if I didn't already have that working, but as I said I have that already.
So then I tried alsamixer. Interestingly, when you run that and type any of the number keys, it "tries" to go to a higher volume, but then jumps back to zero right away. Odd since my issue is that I can't seem to lower the volume. But anyway, I'll keep playing around. I'm so confused why this is hard but hey, what fun would it be if it just worked.

JG, thanks for the suggestion. I do want to have s/w control though and this seems to me to be something that should be totally trivial to get working.

I did try the troubleshooting link here also: http://elinux.org/R-Pi_Troubleshooting
It doesn't have anything about volume. It would help get sound if I didn't already have that working, but as I said I have that already.
So then I tried alsamixer. Interestingly, when you run that and type any of the number keys, it "tries" to go to a higher volume, but then jumps back to zero right away. Odd since my issue is that I can't seem to lower the volume. But anyway, I'll keep playing around. I'm so confused why this is hard but hey, what fun would it be if it just worked.

-
- Posts: 24
- Joined: Sun Jul 29, 2012 1:21 am
Re: Setting the volume for 3.5mm jack
Ok, I stumbled on it. I type to following (logged in a root for now):
amixer set PCM -- -XYY
Which will set the volume to -X.YYdB
So for example:
root@raspberrypi:/home/jdeltoft# amixer set PCM -- -2200
Simple mixer control 'PCM',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
Playback channels: Mono
Limits: Playback -10239 - 400
Mono: Playback -2200 [76%] [-22.00dB] [on]
I would still like to know how to change from mono. Let me play around there now.
amixer set PCM -- -XYY
Which will set the volume to -X.YYdB
So for example:
root@raspberrypi:/home/jdeltoft# amixer set PCM -- -2200
Simple mixer control 'PCM',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
Playback channels: Mono
Limits: Playback -10239 - 400
Mono: Playback -2200 [76%] [-22.00dB] [on]
I would still like to know how to change from mono. Let me play around there now.
Re: Setting the volume for 3.5mm jack
Thanks, Eradicatore. Been wondering how to set the analog volume.
Here are some aliases to put in ~/.bashrc to simplify the commands.
Here are some aliases to put in ~/.bashrc to simplify the commands.
Code: Select all
# Increase volume by 5%
alias volu='sudo amixer set PCM -- $[$(amixer get PCM|grep -o [0-9]*%|sed 's/%//')+5]%'
# Decrease volume by 5%
alias vold='sudo amixer set PCM -- $[$(amixer get PCM|grep -o [0-9]*%|sed 's/%//')-5]%'
Re: Setting the volume for 3.5mm jack
Can I just say a massive thank you to spitecho this issue of the Raspberry Volume being so low was driving me up the wall. This little script you posted has been my salvation! Massive thanks!

spitecho wrote:Thanks, Eradicatore. Been wondering how to set the analog volume.
Here are some aliases to put in ~/.bashrc to simplify the commands.Code: Select all
# Increase volume by 5% alias volu='sudo amixer set PCM -- $[$(amixer get PCM|grep -o [0-9]*%|sed 's/%//')+5]%' # Decrease volume by 5% alias vold='sudo amixer set PCM -- $[$(amixer get PCM|grep -o [0-9]*%|sed 's/%//')-5]%'
-
- Posts: 4
- Joined: Sat Mar 23, 2013 1:47 am
Re: Setting the volume for 3.5mm jack
Dear Raspberry pi users
I'm running a test with aplay and I want to put the volume down does anyone how to
Thanks,
Raspberrypiglitch!
I'm running a test with aplay and I want to put the volume down does anyone how to
Thanks,
Raspberrypiglitch!

Re: Setting the volume for 3.5mm jack
Hi Raspbians,
I have tried many codes but when i checked amixer doc ,i found this
this sets the volume to desired percentage
Happy pie-ing
I have tried many codes but when i checked amixer doc ,i found this
Code: Select all
amixer sset PCM,0 90%
Happy pie-ing

Re: Setting the volume for 3.5mm jack
Hi, I have tested my speakers with a iphone and the sound is quite loud, when I connect the speakers to the audiojack in the pi and play music from my iphone via shareport sound is very low. I have tried to increase sound to 100% via the great instructions on this page, but it does not increase volume. Any advice?
- mahjongg
- Forum Moderator
- Posts: 14780
- Joined: Sun Mar 11, 2012 12:19 am
- Location: South Holland, The Netherlands
Re: Setting the volume for 3.5mm jack
You are hijacking a thread, you should ask non identical questions in a new thread, but I assume you did not realize it has nothing to do with loudness control.chaddha wrote:Hi, I have tested my speakers with a iphone and the sound is quite loud, when I connect the speakers to the audiojack in the pi and play music from my iphone via shareport sound is very low. I have tried to increase sound to 100% via the great instructions on this page, but it does not increase volume. Any advice?
The PI's stereo output are only for amplifiers, they do not output enough energy even for headsets, let alone to directly drive speakers.
Also, as a general remark, the PMW signal used to drive the 3.5mm port is an 11-bit signal, and decreasing the volume will simply scale the signal down to less than 11 bits, which will have effect on the quality, so you should use an external volume control, and leave the PWM output at 100%.
Re: Setting the volume for 3.5mm jack
Thank you so much for this. It has helped a lot!!spitecho wrote:Thanks, Eradicatore. Been wondering how to set the analog volume.
Here are some aliases to put in ~/.bashrc to simplify the commands.Code: Select all
# Increase volume by 5% alias volu='sudo amixer set PCM -- $[$(amixer get PCM|grep -o [0-9]*%|sed 's/%//')+5]%' # Decrease volume by 5% alias vold='sudo amixer set PCM -- $[$(amixer get PCM|grep -o [0-9]*%|sed 's/%//')-5]%'
Re: Setting the volume for 3.5mm jack
This worked for me.mkgbian wrote:Hi Raspbians,
I have tried many codes but when i checked amixer doc ,i found thisthis sets the volume to desired percentageCode: Select all
amixer sset PCM,0 90%
Happy pie-ing

Connected my Headphones to the Pi and increased increased upto 200%

Moderator comment: Warning Any attempt of reducing or increasing the volume of the analog output this way will lead to loss of audio fidelity, the only correct way to set audio volume on analog output is to do it externally! Now locking this thread!