View Single Post
Old 07-18-2012, 11:06 AM   #226
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
ALSACTL - Let's have a peek then

SO..... in order to maintain the thread OT. The FFT Debate - and work tranche has been shoveled across to Reworking FFT code
================================================== ========

Back to the crux of the thread: Making the sound setup do things we want!
Let's have a quick play with alsactl

Let's have a look at a vaguely relevant man page http://linux.die.net/man/1/alsactl
okay, done that? onwards...

The version on the kindle is wee bit old:
Code:
[root@kindle bin]# alsactl --version
alsactl version 1.0.13
So we best bear that in mind - as there are a few bugs out there that have been noted in several versions subsequent to this, which does not preclude their undiscovered existence in this version...

Code:
[root@kindle root]# alsactl store -f /mnt/us/opt/sound/alsactl.state 
(I added .txt to the version attached. .TXT is "required" so it could be uploaded here. the name is inconsequential can be changed or used as is)

Here's the output of my alsactl.state - AS IS unamended on a k3gWifi
(the popular name used is asound.state, I prefer my name. call it what you want)

Spoiler:
Code:
state.mx35luigi {
	control.1 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 63'
		iface MIXER
		name 'Capture Volume'
		value.0 23
		value.1 23
	}
	control.2 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 2
		iface MIXER
		name 'Capture Volume ZC Switch'
		value.0 false
		value.1 false
	}
	control.3 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 2
		iface MIXER
		name 'Capture Switch'
		value.0 false
		value.1 false
	}
	control.4 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 255'
		iface MIXER
		name 'Playback Volume'
		value.0 249
		value.1 249
	}
	control.5 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 127'
		iface MIXER
		name 'Headphone Playback Volume'
		value.0 0
		value.1 16
	}
	control.6 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 2
		iface MIXER
		name 'Headphone Playback ZC Switch'
		value.0 false
		value.1 false
	}
	control.7 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 127'
		iface MIXER
		name 'Speaker Playback Volume'
		value.0 0
		value.1 16
	}
	control.8 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 2
		iface MIXER
		name 'Speaker Playback ZC Switch'
		value.0 false
		value.1 false
	}
	control.9 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 1
		comment.range '0 - 5'
		iface MIXER
		name 'Speaker DC Volume'
		value 0
	}
	control.10 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 1
		comment.range '0 - 5'
		iface MIXER
		name 'Speaker AC Volume'
		value 0
	}
	control.11 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'PCM Playback -6dB Switch'
		value false
	}
	control.12 {
		comment.access 'read write'
		comment.type ENUMERATED
		comment.count 1
		comment.item.0 'No Inversion'
		comment.item.1 'Left Inverted'
		comment.item.2 'Right Inverted'
		comment.item.3 'Stereo Inversion'
		iface MIXER
		name 'ADC Polarity'
		value 'No Inversion'
	}
	control.13 {
		comment.access 'read write'
		comment.type ENUMERATED
		comment.count 1
		comment.item.0 None
		comment.item.1 '32Khz'
		comment.item.2 '44.1Khz'
		comment.item.3 '48Khz'
		iface MIXER
		name 'Playback De-emphasis'
		value None
	}
	control.14 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'ADC High Pass Filter Switch'
		value false
	}
	control.15 {
		comment.access 'read write'
		comment.type ENUMERATED
		comment.count 1
		comment.item.0 'No Inversion'
		comment.item.1 'Left Inverted'
		comment.item.2 'Right Inverted'
		comment.item.3 'Stereo Inversion'
		iface MIXER
		name 'DAC Polarity'
		value 'No Inversion'
	}
	control.16 {
		comment.access 'read write'
		comment.type ENUMERATED
		comment.count 1
		comment.item.0 High
		comment.item.1 Low
		iface MIXER
		name '3D Filter Upper Cut-Off'
		value High
	}
	control.17 {
		comment.access 'read write'
		comment.type ENUMERATED
		comment.count 1
		comment.item.0 Low
		comment.item.1 High
		iface MIXER
		name '3D Filter Lower Cut-Off'
		value Low
	}
	control.18 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 1
		comment.range '0 - 15'
		iface MIXER
		name '3D Volume'
		value 0
	}
	control.19 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name '3D Switch'
		value false
	}
	control.20 {
		comment.access 'read write'
		comment.type ENUMERATED
		comment.count 1
		comment.item.0 Off
		comment.item.1 Right
		comment.item.2 Left
		comment.item.3 Stereo
		iface MIXER
		name 'ALC Function'
		value Off
	}
	control.21 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 1
		comment.range '0 - 7'
		iface MIXER
		name 'ALC Max Gain'
		value 7
	}
	control.22 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 1
		comment.range '0 - 15'
		iface MIXER
		name 'ALC Target'
		value 4
	}
	control.23 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 1
		comment.range '0 - 7'
		iface MIXER
		name 'ALC Min Gain'
		value 0
	}
	control.24 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 1
		comment.range '0 - 15'
		iface MIXER
		name 'ALC Hold Time'
		value 0
	}
	control.25 {
		comment.access 'read write'
		comment.type ENUMERATED
		comment.count 1
		comment.item.0 ALC
		comment.item.1 Limiter
		iface MIXER
		name 'ALC Mode'
		value ALC
	}
	control.26 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 1
		comment.range '0 - 15'
		iface MIXER
		name 'ALC Decay'
		value 3
	}
	control.27 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 1
		comment.range '0 - 15'
		iface MIXER
		name 'ALC Attack'
		value 2
	}
	control.28 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 1
		comment.range '0 - 31'
		iface MIXER
		name 'Noise Gate Threshold'
		value 0
	}
	control.29 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'Noise Gate Switch'
		value false
	}
	control.30 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 127'
		iface MIXER
		name 'ADC PCM Capture Volume'
		value.0 0
		value.1 0
	}
	control.31 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 1
		comment.range '0 - 7'
		iface MIXER
		name 'Left Output Mixer Boost Bypass Volume'
		value 2
	}
	control.32 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 1
		comment.range '0 - 7'
		iface MIXER
		name 'Left Output Mixer LINPUT3 Volume'
		value 2
	}
	control.33 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 1
		comment.range '0 - 7'
		iface MIXER
		name 'Right Output Mixer Boost Bypass Volume'
		value 2
	}
	control.34 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 1
		comment.range '0 - 7'
		iface MIXER
		name 'Right Output Mixer RINPUT3 Volume'
		value 2
	}
}


