[Nook Touch General] nmyshkin:
Summary of USB audio volume control methods

So finally, here it is :D

There are two avenues for taming the audio volume produced by the typical C-type USB adapter. The first is setting the maximum media volume. This is the ALSA setting found in the system/etc/asound.conf file:

defaults.ctl.card 1
defaults.pcm.card 1
defaults.timer.card 1

ctl.AndroidOut
{
type hw
card 1
}

ctl.AndroidIn
{
type hw
card 1
}

pcm.AndroidPlayback
{
type hooks
slave.pcm
{
type hw
card 1
device 0
}
hooks.0
{
type ctl_elems
hook_args
[
{ name 'Speaker Playback Switch' value on }
{ name 'Speaker Playback Volume' value [[COLOR="Red"]150 150[/COLOR]] }
]
}
}

pcm.AndroidPlayback_Speaker
{
type hooks
slave.pcm
{
type hw
card 1
device 0
}
hooks.0
{
type ctl_elems
hook_args
[
{ name 'Speaker Playback Switch' value on }
{ name 'Speaker Playback Volume' value [[COLOR="Red"]150 150[/COLOR]] }
]
}
}

pcm.AndroidPlayback_Speaker_normal
{
type hooks
slave.pcm
{
type hw
card 1
device 0
}
hooks.0
{
type ctl_elems
hook_args
[
{ name 'Speaker Playback Switch' value on }
{ name 'Speaker Playback Volume' value [[COLOR="Red"]150 150[/COLOR]] }
]
}
}

pcm.AndroidCapture
{
type hooks
slave.pcm
{
type hw
card 1
device 0
}
hooks.0
{
type ctl_elems
hook_args
[
{ name 'Mic Capture Switch' value on }
{ name 'Mic Capture Volume' value 12 }
{ name 'Mic Playback Switch' value on }
{ name 'Mic Playback Volume' value 20 }
]
}
}

I have indicated in red the three places where the max. volume setting is made. The current value (150) is as loud as the adapter can get (which has always been part of the problem). My experiments indicate that you can reduce this value to as low as 4 (that's about -28 dB). Below that my adapter cuts out altogether. For my earbuds (and my ears) I find that just barely comfortable. But if you have low efficiency headphones that you are partial to, you may want a larger value. Or, if you sometimes plug the NST into powered speakers, a higher value might mean less background noise. I do this to listen to a time-shifted NPR program from another State. I have my values set to 50.

In any case, there is no reason why the max. should be set at 150. It can't improve the power consumption of the device. The file is simple text and can be edited right on the NST or you can pull it off, edit, then return. A reboot will ensure that the changes are recognized.

So although the ALSA volume can be altered on the fly (via ADB) we don't have any software for doing this conveniently and even if we did, we can only get down to the barely comfortable value of 4 before muting the adapter. When the system android volume control is working the ALSA volume setting becomes the maximum volume (i.e., 15) on the slider scale.

Which brings us to avenue two: control of the android volume. Credit is due here to [MENTION=4474482]Renate NST[/MENTION] because it was she who mentioned in the very long original USB Host thread that manipulating the system volume control seemed to call the phone.apk (which she had long since removed). After many a twist and turn and just about every conceivable wrong idea, I decided to look into this statement.

Most of us have the system/app/phone.apk either deleted or disabled. There is lore on this site going way back to the early days of rooting the NST that this app is a power hog. Maybe. One could also say that USB Host is a power hog, but of course it does not run constantly, unlike the phone.apk.

Anyway, it turns out that the problem is that simple to solve. Re-enable the phone.apk (or put it back if you deleted it), reboot and voila, you have control over the android volume. No more skull-cracking audio (unless that's the way you like it).

There

may

be other dependencies. None of the "TTS" apps are needed. So far I have not noticed huge power drain, but that could be due to the kernal I'm using, or the CPU regulation, or the alignment of the planets. I'll report back on the power issue after I've had more time to observe it.

Edit: the result of my study of phone.apk and power usage is here.

This works with the classic [MENTION=4474482]Renate NST[/MENTION] two-app method for setting up USB Audio. If you are using my USB Audio one-touch toggle app, you need to upgrade to version 3 for this to work.

Deleted your phone.apk and want to try this out? Here's a copy.