[MOD] Nexus 5 mixer_paths Tweaks - Nexus 5 Android Development

I have been researching and playing around with mixer_paths.xml file in an effort to increase the volume of my phone as well as the gain of the mic.
I would like to share what I have found and open it up to the community.
Location
Code:
/system/etc/mixer_paths.xml
Purpose
The mixer_paths file acts as a audio routing map of sorts. It controls the routing of audio to the various registers on the DAC (Digital-to-Analog Converter). It assigns the registers as well as digital volume levels, digital gain, and analog gain.
Additional Info/References
The Nexus 5 is equipped with the WCD9320 DAC.
Codec source code
Sound Control (faux/flar2)
I am keeping my work and notes here on Github.
Comparing Flar2's implementation of Sound Control (which is based on Faux's Sound Control) it appears that we can accomplish the same volume and gain modifications using mixer_paths.
Does anyone have the datasheet for the WCD9320 DAC?

Related

Stereo sound mod - need help with balancing the volumes

I've recently made a mod for my device managing to enable the earpiece/speakerphone during media playback and turning my phone into a stereo capable device. However, as expected, the earpiece won't sound as loud as the main speaker. I tweaked the gains but it's not enough.
What i am trying to create is a modification that will make a point of intersection where both the earpiece and the main speaker have the same loudness. After that point, the phonespeaker will remain at its maximum volume and the main speaker will keep up with the media volume slider.
There would be one simple way to double the earpiece gain or triple it or finding a certain level that matches the loudness of the main speaker until a certain point but the main issue is that the media volume slider will keep adjusting the loudness of the earpiece, making a lot of distortion afterwards.
I need someone to explain me how to disable media volume control for the earpiece after a certain media volume level, thank you.
Yet another way to satisfy my needs is setting the default volume level of the earpiece to maximum, or at least creating only 2 levels, first which is mute, and the second which is max, no matter the media volume level, i don't know how to do that either.
Bump

Control SPDIF digital out volume

My android system has s/pdif optical out.
I can't control volume when I using optical cable.
In my laptop's Linux, S/PDIF volume is controlled by ALSA and android's kernel configuration is also include alsa.(But cannot control)
Is there any method to control volume?
I have source code and kernel configuration.(So, I can build it)
Thank you very much.
I found that, not only alsa but also pulseaudio is needed for volume control of spdif digital out on linux.
Only alsa cannot control volume of spdif.

In-call volume (speakerphone) and Mic gain using Mixerpath.xml

Hi,
Does anybody here have the knowledge of editing mixerpath.xml for inceasing in-call volume and mic gain and increasing call CLARITY ???
I see that there are multiple mixerpath xmls in system/vendor/etc and also there are multiple "volumes" default value for all is 84.
I wen ahead and cahnged all 84 to 92 but i think thats not how it works.,
Some value is for top mic sensivity for noise cancellation and one is for real bottom mic sensitivity and one if for speaker voilume and one for earpiece volume.
If somebody with the knowledge can be kind enough to let me know what values are what?
TIA
I am months same question to this, a unique way to get and change the custom kernel that has the volume control configurable via the application kernel manager. I wanted to do the same manually in the file mixer xml as well, but it seems that nobody got it, or hides how to do it.

Volume Steps

