Saving Alsamixer Input Settings for AudioInjector

Moderator: flatmax

Post Reply
epalaima
Posts: 6
Joined: Mon Aug 01, 2016 7:54 am

Saving Alsamixer Input Settings for AudioInjector

Post by epalaima » Thu Mar 16, 2017 4:20 am

Hi, I am trying to save my input settings for the AudioInjector card with sudo alsactl store, but the input settings keep getting reset upon reboot. I'm just trying to have line input turned on by default.

I change my settings in alsamixer to turn line input on then run:

Code: Select all

sudo alsactl store 0 
I see the settings changed in /var/lib/alsa/asound.state, but they are still changed back on reboot including in the asound.state file. I am looking in asound.state at:

Code: Select all

state.audioinjectorpi {
...
control.4{
iface MIXER
name 'Line Capture Switch'
value.0 false
value.1 false
comment{
access 'read write'
type BOOLEAN
count 2
}

}
...
}
I have also tried a workaround where I add the line:

Code: Select all

sudo amixer -c 0 sset Line,0 100%, 100% unmute cap > /home/pi/Desktop/result.txt
to my /etc/rc.local, which succeeds in running and creating the result.txt file, which shows that the command succeeded in turnings line input on, but when I open alsamixer Line Input Capture is off again.

It seems like maybe something else is happening at some point during boot which loads in different settings and turns line input off.

Any idea what is going on here?

flatmax
Posts: 609
Joined: Sat Jul 23, 2016 11:39 pm

Re: Saving Alsamixer Input Settings for AudioInjector

Post by flatmax » Sun Mar 19, 2017 7:27 pm

Hi there,

I have investigated this "feature" you mention and it turns out that the Wolfson Micro chip which is used in this device doesn't have a hardware control for the RCA volume. It does have this control for the headphone jack, so if you want you can switch to using the headphone jack instead of the RCA connectors. If you are happy to use the potentiometer to control the RCA output jack volume, then that is great, otherwise, read on for a nice solution.

If you want to use the RCA connectors, then the following post explains how to implement an ALSA softvol control which will allow you to control the RCA connectors from the commandline and alsamixer :
viewtopic.php?f=5&t=572

Hope that solves your approach to volume control of the RCA connectors from the command line.
thanks
Matt
Check out our audiophile quality crossovers : https://bit.ly/2kb1nzZ
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector

Peter
Posts: 9
Joined: Sat May 27, 2017 7:23 am

Re: Saving Alsamixer Input Settings for AudioInjector

Post by Peter » Sat May 27, 2017 7:42 am

Hello apalaima,

I have the feeling that flatmax answer did not quite reflected your situation, as you referred to the Input Capture settings which disappear after a reboot. I have the same issue (running an RPi3 and the audioinjector HAT). The disappearance (reset) of the CAPTURE only happens when I use the desktop (PIXEL) environment, not when I go to console. As I am doing some Python programming trying to get the audio injector working, I require the PIXEL Desktop environment and a standard (default!) CAPTURE setting of the aufio injector. I wonder if you have managed meanwhile to accomplish that (the PIXEL audio device cannot be forced to "remember" the capture setting unfortunately).

BR,

Peter

flatmax
Posts: 609
Joined: Sat Jul 23, 2016 11:39 pm

Re: Saving Alsamixer Input Settings for AudioInjector

Post by flatmax » Wed Jun 07, 2017 10:13 am

I think this post sheds some light on why things are changing.

I haven't worked out yet what to do to un-do these changes. it is possible that one solution would work as follows :
1] Store your settings somewhere in your home directory :

Code: Select all

sudo alsactl -f ~/.alsastate store
2] On boot, restore by adding

Code: Select all

sudo alsactl -f ~/.alsastate restore 
to the file ~/.config/lxsession/LXDE-pi/autostart

Anyone willing to play with this ?
Matt
Check out our audiophile quality crossovers : https://bit.ly/2kb1nzZ
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector

Peter
Posts: 9
Joined: Sat May 27, 2017 7:23 am

Re: Saving Alsamixer Input Settings for AudioInjector

Post by Peter » Mon Jul 10, 2017 6:55 pm

Hi Mat,

Storing and retaining ALSA MIXER settings while running PIXEL desktop.

Manually entering the restore option works. Hence, I tried to implement it in autostart (which resides on at least 2 places on an RPi: ./config/lxsession/LXDE-pi/autostart and /etc/xdg/lxsession/LXDE-pi/autostart. In neither file did the command have any effect. Perhaps it was initiated too early to take effect on the Pixel ALSA MIXER setting, but it did not solve the issue.
In the end a "dirty" solution did te trick: issuing the restore command using Crontab.

1. Store the ALSA MIXER settings you want: sudo alsactl store
2. Create a delayed restore in crontab:
crontab -e
add this line: @reboot sleep 15 ; sudo /usr/sbin/alsactl restore
Save/exit. After a reboot the settings will be restored. Especially the "Line In" selecton which always dissapears, whether I chosse "make default" or not!

BR,

Peter

I editted 2. as it contained 2 errors :oops:

flatmax
Posts: 609
Joined: Sat Jul 23, 2016 11:39 pm

Re: Saving Alsamixer Input Settings for AudioInjector

Post by flatmax » Wed Jul 12, 2017 6:20 pm

ok thanks for letting us know.

If you want to modify your crontab command, lets talk about it ...
Check out our audiophile quality crossovers : https://bit.ly/2kb1nzZ
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests