While trying to add audio output to my Portsdown DATV transmitter I found the output level from the 3.5mm jack on the Raspberry Pi was very low.
Feeling sure a web search would help I used my favourite search engine and located the solution in a post on the Raspberry Pi forum. Thanks to forum user spitecho I used a script he had posted up.
Here is the process.
Open the terminal and type the following at the prompt:
sudo nano ~/.bashrc
Now copy the following lines and paste at the end of the .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 aliases to the bashrc file allows you to adjust the volume up or down when you login to the Pi. Having saved the editted file you should log out and back in again. At the prompt type volu to increase volume or vold to decrease.
Note: If you use this script with the BATC Portsdown it should be placed just before the following line.
If you're not familiar with the nano editor used to add the two lines of code; please read up on it first.