[Request] Speaker balance mod - Nexus 6P Q&A, Help & Troubleshooting

There are a lot of users with uneven speakers, some have even exchanged their phones and still had the same problem with their second device. So I don't see the point in exchanging mine atm.
Using power amp I fixed my issue by panning my sound a little more to my bottom speaker, however this only works when listening to music.
Since the fix for music was so simple, is there anyone that can make a mod to change the phones speaker balance for the whole system?
I tried viper4android which has channel pan, but that setting is not available for phone speakers. Is there any other solution?

jamespat93 said:
There are a lot of users with uneven speakers, some have even exchanged their phones and still had the same problem with their second device. So I don't see the point in exchanging mine atm.
Using power amp I fixed my issue by panning my sound a little more to my bottom speaker, however this only works when listening to music.
Since the fix for music was so simple, is there anyone that can make a mod to change the phones speaker balance for the whole system?
I tried viper4android which has channel pan, but that setting is not available for phone speakers. Is there any other solution?
Click to expand...
Click to collapse
I do not have a 6P, but I still follow especially audio-related posts with interest.
One solution (root required!) would be to first play around with the audio mixer while playing music (or other audio material). First, go here and download the tinymix_lollipop.tar.gz file from the second post. This is the user-space mixer interface that at least on my Nexus 5 also works on Marshmallow. Copy the binary (tinymix) from that archive to, for instance, /system/bin and make executable (permission 755). Once installed, go to a root shell on your phone and execute
Code:
tinymix "Left Speaker Gain" X
and/or
Code:
tinymix "Right Speaker Gain" Y
where X and Y seem to be 20 by default. Carefully (!) change X and Y independently of each other until you find a satisfactory balance. I'd suggest you go one "tick" at a time and initially lower the gain instead of increasing it. Without having looked at the device-specific kernel, I don't know what the range of this mixer control is, but you can find out by issuing
Code:
tinymix "Left Speaker Gain"
Note X and Y that sound good to you and hard-code them, I believe, in the "speaker-gain-default" section of your /system/etc/mixer_paths.xml file and reboot.

chdloc said:
I do not have a 6P, but I still follow especially audio-related posts with interest.
One solution (root required!) would be to first play around with the audio mixer while playing music (or other audio material). First, go here and download the tinymix_lollipop.tar.gz file from the second post. This is the user-space mixer interface that at least on my Nexus 5 also works on Marshmallow. Copy the binary (tinymix) from that archive to, for instance, /system/bin and make executable (permission 755). Once installed, go to a root shell on your phone and execute
Code:
tinymix "Left Speaker Gain" X
and/or
Code:
tinymix "Right Speaker Gain" Y
where X and Y seem to be 20 by default. Carefully (!) change X and Y independently of each other until you find a satisfactory balance. I'd suggest you go one "tick" at a time and initially lower the gain instead of increasing it. Without having looked at the device-specific kernel, I don't know what the range of this mixer control is, but you can find out by issuing
Code:
tinymix "Left Speaker Gain"
Note X and Y that sound good to you and hard-code them, I believe, in the "speaker-gain-default" section of your /system/etc/mixer_paths.xml file and reboot.
Click to expand...
Click to collapse
Thank you so much! this is extremely helpful and seems like it will be a great solution. I'm trying to go through the steps now but just need a little help.
I download tinymix_lollipop.tar.gz, extracted the tinymix file and copied it to system/bin. Then I changed its permissions to 755 to make it executable like you said. Next I tried to use terminal emulator and typed 'tinymix "Left Speaker Gain" 1' just to test it. However it just gives me the error message 'failed to open mixer'. I'm rooted and made the file executable so I'm not sure why it didn't work?

jamespat93 said:
Thank you so much! this is extremely helpful and seems like it will be a great solution. I'm trying to go through the steps now but just need a little help.
I download tinymix_lollipop.tar.gz, extracted the tinymix file and copied it to system/bin. Then I changed its permissions to 755 to make it executable like you said. Next I tried to use terminal emulator and typed 'tinymix "Left Speaker Gain" 1' just to test it. However it just gives me the error message 'failed to open mixer'. I'm rooted and made the file executable so I'm not sure why it didn't work?
Click to expand...
Click to collapse
Before executing tinymix you need to make sure that this particular shell session has been granted root privileges. You need to type
Code:
su
in your terminal emulator to accomplish that. The prompt should switch to #

chdloc said:
Before executing tinymix you need to make sure that this particular shell session has been granted root privileges. You need to type
Code:
su
in your terminal emulator to accomplish that. The prompt should switch to #
Click to expand...
Click to collapse
Yeah its working perfectly now thanks! Just going to play with it a bit till I find settings I'm happy with but this is exactly what I was looking for!
The range is 0-31 so does that mean its safe to put the gain anywhere between those numbers?

jamespat93 said:
The range is 0-31 so does that mean its safe to put the gain anywhere between those numbers?
Click to expand...
Click to collapse
Who knows? I'm guessing things will start to audibly distort at gains higher than 20, maybe even to the point of physical damage at the top end.

Wow guess I'll be leaving it below 20 then, but seriously thanks again!

