Specify Alsamixer values

Here you can post about the issues related to modifications performed manually (not through the kiosk wizard). Example: swapped kernel, added 3rd party modules or files.
Please describe in detail what has been changed and hopefully other kiosk user will be able to help.
Porteus team wont resolve bugs posted in this category as we support only modifications made by the kiosk wizard.
Forum rules
Porteus Kiosk section of the forum is unmaintained now. Its kept in a 'read only' mode for archival purposes.
Please use the kiosk contact page for directing your queries: https://porteus-kiosk.org/contact.html
chardho
White ninja
White ninja
Posts: 15
Joined: 12 Jan 2017, 05:39
Distribution: 4.7.0
Location: USA

Specify Alsamixer values

Post#1 by chardho » 26 Oct 2018, 06:53

I've been searching the forum as well as the web to determine how to specify Alsamixer values from a configuration file.
Most tutorials, including the below forum post indicate to use 'aslactrl' commands to set the values, however alsactrl does not seem to be installed on the 4.7 iso.
they also refer to the config file being in /var/lib/alsa/asound.state or /etc/asound.state, neither of which exist which I assume is due to the lack of asactrl.

Is there any way of specifying these values from another config file or possibly using the run_command?

thanks,

Chardho

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Specify Alsamixer values

Post#2 by fanthom » 26 Oct 2018, 08:22

Hello chardho,

Please explain why you cant use official 'volume_level=' parameter.
Please add [Solved] to your thread title if the solution was found.

chardho
White ninja
White ninja
Posts: 15
Joined: 12 Jan 2017, 05:39
Distribution: 4.7.0
Location: USA

Specify Alsamixer values

Post#3 by chardho » 26 Oct 2018, 16:53

Because I want to be able to control not only the master volume but also the Mic volume and Mic Boost parameters as well as PCM which seems to be maxed out when the system boots.

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Specify Alsamixer values

Post#4 by fanthom » 26 Oct 2018, 17:39

In this case you could host 'alsactl' and previously generated asound.state file on some web storage and use 'run_command=' parameter to download them during system boot and restore your preferred values.

This way you'll be able to avoid remastering the ISO.

sample:

Code: Select all

run_command=wget https://domain.com/files/alsactl; wget https://domain.com/files/asound.state; chmod +x alsactl; /root/alsactl -f /root/asound.state restore
did not test but you should get the idea.
Please add [Solved] to your thread title if the solution was found.

chardho
White ninja
White ninja
Posts: 15
Joined: 12 Jan 2017, 05:39
Distribution: 4.7.0
Location: USA

Specify Alsamixer values

Post#5 by chardho » 26 Oct 2018, 18:41

fanthom,

thanks for the quick reply. This seems like a better solution than dealing with trying to create a module for alsa-utils as handling the dependencies has become a bit of a problem.
couple of questions.
Is alsactl not part of alsa-utils which has dependencies? I was not aware that it was simply a file I could load on demand.
Is asound.state a file that is built when alsa-utils are installed or is it a file that is created by the user simply for saving alsa state?

chardho

chardho
White ninja
White ninja
Posts: 15
Joined: 12 Jan 2017, 05:39
Distribution: 4.7.0
Location: USA

Specify Alsamixer values

Post#6 by chardho » 26 Oct 2018, 19:57

I think I found a better answer that is more simple and utilizes a tool already included in PK.

amixer allows you to change the volume settings on the fly from the command line and can therefore be implemented easily using the run_command

https://unix.stackexchange.com/question ... m-terminal

running 'amixer' without argument will list all cards and associated controls recognized by alsa. Below is my output.

Simple mixer control 'Master',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 87
Mono:
Front Left: Playback 75 [86%] [-9.00dB] [off]
Front Right: Playback 75 [86%] [-9.00dB] [off]
Simple mixer control 'Mic',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 10 [32%] [-19.50dB] [off]
Front Right: Playback 10 [32%] [-19.50dB] [off]
Simple mixer control 'Mic Boost',0
Capabilities: volume
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 3
Front Left: 2 [67%] [20.00dB]
Front Right: 2 [67%] [20.00dB]
Simple mixer control 'Capture',0
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 63
Front Left: Capture 0 [0%] [-17.25dB] [off]
Front Right: Capture 0 [0%] [-17.25dB] [off]
Simple mixer control 'Loopback Mixing',0
Capabilities: enum
Items: 'Disabled' 'Enabled'
Item0: 'Disabled'


Now I can run simple commands to change the values on the fly
'amixer -M set 'Master' 70%
'amixer -M set 'Mic' 30%
'amixer -M set 'Mic Boost' 30%

now these can be placed into a run command easily and run at boot time.
amixer -h gives alternate options for selecting specific cards etc...

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Specify Alsamixer values

Post#7 by fanthom » 27 Oct 2018, 04:48

Yes - we use amixer in our /etc/rc.d/rc.sound script.
Glad you found the solution.
Please add [Solved] to your thread title if the solution was found.

Locked