As ever filled with much unexciting dross, but there are maybe a few goodies in there for us to twiddle:

To determine exactly which thing each setting refers to look under the name attribute for example: mx35luigi {control.1 is in fact: name 'Capture Volume'.

The type of access this value has is defined as read write for all controls
The complete valid enumeration set is not available with the document.

Setting the default values for some of the things could come in handy.
Some of them have two value attributes. (some, seemingly with duped info.)
Others have more obvious - single - value settings.

The count of expected values is self-described under comment.count
For example: 2

The expected values Types are conveniently self-describing and can be found under comment.type
For example: INTEGER
Where enumerations are used - i.e: ENUMERATED
then a comment.item.[0indexing++] scheme is used:
For example:
comment.item.0 ALC
comment.item.1 Limiter

This is further backed up by a range attribute comment.range
For example '0 - 63'

The interface is shared by all iface MIXER and this more than likely refers to something in the alsa.conf somewhere.

That covers the schema for the document I believe.

So, what does this let us do? well if we have a quick look at the alsactl --help

Code:
Usage: alsactl <options> command

Available options:
  -h,--help       this help
  -f,--file #     configuration file (default /etc/asound.state or /etc/asound.names)
  -F,--force      try to restore the matching controls as much as possible
  -d,--debug      debug mode
  -v,--version    print version of this program

Available commands:
  store <card #>  save current driver setup for one or each soundcards
                  to configuration file
  restore<card #> load current driver setup for one or each soundcards
                  from configuration file
We can see a restoration option is available for the now-amended files with our new make-it-more-awesome values ; )

Next steps?

a)Decide what make-it-more-awesome values we need - if any

b) check the restore doesn't exhibit strange behavior and works as expected.

That about wraps it up for how-to Store and fiddle around.



We can amend the values and using the alsactl restore [blah]
Attached Files
File Type: txt alsactl.state.txt (6.0 KB, 201 views)

Last edited by twobob; 07-18-2012 at 11:16 AM. Reason: added a man ref.
twobob is offline   Reply With Quote