Page 1 of 2

How to save changes made to alsamixer (Squeezelite)

Posted: Mon Mar 20, 2017 3:26 pm
by BobC
After successfully running a RPi3/DietPi/DragonFly Red combo in Roon, I am trying to set up the same configuration with Squeezelite. I have the thing running OK but the sound output is very low. I have worked out how to set the required PCM level using ssh alsamixer but the setting reverts when the Pi is rebooted/switched off and on. How do I save the changes I make in alsamixer? Id be grateful for any assistance. Thanks, Bob

Re: How to save changes made to alsamixer (Squeezelite)

Posted: Mon Mar 20, 2017 3:29 pm
by Sciamano
This shouldn't happen.
On my OrangePi PC, alsamixer does not lose the settings when I reboot.

Re: How to save changes made to alsamixer (Squeezelite)

Posted: Tue Mar 21, 2017 5:59 am
by tkr001
alsactl store

Re: How to save changes made to alsamixer (Squeezelite)

Posted: Tue Mar 21, 2017 11:12 am
by BobC
tkr001 wrote:alsactl store
Thanks, I gave that a go but it did not work...
On opening alsamixer PCM is 0 [dB gain: -64.00], this results in a very faint sound on my system through the DragonFly Red with the volume at 100%. I change the PCM to 84 [dB gain -4.00] which gives excellent sound quality and full range on the volume controls. Alas, even when using the alsactl store command after entering the change, the PCM setting reverts to 0 following a reboot or shutdown/power up.
Is there anything else I can try?
With thanks, Bob

Re: How to save changes made to alsamixer (Squeezelite)

Posted: Tue Mar 21, 2017 11:59 am
by den_hr
Strange... Could it be permissions? Are you issuing commands as root or as "ordinary" user? You could try prefixing alsamixer invocation with "sudo", perhaps, just to be sure (if you are not root).... Also check user and group permissions.

Re: How to save changes made to alsamixer (Squeezelite)

Posted: Tue Mar 21, 2017 12:11 pm
by BobC
Thanks, strange indeed! Changes made in root (i think) see screen shot below...
I am not all that savvy with command lines - how would I check user and group permissions and what should I be looking for?

Created by : Daniel Knight
Web : http://DietPi.com
Twitter : http://twitter.com/dietpi_
Donate : http://goo.gl/pzISt9
DietPi's web hosting is powered by: MyVirtualServer.com

dietpi-launcher = All the DietPi programs in one place.
dietpi-config = Feature rich configuration tool for your device.
dietpi-software = Select optimized software for installation.
htop = Resource monitor.
cpu = Shows CPU information and stats.

root@DietPi:~# alsamixer
root@DietPi:~# alsactl store
root@DietPi:~#

Re: How to save changes made to alsamixer (Squeezelite)

Posted: Tue Mar 21, 2017 2:16 pm
by den_hr
BobC wrote:Thanks, strange indeed! Changes made in root (i think) see screen shot below...
I am not all that savvy with command lines - how would I check user and group permissions and what should I be looking for?
Yes, you are issuing those commands as root - thought that perhaps you created another "ordinary" user, so that would make sense.
This way, I really am stumped as to what is going on :(

Re: How to save changes made to alsamixer (Squeezelite)

Posted: Fri Mar 24, 2017 12:20 am
by BobC
Im still stumped. In desperation I installed piCorePlayer on a spare card. PCM level in Alsa was 100% and volume was fine. However, in comparison with DietPi, it was less stable over WiFi. Are there any tweaks I can make in the DietPi-config menu that will force higher PCM levels on startup?

Re: How to save changes made to alsamixer (Squeezelite)

Posted: Fri Mar 24, 2017 3:21 pm
by Sciamano
Have you tried using 'amixer' (the command line mixer) instead of the graphical alsamixer?
It's definitely less intuitive, but I would give it a try.

Give the following command:

Code: Select all

amixer contents
You'll get an output similar to the following (this is just an example: your output will be different!):

Code: Select all

numid=6,iface=MIXER,name='Lineout volume control'
  ; type=INTEGER,access=rw------,values=1,min=0,max=31,step=0
  : values=31
numid=7,iface=MIXER,name='ADC input gain ctrl'
  ; type=INTEGER,access=rw------,values=1,min=0,max=7,step=0
  : values=7
numid=10,iface=MIXER,name='Audio adda drc'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
Identify the name of the control you need to tweak (it's the string after name=), and check the maximum value in the following line.
Then give the command:

Code: Select all

amixer sset 'name of the control' X
where 'name of the control' is the string after name= you had identified earlier and X is the value you want to set to it.
In the example above, if you wanted to set the 'Lineout volume control' to its maximum value of 31 you would give the following command:

Code: Select all

amixer sset 'Lineout volume control' 31
Adjust as needed and please report back.
Hope this helps.

Re: How to save changes made to alsamixer (Squeezelite)

Posted: Fri Mar 24, 2017 5:54 pm
by BobC
Thank you for your assistance - If I could trouble you for a bit more guidance.

I worked through your clear and helpful instructions and found that the following command set the required level...

root@DietPi:~# amixer sset PCM Playback Volume 60
Simple mixer control 'PCM',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 64
Mono: Playback 60 [94%] [-4.00dB] [on]
root@DietPi:~#

Alas, the setting did not survive a reboot and PCM reverted to '0'. Is there another save/store command that I could try?