I find I can't lower the notification volume and ringtone volume low enough.
Does anyone know how to change the volume steps? I have sound assistant but it only works for media volume...
I'm rooted if it helps and I've tried the AOSP based rom solution of changing the build prop but with no success.
Thanks for any help!
Have you tried "sound assistant" app. It is from Samsung and has function you are looking for.
Chaudhry69 said:
Have you tried "sound assistant" app. It is from Samsung and has function you are looking for.
Click to expand...
Click to collapse
If you check the original post you'll have your answer lol
EmRav said:
If you check the original post you'll have your answer lol
Click to expand...
Click to collapse
Ah my bad, don't know how I missed it. It is possible in two ways:
01- Get a custom kernel with volume modification support. I use a Galaxy S7edge with Surround sound, this makes the sound loud and more immersed but it has a drawback. The low threshold of volume is too high same as yours. I usually have a problem with the in-call earpiece audio which is too loud for me. I use MoroKernel and luckily a recent update brought the feature of MoroSound providing fine control over gains of 2-microphones, earpiece, and main speaker. You can also look for a kernel with such features for your device.
02- Manually modifying the sound configuration files. That is a bit difficult but good research with a bit of experimenting will eventually get you there.
Chaudhry69 said:
Ah my bad, don't know how I missed it. It is possible in two ways:
01- Get a custom kernel with volume modification support. I use a Galaxy S7edge with Surround sound, this makes the sound loud and more immersed but it has a drawback. The low threshold of volume is too high same as yours. I usually have a problem with the in-call earpiece audio which is too loud for me. I use MoroKernel and luckily a recent update brought the feature of MoroSound providing fine control over gains of 2-microphones, earpiece, and main speaker. You can also look for a kernel with such features for your device.
02- Manually modifying the sound configuration files. That is a bit difficult but good research with a bit of experimenting will eventually get you there.
Click to expand...
Click to collapse
Any chance you know how to mod the sound config files on an S21? Unfortunately there are no custom kernels yet for the Exynos version
EmRav said:
Any chance you know how to mod the sound config files on an S21? Unfortunately there are no custom kernels yet for the Exynos version
Click to expand...
Click to collapse
Yes, go to /etc/mixer-gains.xml and edit it. Drawback is your device entire volume range will be affected like for media and stuff. One more way and probably the more practical one just hit me.
Find your ringtone and notification tone from /system/media/audio/ or download them from google and use a software like Audacity or Adobe Audition to reduce their volume.
You reduce your phone's volume to the lowest and match pc's volume with it. Then reduce the audio gain in the software until you feel comfortable with it. Export it and use it.
For anyone interested. My solution ended up being the following, with my end goal being too optimize my audio with Dolby and have the volume still be lower (but optimized) on the phone speaker.
I tried a ton of different apps, a few magisk volume steps modules, ViperFX with Dolby and finally I found a good solution.
Turn off the default Dolby stuff on the phone.
Install Dolby Atmos ZTE A2019 PRO for magisk (google it and find it on GitHub).
Reboot.
Install JamesDSP from ZackPTG5's website.
Reboot.
Install Audio Modification library to use Dolby and JamesDSP at the same time.
Reboot.
Create a custom equalizer in Dolby and try max things out as much as possible with it still sounding great.
Open JamesDSP, go to Speaker, set limiter threshold to -5, go to post gain and set it to -10. Turn on the master switch. Leave everything else unless you want to change any Bluetooth or headphone settings. Hide the persistent JamesDSP notification.
Reboot.
Install Audio Compatibility module with all the recommended settings.
Reboot.
Result, Dolby Atmos handles all the audio, increases the volume, applies optimizations system wide. However because volume steps are tricky to change on this phone we are stuck with the phone speaker volume being too loud even on the lowest setting. JamesDSP lowers the volume to the built-in speakers but we still get the Atmos experience we want. Everything else I assume you want to be louder anyway, like Bluetooth and headphones.
Audio Modification Library makes James and Dolby work together.
Audio Compatibility Patch fixes some issues with certain apps not using the sound mods.
Success! You get Dolby Atmos everywhere, but it doesn't max out the phone speaker volume, but it will still max out everything else. Oh and you can also change whatever other settings you want in JamesDSP.

"Absolute" audio output level

As far as I understand, the sound level of any file containing audio, such as music or video files, is defined in the file itself. Thus, setting the sound level effectively changes the percentage of the max sound pressure defined in the file. (Please do correct me if I'm wrong)
My question: Is it possible to set an "absolute" sound level so that the media files being played actually follow that setting? This way there won't be media files which are louder or quieter than others at the same sound level setting.

Categories

Resources