If you plug your speakers into the 3.5mm jack on the Raspberry Pi, the volume that you get is really low. I wanted to make the volume louder so I used this script that I found on the Raspberry Pi forums to do just that. By increasing the analog volume and saving these changes in the correct place, you can increase the volume to a level that works for you.

The process is really simple. First, type in the following at the prompt:

sudo nano ~/.bashrc

Now paste the following lines at the bottom of your .bashrc file:

# 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]%'

(Adding these aliases to your bashrc file means this will be available to you every time you log in, either remotely or on the machine itself.)

Now log out and log back in again. If you want to increase the volume, type:

volu

If you want to decrease the volume, type:

vold

That's it. Thanks to spitecho for the details.

Date Category Technology  Tags raspberry pi
Gary Hall
Article by Gary Hall
A teacher based in Beverley, England. Enjoys walking, travelling, reading and writing interesting content to help others. Feel free to comment below.


Comments

comments powered by Disqus