jamespat93 said:
Yeah its working perfectly now thanks! Just going to play with it a bit till I find settings I'm happy with but this is exactly what I was looking for!
The range is 0-31 so does that mean its safe to put the gain anywhere between those numbers?
Click to expand...
Click to collapse
What values did you end up using? And just to confirm....the top speaker is left?? because my top speaker is way louder than my bottom...so should I increase the bottom "1" or decrease the top speaker "-1". Also I'm assuming you can do a negative gain right?

bsg411 said:
What values did you end up using? And just to confirm....the top speaker is left?? because my top speaker is way louder than my bottom...so should I increase the bottom "1" or decrease the top speaker "-1". Also I'm assuming you can do a negative gain right?
Click to expand...
Click to collapse
Yeah top speaker gain is for the left speaker. The gain is '20' at default and it changes to whatever number you change it to. So to reduce it just change it to any number below 20. I changed my left speaker gain to 16.
Also elemental kernel now has left and right speaker gain controls too.

jamespat93 said:
There are a lot of users with uneven speakers, some have even exchanged their phones and still had the same problem with their second device. So I don't see the point in exchanging mine atm.
Using power amp I fixed my issue by panning my sound a little more to my bottom speaker, however this only works when listening to music.
Since the fix for music was so simple, is there anyone that can make a mod to change the phones speaker balance for the whole system?
I tried viper4android which has channel pan, but that setting is not available for phone speakers. Is there any other solution?
Click to expand...
Click to collapse
How did you install Viper4android and get channel pan? I installed using this http://forum.xda-developers.com/nex...er4android-t3250579/post65464645#post65464645
and the setting seems to be missing!

Related

ALSA on the Nexus 4 (temporary volume control)

Please remember to make a backup image of your phone before experimenting.
============ WARNING!! =============
The highest setting is VERY loud (as I found out) and could potentially rip apart the speaker on your phone!
Exercise extreme caution when using this. You risk permanent damage to your phone and your ears.​
2013-Jan-20
-----------------
Thanks xda-developers members "skvalex" who wrote ALSAMixer and "chdlock" who is helping me figure out
how ALSA is mapping the audio chipset, we can now temporarily adjust the Digital Volume on the Nexus 4.
Unfortunately, the selected volume doesn't "stick" because the audio driver re-writes it every time it re-opens an audio stream.
A stream is usually opened when a music track begins to play so then the digital volume will reset back to default.
We need a kernel developer to modify the audio driver so it opens an audio stream using a user-selected Volume level.
***
If you don't mind setting the volume frequently or just want to try this out here's what you need:
1) Get ALSAMixer from the Play Store. It was updated recently and you need the latest version.
Please consider a donation to the author.
2) You can re-program the audio chipset by editing fields in ALSAMixer. Here is a list of what we can control so far.
Headphones volume:
Left: RX1 Digital Volume (numid=27)
Right: RX2 Digital Volume (numid=28)
Speaker volume:
RX3 Digital volume (numid=29)
Camcorder volume:
DEC6 Volume (numid=39)
Microphone volume:
DEC7 Volume (numid=40)
-----------------------------------------------
old OPs
-----------------------------------------------
2013-Jan-15
----------------
The creator of ALSAMixer updated it to correctly install for Nexus4. (Uninstall removes the app but the ALSA libraries remain on the phone.)
https://play.google.com/store/apps/details?id=com.skvalex.alsamixer&hl=en
Thank you so much!
--------
http://forum.xda-developers.com/attachment.php?attachmentid=1653124&d=1358438577
This is a piped output of "alsa_amixer -c 0 contents" from a stock Nexus 4 (4.2.1)
2013-Jan-13
-----------------
Is anyone successfully running ALSA on their Nexus 4?
If you do please share instructions to do so.
I am on stock 4.2.1(rooted/busybox) and I ran the AlsaMixer from
the Play Store but it doesn't seem to complete the installation.
http://forum.xda-developers.com/sho...ited Edition Kitβ˜…β˜†β˜… | aokp,minco,pa,rasbean |
Shameless promotion
Sent from my Nexus 4
Next you're going to tell me that you want systemd and PulseAudio on your device too, right?
I wiped to stock,
I installed AOKP-jb-mr1-build1,
then Nocturnal 1.4 LE for AOKP
and the ALSAMixer still doesn't work. It installs but I get the same blank screen with no settings.
What am I doing wrong?
I'm not sure what that app is, I just meant that some of the audio mods in the kit ROM referred to ALSA audio libs.
As you can tell I'm not the expert, sorry if that's not what you were referring too
Sent from my Nexus 4
I am looking for a way to control the audio stream parameters in particular the gain of the microphone.
Somebody suggested using ALSA and I'm trying get it going.
-Mindroid- said:
I am looking for a way to control the audio stream parameters in particular the gain of the microphone.
Somebody suggested using ALSA and I'm trying get it going.
Click to expand...
Click to collapse
I have only a Nexus 7, and the SoC is different from the Nexus 4, but look for alsa_amixer (installed by AlsaMixer) from within a console and execute
"alsa_amixer -c X contents" (without the quotes)
where X is one of the card numbers shown in your /proc/asound directory (e.g. card0 [X=0], card1 [X=1], etc). In my case, X=1 is the actual card where (a lot of) values can be set. One of those values is called "ADC Boost Gain"(I guess a programmable analog gain?).
I established a call with CSipSimple and successfully raised that parameter by 24dB in mid-call by executing "alsa_amixer -c 1 cset numid=20 2" [the default value was 0 and each step increases the level by 12dB]
You can query individual parameters by executing alsa_amixer -c X cget numid=Y
YMMV with the Nexus 4. Good luck!
Thank you! This looks really promising.
I only have "card0" aka [apq8064tablasnd].
When trying to execute "alsa_mixer -c 0 contents" I get an error stating that I'm missing
library "libasound.so". Any ideas what could be wrong?
I'm not sure whether libasound.so came with the AlsaMixer app. If it did you may need to copy the library into a system library path, e.g. /system/lib. If not, I could send you the library that I have. I actually forgot whether I found the library somewhere online or whether I cross-compiled it myself...
Sent from my Nexus 7 using xda app-developers app
ALSA on Nexus 4 sound capabilities
ALSAMixer in the Play Store was updated to support Nexus 4. See OP.
---------------------------------------------------------------
The attached file is the output of running
alsa_amixer -c 0
I'm new to ALSA and have trouble figuring out which one is the microphone gain control.
I have installed this app but unfortunately I don't know how to completely uninstall it help please?:thumbup:
..sent from space.
amarb70 said:
I have installed this app but unfortunately I don't know how to completely uninstall it help please?:thumbup:
..sent from space.
Click to expand...
Click to collapse
If I understand correctly the app is just an installer that puts the ALSA libraries on your system.
If you are not using them it probably doesn't matter if they are there or not. You can contact the app creator about it.
-Mindroid- said:
ALSAMixer in the Play Store was updated to support Nexus 4. See OP.
---------------------------------------------------------------
The attached file is the output of running
alsa_amixer -c 0
I'm new to ALSA and have trouble figuring out which one is the microphone gain control.
Click to expand...
Click to collapse
Post the output of
alsa_amixer -c 0 contents
Any labels containing "ADC gain" or "Boost" would be prime candiates
amarb70 said:
I have installed this app but unfortunately I don't know how to completely uninstall it help please?:thumbup:
..sent from space.
Click to expand...
Click to collapse
Restore your back up
Sent from my Nexus 4 using xda premium
alsa_amixer c- 0 contents
chdloc said:
Post the output of
alsa_amixer -c 0 contents
Any labels containing "ADC gain" or "Boost" would be prime candiates
Click to expand...
Click to collapse
Thank you for being so patient with me!
I'm such a Linux noob. It took me forever to figure out that I need 'su' to do anything.
I will update the OP to link to this file.
-Mindroid- said:
Thank you for being so patient with me!
I'm such a Linux noob. It took me forever to figure out that I need 'su' to do anything.
I will update the OP to link to this file.
Click to expand...
Click to collapse
Holy smokes! This is one complicated mixer! And I've seen many.
It may help in narrowing choices down by you capturing another
alsa_amixer -c 0 contents
while you are on a call and look at the diffs. While you do that (being on a call, but don't run anything else that may use audio such as music playback apps) also report the output of
cat /proc/asound/card0/pcm0p/sub0/status
to make sure that phone calls are actually routed through ALSA. Anything but "CLOSED" is good.
I do not have a Nexus 4 so I cannot help trying to find the best parameters for a given application. The app ALSAMixer should help I would think.
Does this program now actually display anything?
chdloc said:
Holy smokes! This is one complicated mixer! And I've seen many.
It may help in narrowing choices down by you capturing another
alsa_amixer -c 0 contents
while you are on a call and look at the diffs. While you do that (being on a call, but don't run anything else that may use audio such as music playback apps) also report the output of
cat /proc/asound/card0/pcm0p/sub0/status
to make sure that phone calls are actually routed through ALSA. Anything but "CLOSED" is good.
I do not have a Nexus 4 so I cannot help trying to find the best parameters for a given application. The app ALSAMixer should help I would think.
Does this program now actually display anything?
Click to expand...
Click to collapse
It's a long shot but if you are in the New York tri-state area I wouldn't mind meeting up and letting you mess around with the Nexus4.
The invitation is open to anyone with ALSA experience. I would love to learn more about it first-hand.
As far as I can tell:
- ALSAMixer installs the ALSA libraries and displays the control set. I tried modifying a value with it and it didn't work.
It's a matter of wrong syntax I think, I will contact the app creator about it.
- Terminal Emulator works. I was able to change the value of "AUX_PGA_LEFT Volume" with the following command:
alsa_amixer cset numid=54 39
I'm not sure what this one does yet but I will investigate later today.
- unfortunately, during a phone call "proc/asound/card0/pcm0p/sub0/status" (playback) as well as
"proc/asound/card0/pcm0c/sub0/status" (capture) report "closed". Earlier I tried recording a voice call from an app
and trying to prepare an audio stream with MediaRecorder.AudioSource.VOICE_CALL throws an exception.
- when recording an audio stream with MediaRecorder.AudioSource.MIC and CAMCORDER
"proc/asound/card0/pcm0c/sub0/status" reports audio stream parameters. I'm attaching the piped output of
"alsa_amixer -c 0 contents" during a voice call, recording with mic and recording with camcorder.
-Mindroid- said:
[...]
- when recording an audio stream with MediaRecorder.AudioSource.MIC and CAMCORDER
"proc/asound/card0/pcm0c/sub0/status" reports audio stream parameters. I'm attaching the piped output of
"alsa_amixer -c 0 contents" during a voice call, recording with mic and recording with camcorder.
Click to expand...
Click to collapse
This is fun...
There is certainly a difference between the "idle" set of parameters you had posted earlier and the ones that you took during a voice call.
I found some good information that explains the parameters here
https://github.com/psykick5/android_device_lge_mako/blob/master/snd_soc_msm_2x_Fusion3
Try to change numid=48 (i.e. 'ADC1 Volume') and numid=40 (i.e. 'DEC7 Volume'); these two parameters should change the microphone level, provided automatic gain control does not compensate for the changes.
(It bothers me, though, that the range of values shown by alsa_amixer and the ones shown in the above link don't match)
Make sure that the changes stick by issuing
alsa_amixer cget numid=X
For phone calls I would certainly change numid=65 (i.e. 'TX6 HPF cut off') from 0 (apparently really only a DC offset filter) to 2 (apparently a high-pass filter with a cutoff frequency of 150Hz), which would be good enough for HD voice.
chdloc said:
This is fun...
There is certainly a difference between the "idle" set of parameters you had posted earlier and the ones that you took during a voice call.
I found some good information that explains the parameters here
https://github.com/psykick5/android_device_lge_mako/blob/master/snd_soc_msm_2x_Fusion3
Click to expand...
Click to collapse
Great find! This seems to be exactly what we need.
Most intriguing there are also facilities for Voice Call and FM Radio audio streams. Those are not currently working on
the Nexus4 at the moment and this might shed some light on a possible solution.
I find some of their nomenclature confusing. They use "TX" for recording and "RX" for playback.
Also they seem to set values twice - :1:0 for turn off and :1:1 for turn on. Do I have to issue commands twice?
I confirmed with 'cget' that I am indeed setting values with 'cset'.
chdloc said:
Try to change numid=48 (i.e. 'ADC1 Volume') and numid=40 (i.e. 'DEC7 Volume'); these two parameters should change the microphone level, provided automatic gain control does not compensate for the changes.
(It bothers me, though, that the range of values shown by alsa_amixer and the ones shown in the above link don't match)
Make sure that the changes stick by issuing
alsa_amixer cget numid=X
Click to expand...
Click to collapse
It seems that DEC7 controls to the MICROPHONE stream and DEC6 the CAMCORDER.
I will focus my attention on these.
chdloc said:
For phone calls I would certainly change numid=65 (i.e. 'TX6 HPF cut off') from 0 (apparently really only a DC offset filter) to 2 (apparently a high-pass filter with a cutoff frequency of 150Hz), which would be good enough for HD voice.
Click to expand...
Click to collapse
I was wondering about that myself. There is very bad low frequency noise on video recordings so I will
definetly look into this.
-Mindroid- said:
I find some of their nomenclature confusing. They use "TX" for recording and "RX" for playback.
Click to expand...
Click to collapse
Actually, the nomenclature is quite common, TX, i.e. transmit [to the network] denotes the signal to be transmitted (taken from from microphone)
while RX is the receive signal [from the network] to be played back through a loudspeaker.
-Mindroid- said:
Also they seem to set values twice - :1:0 for turn off and :1:1 for turn on. Do I have to issue commands twice?
Click to expand...
Click to collapse
No, you will have to issue the command only once. Without having looked at the underlying code I tend to think that the first number denotes the type, i.e. integer vs string, and the second number the actual value.
Another interesting observation is that the SoC of the Nexus 4 seems to support SRS TruMedia via an effects mixer, which reportedly has potential to improve audio considerably (http://www.srstechnologies.com/content.aspx?id=1269 , I believe).

How to improve audio with Viper4Android (Root required; tested only on Lollipop)

The other day I went looking for an audio DSP to use on my Shield Tablet running Lollipop. I came upon some posts recommending "Viper4Android" and went looking for a away to install it.
Here's my instructions, adapted from this article: http://www.droidviews.com/guide-viper4android-make-work-lollipop-lrx21o/
Download "TestLolliViPER_v2.3.3.0.zip" from this post (pre-Lollipop users can download ViPER4Android FX from the official thread and install the APK, skip ahead to step 5)
Change to permissive mode with SELinux Mode Changer from the Play Store (required for Lollipop, maybe for KitKat too)
Enable developer options and uncheck "Use Nuplayer" (Lollipop only)
Reboot to recovery and flash the zip you downloaded; reboot back to Android
Open Viper4Android and let it download its drivers (reboot required)
Open Viper4Android and under settings switch "FX Compatible" mode to "Compatible"
FX compatibility mode caused most apps to not use V4A. Leave it on the "Normal" setting instead.
Specific apps:
For PowerAmp, enable MusicFX under Settings > Audio > Advanced Tweaks, turn on "Tone/Volume". Also, switch off the Equ, Tone and Limit under Tone/Volume
For GoneMad Music Player, select "Use External DSP" under Preferences > Audio > Equalizer
Spotify appears to just work now.
Effects:
Turning on "Speaker Optimization" makes the Shields' speakers sound less tinny
Try some IRS files to imitate/replicate various bass boost, etc effects from various manufacturers
Alternatively, try some headphone correction filters (these attempt to flatten the frequency response of your headphones, making music sound the way musicians really intended it to sound)
See also the explainations for all of the settings.
I hope this works for other people. Tell me if I've made a mistake or left something out.
Thanks! will give this a try soon, what about boosting volume? I haven't seen anything for boosting volume yet in lollipop
Folks will discover this after clicking the first link: this solution requires Root. I've heard great things about Viper, and if you have your device unlocked and rooted, give it a go.
jaredmorgs said:
Folks will discover this after clicking the first link: this solution requires Root. I've heard great things about Viper, and if you have your device unlocked and rooted, give it a go.
Click to expand...
Click to collapse
Oh right, thanks for that. I keep forgetting that not everyone has root access and a custom recovery
And even though I've been reading XDA for years, I've only written a few posts.
genicles said:
Thanks! will give this a try soon, what about boosting volume? I haven't seen anything for boosting volume yet in lollipop
Click to expand...
Click to collapse
Yes, there is the "Extra Loud" option, with three strength levels.
Does this method work with Spotify? I don't think you can change audio settings via the app and don't these V4A instructions only apply on an app by app basis?
I've tried this and it doesn't appear to have any effect on the sound on my shield. Followed instructions exactly but makes no difference to sound quality regardless of what player I use.
Sent from my SHIELD Tablet using Tapatalk
mossief1965 said:
I've tried this and it doesn't appear to have any effect on the sound on my shield. Followed instructions exactly but makes no difference to sound quality regardless of what player I use.
Sent from my SHIELD Tablet using Tapatalk
Click to expand...
Click to collapse
Try playing with the settings--specifically the NUplayer toggle and the settings in PowerAmp (if you're using it). In most guides for Lollipop for V4A, it says to turn off NUplayer. But for some reason, on my other device (a G3 with CM12), I need NUplayer on. I don't have to use compatible mode on it either.
It's a stretch, especially since the OP tested his steps on this device, but I don't think it'll hurt.
sixstringedmatt said:
Does this method work with Spotify? I don't think you can change audio settings via the app and don't these V4A instructions only apply on an app by app basis?
Click to expand...
Click to collapse
I just had a try with Spotify and it seems to work with no changes required. It even opens V4A when selecting 'equalizer' in settings, so it appears to be quite aware of external DSPs.
Soundscape also has no settings for audio, but doesn't go through V4A. I don't know what to do about that, besides complaining to the company.
Sent from my SHIELD Tablet using XDA Free mobile app
... making music sound the way musicians really intended it to sound ...
Click to expand...
Click to collapse
There is so much wrong with that I don't know where to start LOL (but this is not meant to be any sort of observation on the app itself).
But ya know, whatever sounds good in the end
diji1 said:
There is so much wrong with that I don't know where to start LOL (but this is not meant to be any sort of observation on the app itself).
But ya know, whatever sounds good in the end
Click to expand...
Click to collapse
I was referring to Beat's claim that their bass-heavy headphones make your music sound the way the musicians wanted it to. Tyle from Inner Fidelity (who has tested many headphones with a pretty sophisticated setup) has said:
I would think most recording studios in the world use a curve called "flat." That way they know what they're hearing on the monitors is what's going onto the disc. The Audio Engineering Society is filled with engineers who write papers and learn about how to achieve a flat and neutral audio response, and then design and build the gear that goes into recording studios. I've measured four of the Beats full-size headphones, and a handful of their in-ear models, and they deviate significantly from flat.
Click to expand...
Click to collapse
The headphone correction files I linked to attempt to flatten the response of each headphone, making them sound more like professional-grade studio monitors (speakers) or headphones.
The V4A mod sounds great, but it seems to break streaming audio to the Shield Controller.
after Ota 3.1 upgrade Viper is not working anymore

[Q] How to increase speaker volume in LOLLIPOP?

anyone know?
jogson said:
anyone know?
Click to expand...
Click to collapse
Its impossible to change hardware of devices but there are many equalizer software (Like DSP manager)& many 3rd party Music player that helps to increase little bit volume.
in kitkat i was able to change by changing the permission in root file
jogson said:
anyone know?
Click to expand...
Click to collapse
The procedure is the same as it was for KITKAT.
go to system > etc > mixer_paths.xml.
grant permissions.
open using editor and change all values to 88.
Only for RX3 Digital Volume, chnage the value to 91.
Save and you are done.
Please note that you need to be rooted.
Hardware can't be tweaked simply. U can also increase the speaker volume by rooting there are many apps which do the same. But I think that u shouldn't do that since this may hamper the speaker and other hardware bcuse the low speaker is due to some reason. But tweaking it just a lil bit is an okay job
Regards

[SOLVED] Volume control--USB Audio

SOLVED!!!! See post #25.
I am going to test this, for sure. If it indeed works, which I am very confident it will, you're going on the Important Links list.
Tested it, multiple times. Your steps did not work for me.
What does work, though, is this:
- Plug in OTG cable, set in Host mode.
- Plug in audio device.
- Open AudioCtl. Hit "Beep".
- Unplug audio device.
- Open ES Task Manager. Open Volume.
- Set "Media" meter to whatever you like.
- Plug audio device back in.
- Open AudioCtl. Hit "Beep".
Good to go.
Trying to track down volume adjustment
I've been thinking about the volume adjustment as described above and wondering if it could not be examined to reveal what is going on behind the scenes with a view to incorporating those changes into either Renate's AudioCTRL app or my one-touch USB Audio app--or both. My Android knowledge is, however, very basic.
I've attached a logcat session (including everything...) which begins with the usual sequence for enabling USB audio on a freshly booted NST. There's a lot to wade through, much of it irrelevant--even I can tell that. The beginning of the actual volume adjustment operation can be found by text searching for "Removed device", which is where the USB Audio gizmo is disconnected from the OTG cable while Task Manager is used to adjust the volume (as described in the post above). The logcat ends with the disconnection of the OTG cable and termination of USB host mode.
I've begun looking over this in hopes of seeing something that indicates what is different when AudioCTRL is invoked the second time to see if the volume is indeed no longer ear-splitting. Maybe there is something there, and maybe there is a better log to look at.
Any suggestions/help/joiners?
nmyshkin said:
I've been thinking about the volume adjustment as described above and wondering if it could not be examined to reveal what is going on behind the scenes with a view to incorporating those changes into either Renate's AudioCTRL app or my one-touch USB Audio app--or both. My Android knowledge is, however, very basic.
I've attached a logcat session (including everything...) which begins with the usual sequence for enabling USB audio on a freshly booted NST. There's a lot to wade through, much of it irrelevant--even I can tell that. The beginning of the actual volume adjustment operation can be found by text searching for "Removed device", which is where the USB Audio gizmo is disconnected from the OTG cable while Task Manager is used to adjust the volume (as described in the post above). The logcat ends with the disconnection of the OTG cable and termination of USB host mode.
I've begun looking over this in hopes of seeing something that indicates what is different when AudioCTRL is invoked the second time to see if the volume is indeed no longer ear-splitting. Maybe there is something there, and maybe there is a better log to look at.
Any suggestions/help/joiners?
Click to expand...
Click to collapse
Have you made any more progress on this volume adjustment problem?
The ES Task Manager's volume setting doesn't do anything more than what I can do with the hardware volume control on the USB Audio adapter.
My solution at the moment is to use some low-efficiency earbuds/headphones.
digixmax said:
Have you made any more progress on this volume adjustment problem?
The ES Task Manager's volume setting doesn't do anything more than what I can do with the hardware volume control on the USB Audio adapter.
My solution at the moment is to use some low-efficiency earbuds/headphones.
Click to expand...
Click to collapse
Unfortunately it seems beyond my skill and no one else seemed interested in tackling it. This leads me to believe that either not many people use the audio capability (maybe for this reason?!) or they just found other methods that "worked" for them. In searching for something--anything--that would make the volume other than full on I thought I had the solution several times and that suggests to me--along with your experience with ESTM--that the behavior is almost device idiosyncratic. That's a scary thought.
That said, I hope you'll give the ESTM another try. It works wonderfully well for me and provides full range volume control from a whisper to blasting using the native android controls as well as external buttons. I have two USB audio devices, one with volume buttons and one without. Both work equally well with this method, but you do have to follow the procedure exactly:
1. Set up your USB audio device in the usual way, using Renate's two apps (you can also use my one-touch app--must be version 3--to set the volume this way).
2. Remove the USB audio device from the cable (do not detach the OTG cable from the NST)
3. Open ESTM and access only the quick menu (three bars at the top left)
4. Select volume adjust.
5. Adjust only the media volume to something on the order of 60%--don't diddle with this. One adjustment. If you do too much you can cause a reboot.
6. Close ESTM
7. Reattach the USB audio device.
You should be good to go at that point until your next cold or warm boot and unless you're working on your system, that can be a very long time with the Nook ST! It doesn't matter that you get in and out of USB mode. Something in that hoo-doo process sets a flag or pushes an unruly gaggle of electrons around in the system so that the volume control works as it should. I only wish I knew what it was!
Just in case, the version of ESTM I am using is 1.4.2 (attached below).
nmyshkin said:
...
but you do have to follow the procedure exactly ...
...
Click to expand...
Click to collapse
That did the trick!!!
I think I had previously skipped the step of removing the US Audio adapter ...
Can you post the link to your one-touch app?
Tx.
digixmax said:
That did the trick!!!
I think I had previously skipped the step of removing the US Audio adapter ...
Can you post the link to your one-touch app?
Tx.
Click to expand...
Click to collapse
Good! I hate kludges, but this one does actually work
Here's the one-touch app.
nmyshkin said:
Good! I hate kludges, but this one does actually work
Here's the one-touch app.
Click to expand...
Click to collapse
Thanks.
Now, if your one-touch app can finagle the volume control I'd be in heaven and go stocking up a few more NSTs
digixmax said:
Thanks.
Now, if your one-touch app can finagle the volume control I'd be in heaven and go stocking up a few more NSTs
Click to expand...
Click to collapse
Amen to that, brother--from your fingertips to the terminal screens of those who can do it. It's the last piece of the audio puzzle and it would be a shame not to complete the work.
digixmax said:
Thanks.
Now, if your one-touch app can finagle the volume control I'd be in heaven and go stocking up a few more NSTs
Click to expand...
Click to collapse
Oh....I'm so close!!!!! I can write a little volume setting app to use after the USB Audio toggle (or the standard method). Like the kludge above the adjustment is persistent until a reboot but you don't need ES Task Manager.
What I can't do (yet) is combine the volume adjustment with the USB Audio toggle
I need to consult the Tasker experts for a workaround. In the meantime I'll get the app posted later today after a little more testing.
Edit: Ugh. Or maybe not. The app causes a reboot.... Still working on the problem.
nmyshkin said:
Oh....I'm so close!!!!! I can write a little volume setting app to use after the USB Audio toggle (or the standard method). Like the kludge above the adjustment is persistent until a reboot but you don't need ES Task Manager.
...
Click to expand...
Click to collapse
Not having to navigate through ES Task Manager to get to its Volume tab is a significant improvement.
Does your app still entail the ritual of disconnecting/reconnecting the audio adapter?
digixmax said:
Does your app still entail the ritual of disconnecting/reconnecting the audio adapter?
Click to expand...
Click to collapse
I'm afraid so but that is rather moot since I've run into the reboot problem. I'm not giving up, though :fingers-crossed:
tiny "progress"
Oy. This really needs someone who can understand all the stuff thrown out in the logcat.
But...I have made one discovery that tames (not controls) the ALSA volume. In the master ALSA configuration file at /system/etc/asound.conf there are three instances of Speaker Volume of one kind or another. All three are set to the maximum (150 for each channel). Although the minimum is supposed to be 0, anything lower than 4 effectively mutes the sound card. Reducing the setting to 4 may make some headphones usable without the kludge described earlier. You can do this with a simple text editor, either on the device, or pull the file to your computer, edit and put it back. A reboot is needed for this to take effect even though ALSA documentation says this file is always read anew when a device is detected.
If you want to see whether this is even worth the trouble and you have adb access, you can fire up the USB Audio (without the kludge) and send the following shell command:
Code:
adb shell alsa_amixer -c 1 set Speaker 4
The volume change will be instantaneous but not permanent. For that you need to make the change in the asound.conf file.
The real issue, of course, is that without the mysterious beneficial effect of the kludge, the native android volume control has no effect on either actual media volume OR the ALSA volume. When the kludge is used there is still (I believe) no effect on the ALSA volume but the native volume control is able to take the static value of the ALSA volume and decrease it, thus giving the effect of a volume control.
I think this is correct because when the asound.conf file is edited as described above, the maximum android volume is less than the earsplitting level when the ALSA controls were set to their maximum (150).
In any case if you query the ALSA volume post-kludge it's clear that the android media volume setting is having no effect on the ALSA value which remains whatever is specified in asound.conf
Therefore part of the problem is that rather than controlling the ALSA volume, the native android volume control overlays the constant ALSA value.
OK, I admit I wrote most of that to clarify the issues in my own mind. Maybe someone will get another idea. I've Googled every search string I can think of and have only learned to tinker a little with ALSA commands. But the real mystery is in the android system and what the logcat shows.
nmyshkin said:
...
OK, I admit I wrote most of that to clarify the issues in my own mind. Maybe someone will get another idea. I've Googled every search string I can think of and have only learned to tinker a little with ALSA commands. But the real mystery is in the android system and what the logcat shows.
Click to expand...
Click to collapse
@nmyshkin:
You solved the mystery!!!
Following the lead in your PM, I re-enabled Phone.apk (which many of us had disabled to conserve battery) and now volume-control using my USB Audio adapter's volume-button works like a charm.
digixmax said:
@nmyshkin:
You solved the mystery!!!
Following the lead in your PM, I re-enabled Phone.apk (which many of us had disabled to conserve battery) and now volume-control using my USB Audio adapter's volume-button works like a charm.
Click to expand...
Click to collapse
LOL--I hope you are correct, but there seems to be a devil in my details. I now cannot get it to work using my one-touch toggle app, but it does seem to work with the standard 2-app setup. What seems to fail using my app is that mediaserver is not killed (maybe it's just wounded....). So I'd be curious to know if this continues to work for you, even after a reboot. I thought I had it all sewed up until a reboot showed me otherwise.
When I found the PID for mediaserver as @Renate NST instructed in order to replicate the function of her AudioCtl app, I may have oversimplified things too much. Not knowing much, I just assumed the PID was constant. So I wrote the value I found (19409) into my app. But now that I am having trouble, I find that this:
Code:
adb shell ps
which lists the PID values for apps and processes gives something quite different for /system/bin/mediaserver (1818 right now).
So.....Renate's app continues to work and I'm guessing that's because it queries the PID value before killing mediaserver. I can't say that enabling the Phone.apk has changed the PID value for mediaserver, but there are a whole lot of processes listed now that it's back compared to when I checked PIDs before.
So as a "proof of concept" I just edited the Tasker task from which my one-touch app was produced, changing the PID value to 1818. That worked like a charm.
Next I ran the one-touch app again andthis time it worked. I guess I'm showing my ignorance (yet again) but that does not make sense. I'm betting that if I reboot something different will happen.
........
OK, so on a reboot I get a PID of 978 for /system/bin/mediaserver and (not surprisingly) my one-touch app does not work. And now Renate's 2-step method hangs up on the AudioCtl app. Another check of the PID via adb shows it has changed to 2263.
I'd be very curious to know how your device behaves after a reboot. Mine's a mess (as far as this audio stuff goes---everything else is fine).
This morning it occurred to me that my one-touch toggle app might just be corrupted. I've really put my poor NST through the wringer the past few weeks working on this problem
So I uninstalled it and put on a fresh copy. It worked on the first try
I'm hoping your experience is the same. If so I'll monitor the power issue for a week and then write a summary post and call this "solved".
Edit: Or not. After a reboot the one-touch toggle app again failed to work. What does seem to work consistently is using Renate's two apps for the first time after a reboot. Thereafter, for some reason known only to Heisenberg (and maybe Renate), the one-touch toggle app successfully sets up the USB Audio with proper volume control. Until another reboot. I need to contact Renate.
nmyshkin said:
LOL--I hope you are correct, but there seems to be a devil in my details. I now cannot get it to work using my one-touch toggle app, but it does seem to work with the standard 2-app setup. What seems to fail using my app is that mediaserver is not killed (maybe it's just wounded....). So I'd be curious to know if this continues to work for you, even after a reboot. I thought I had it all sewed up until a reboot showed me otherwise.
Click to expand...
Click to collapse
Sorry I should have been clearer: I have not gotten around to try your one-step app yet, as I want to make sure I don't introduce more variables into my mysterious "loss of sound" problem (as I described in my PM). So what work for me so far (fingers crossed as I am starting to lose faith in Bacon's principles ) is Renate's two step-process.
When I found the PID for mediaserver as @Renate NST instructed in order to replicate the function of her AudioCtl app, I may have oversimplified things too much. Not knowing much, I just assumed the PID was constant. So I wrote the value I found (19409) into my app. But now that I am having trouble, I find that this:
Code:
adb shell ps
which lists the PID values for apps and processes gives something quite different for /system/bin/mediaserver (1818 right now).
Click to expand...
Click to collapse
Yes the PID for a Linux-type OS process is not deterministic (except for the one and only "init" process which has PID of 1). You can find the PID of a currently running process with the command pipe "ps ax | grep <process-name>" (but I have no idea if/how you can make use of this from inside your app).
So.....Renate's app continues to work and I'm guessing that's because it queries the PID value before killing mediaserver. I can't say that enabling the Phone.apk has changed the PID value for mediaserver, but there are a whole lot of processes listed now that it's back compared to when I checked PIDs before.
Click to expand...
Click to collapse
Yes, I now see the old familiar "Cell Idle" process topping the battery-usage list .
digixmax said:
Sorry I should have been clearer: I have not gotten around to try your one-step app yet, as I want to make sure I don't introduce more variables into my mysterious "loss of sound" problem (as I described in my PM). So what work for me so far (fingers crossed as I am starting to lose faith in Bacon's principles ) is Renate's two step-process.
Yes the PID for a Linux-type OS process is not deterministic (except for the one and only "init" process which has PID of 1). You can find the PID of a currently running process with the command pipe "ps ax | grep <process-name>" (but I have no idea if/how you can make use of this from inside your app).
Yes, I now see the old familiar "Cell Idle" process topping the battery-usage list .
Click to expand...
Click to collapse
Thank you for that helpful info about the PID. I'll see what I can do with it. It does not explain how the one-touch app worked before the phone.apk was awakened nor how it works after the 2 step method has been used once. But it's a start.
I installed a battery app today to keep an eye on things but it's showing me the "dialer" as consuming only 0.8% of the battery usage. I may not have access to what I need to know with this particular app.
digixmax said:
...
You can find the PID of a currently running process with the command pipe "ps ax | grep "...
Click to expand...
Click to collapse
Apparently the ps command in Android behaves a bit differently than its Linux counterpart, there is no need for the "ax" option stuff.
Instead, this command pipe
Code:
ps | grep phone | tr -s ' ' | cut -d ' ' -f 2
(note the single blank between the two single quotes as value for the -s and -d options) will yield the PID for the phone process.

G900F mixer_paths.xml RECORDINGS (Whatsapp) are far to low, as well as the speakers?!

Dear folks,
I used to search this and other forums for an easy solution to increase the volume level of my Galaxy S5 (G900F) in both directions, to mic something and for listening. I do not care of speakers (to destroy them) or my ears (they are already in bad status since the DISCO-Beats in early 90ties), smile, but I hate to anoy my friends with to low volume messages (even when I am at home with no background sounds). In the car it is even worse. My phone is rooted. Android 8.1.0 Extend Version AospExtended-5.4-unofficial, 2018-April-05, G900FXXU1CPC9, with Kernel 3.4.113-lineageos-g808bf80, Build-Number OPM2.171019.029, Moderate
I have downloaded and testet micgain26higher.zip, micgain26normal.zip, Mic_Gain_Mod_v11.9.zip, and s5_Volume_Boost_Version_vX...zip
None of it works.
I even extracted / copied the three files from container to /etc, with no positive result.
I tried to increase the numbers within mixer_paths.xml by hand, no improvements.
Please give me a solution (preferable a ready made mixer_paths.xml to copy/paste).
Thanks.
I think there is no solution - mine is loud for me, but my mic level is poor. I expect nobody is good enough to help you here.
Copy the mixer_paths.xml that i have attached to "/vendor/etc" and change permissions to "rw- r- r-". (ps : i think it is not necessary to change permissions anymore but just in case you can try)
For me it works on recording audio
The guy in this thread.....
http://forum.xda-developers.com/showthread.php?t=3202087
Knows a *lot* about adjusting the xml file to make adjustments to various volume level parameters. He was able to give me a lot of help when I needed it. Why not ask in that thread.
Sent from my SM-G900F

Categories

Resources