yashsingh1/xdaforums huggingface dataset:
[Google Pixel XL Themes, Apps, and Mods] chdloc:
I would not say it's impossible. You could use further Tasker trickery to detect when the Alarm app is in the foreground (easy) and active, i.e. playing sound (a little more difficult). Increase the volume with tinymix if both conditions are met.
[Google Pixel XL Themes, Apps, and Mods] louis-JYG4t:
I think I found a way to do it, although I'll have to research for a bit on how to achive it.

First I'll modify the mixer_paths.xml so that the right channel (main speaker) plays at full capacity (so way louder than the earpiece).

I'll detect if stereo speaker mode is usefull (screen on and maybe landscape mode, I don't know yet if I'll include that last one) and if no headphones/bluetooth audio devices/etc are connected.

1. If a video is playing and no headphones/bluetooth audio devives/etc are connected (both conditions are fullfilled), I'll adjust the ballance towards the left channel (earpiece) so that the speaker volume lowers to match the earpiece volume.

2. If stereo speaker isn't usefull (like when listening music with screen off or allarm etc) and no headphones/bluetooth audio devices/etc are connected, I'll keep the ballance standard so the main speaker plays at full volume. I'll also activate mono sound if this is the case, so that the sound of both the channels of stereo recorded music sound as loud.

3. If headphones/bluetooth audio devices/etc are connected, nothing has to happen (keep ballance standard and don't activate mono sound).

Adjusting ballance and activating mono should be possible and don't even require root, as poweramp is able to do it (I also manually tested the 3 cases above using poweramp). Appart from poweramp, there are virtually no equalizers that offer these 2 features, so the mod will be compatible with most equalizers.

There's also an exposed module to manage left/right channel ballance and viper4android also offers this feature if I'm not mistaking. So maybe there's an option to do this on system level if my app/service gets installed as a system app.

This is all just theoretically though. The hard part will be to actually implement it. I haven't seen any option in tasker, nor with a tasker plugin yet to controll the channel ballance or activate mono sound....
[Google Pixel XL Themes, Apps, and Mods] chdloc:
Poweramp can do this because it has control over the actual audio data. Tasker does not. There is a remote chance you can do what you are envisioning with Tasker's powerful "Code->Java Function" framework, but only if the proper API is exposed. Otherwise you would be back to having to dynamically modify the mixer itself.

I think your best bet would be to go the custom kernel (with audio control) route.
[Google Pixel XL Themes, Apps, and Mods] louis-JYG4t:
How about the exposed module and viper4android? How can they do it?
[Google Pixel XL Themes, Apps, and Mods] chdloc:
Those mods inject themselves more deeply into the system and/or replace system libraries. I've never really looked at how they work exactly since I'm not really interested in modifications that potentially (further) compromise system stability and/or security.
[Google Pixel XL Themes, Apps, and Mods] louis-JYG4t:
Okay. Thanks for all this information!
[Google Pixel XL Themes, Apps, and Mods] [Gorgasm]:
Hi !

It seems that the new Oreo update break this mod. Indeed, the mixer_paths.xml and media_profiles.xml move to vendor/etc. Do you think that it is feasable to update this mod to Oreo ? Thanks :)
[Google Pixel XL Themes, Apps, and Mods] chdloc:
Absolutely. I already have all three mods working on my phone running Android Oreo. Please give me a few days to finish up the installer.
[Google Pixel XL Themes, Apps, and Mods] chdloc:
Android Oreo update

Android Oreo update available in the OP.

As of now I've only ported the "ull" version, which means that only the main loudspeaker is playing when the ultra-low latency use-case is requested by an app.

Let me know if you'd like me to port the "no ull" version as well in which both loudspeakers play even when the ultra-low latency use-case is requested, but under the hood ultra-low latency is re-routed to the low-latency use-case.

As a heads-up, Oreo introduced a new use-case, i.e. memory mapped ("mmap") playback, which would need additional hacks to work with both loudspeakers. However, I have not yet come across an app that requests the mmap use-case, so I cannot test this scenario.

NOTE: the Android Oreo version of the mod assumes the presence of the new SBIN variant of SuperSU, see here. This mod will likely not work with Magisk.
[Google Pixel XL Themes, Apps, and Mods] siddhesh.raikar:
Hey, the media profiles file is named incorrectly in the script and the folder. The actual name is media_profiles_V1_0.xml and the name in the install folder and the script is media_profiles_V1.0.xml

Edit: BTW, any idea how to get hevc going on the Pixel. Everytime I change the code in the media profiles file, video camera recording just throws up and error.
[Google Pixel XL Themes, Apps, and Mods] chdloc:
Indeed! Thank you for the bug report. A new archive has been uploaded to the OP, i.e., chdloc_hardware_audio_mods_pixel__ull_oreo_september7.tar.gz

Only folks who installed a version of the mod that enabled stereo recording would need to install this new/updated mod.

I'm not a video expert, but after poking around the Pixel's file system I only found the H.265 (software) decoder, but not the encoder. So unless the encoder is implemented in hardware (GPU and/or DSP), it may be missing from the Pixel's software stack which would explain the issues you've been seeing. Did you examine the logcats and potentially the kernel messages while trying to enable HEVC?
[Google Pixel XL Themes, Apps, and Mods] chdloc:
According to the audio HAL source code, the hardware latency numbers associated with the different audio playback use-cases are

deep buffer: 29 ms

low latency: 13 ms

ultra-low latency: 3 ms

memory mapped: 3 ms

Latency does not affect audio quality and is of no consequence in music playback scenarios. Very low latency is desirable in full-duplex scenarios (for instance telephony and VoIP), audio monitoring, music creation software, gaming, and VR/AR.

When you say "audio quality" do you mean subjective quality or objective quality (which I call "audio fidelity")?

If you are referring to objective audio quality, I shared some measurements soon after receiving my Pixel XL last year. Audio fidelity is largely dictated by the hardware itself. The only thing you could do to measurably (but not necessarily audibly) change anything is to trade off digital and analog gain. In general you want digital gain set to be close to 0 dB and control overall volume in the analog domain. For this, though, you would need to adaptively modify the appropriate gains in the mixer, which is non-trivial. [MENTION=281070]bjrmd[/MENTION] came up with a nice solution here, which I believe currently does not work on the Pixel, however.

If you are referring to subjective audio quality then I personally believe you don't need anything but a good-quality EQ to tweak the sound signature of your headphones to your liking. I developed biQuads, which is part of this mod, for this very purpose.

BTW, at least on the Pixel (XL), the "high performance audio" mode does not do anything measurable.

I'm not quite sure about the status of Bluetooth 5.0, but the Pixel running Oreo now supports higher-quality audio codecs, i.e. AAC, Apt-X (HD), and LDAC.
[Google Pixel XL Themes, Apps, and Mods] [Gorgasm]:
The HEVC encoding capability is mentionned in the media_codecs.xml, but I think that we need to create new profiles in other system files. If we change "h264" by "hevc" in media_profiles.xml it seems that it works but only with 3rd party apps like Open Cemera.
[Google Pixel XL Themes, Apps, and Mods] robinson1685:
When I try to run the script, I am getting the error. cp: /system/etc/mixer_paths.xml.stock: Read-only file system.

Does anyone know how to fix this?
[Google Pixel XL Themes, Apps, and Mods] chdloc:
Did you use a root shell to run the script? What version of the mod are you trying to install? What ROM are you running?
[Google Pixel XL Themes, Apps, and Mods] robinson1685:
Yes I ran the shell script with su and got the magisk installer to work. I was trying to run the duel speaker mod and also tried to install all the mods as well. I am running the latest version of pure nexus on android 7.1.2, I am on build NJH47D
[Google Pixel XL Themes, Apps, and Mods] chdloc:
At this point, the mod only supports the superSU root environment.
[Google Pixel XL Themes, Apps, and Mods] kirschdog1:
I am getting gzip: can't gzopen errors when trying to run the second command any ideas why? or how to get this running?
[Google Pixel XL Themes, Apps, and Mods] chdloc:
Two possibilities: either you are not issuing the second command in a root shell or you are rooted with Magisk.
[Google Pixel XL Themes, Apps, and Mods] kirschdog1:
I do not have magisk installed never have and i made sure to type adb shell then su which indicates a # to verify I'm in root shell. Then typed it multiple times to verify it wasn't a command/user error. Any chance you could pm me the correct mixer.paths file which is adapted for stereo speakers and I will update the permissions.
[Google Pixel XL Themes, Apps, and Mods] chdloc:
My apologies, the second command had a bug in it. Please try again using the updated command line in the OP.
[Google Pixel XL Themes, Apps, and Mods] kirschdog1:
cd /data/local/tmp && gzip -d chdloc_hardware_audio_mods_pixel__ull_oreo_september7.tar.gz && tar -xf chdloc_hardware_audio_mods_pixel__ull_oreo_september7.tar && cd chdloc_hardware_audio_mods_pixel && chmod 744 install_chdloc_mods.sh

This is my command prompt and i keep getting this error:

gzip: can't gzopen chdloc_hardware_audio_mods_pixel__ull_oreo_september7.tar.gz

What am I doing wrong I have spent 3 hours on this and can get step 1 to work but step 2 always fails!

Any ideas?
[Google Pixel XL Themes, Apps, and Mods] chdloc:
OK, let's take baby-steps. Please show me a screenshot of the contents of /data/local/tmp
[Google Pixel XL Themes, Apps, and Mods] kirschdog1:
Here you go.
[Google Pixel XL Themes, Apps, and Mods] chdloc:
Ok, try this version of step 2 in a root shell:

cd /data/local/tmp && tar -xf chdloc_hardware_audio_mods_pixel__ull_oreo_september7.tar && cd chdloc_hardware_audio_mods_pixel && chmod 744 install_chdloc_mods.sh
[Google Pixel XL Themes, Apps, and Mods] kirschdog1:
Yes that did it....thanks chdloc!

You are the man!
[Google Pixel XL Themes, Apps, and Mods] itch808:
So am I correct in that if I ONLY want the second mod that allows stereo video recording running an unrooted and locked bootloader on a non-verizon Pixel on Oreo Android 8.0, that it's not yet possible?
[Google Pixel XL Themes, Apps, and Mods] chdloc:
Correct, at the very least you will need an unlocked bootloader to make the necessary system modifications.
[Google Pixel XL Themes, Apps, and Mods] Lost497:
Hello, I have the Pixel XL 10 days ago, Android 0, Root SuperSu

Step 1: Place the Zip in the appropriate directory

Step 2: Error

What I can be doing wrong?

PS sorry for my bad english
[Google Pixel XL Themes, Apps, and Mods] Spartan117H3:
Hmm, I was trying selection 7 to install all mods and I get a bunch of no such file or directory/read only file system. I attached a screenshot.

I'm running systemless root with SuperSu 2.82 SR4 and Elemental X 1.15. You said starting with 1.02 so 1.15 should be fine (I did disable the codec power gating option). I'm on Pure Nexus 7.1.2 with vendor NJH47D.
[Google Pixel XL Themes, Apps, and Mods] chdloc:
Please show me the contents of the /data/local/tmp directory.

The problem is you are using a Nougat build along with the new "sbin" SuperSu. I do not have a biQuads installer for this combination. Let me know if you are really interested in biQuads (according to the screenshot you shared, the other two mods installed fine). If so, I'll make a special installer for biQuads.
[Google Pixel XL Themes, Apps, and Mods] Lost497:
only this
[Google Pixel XL Themes, Apps, and Mods] Spartan117H3:
All I wanted is the dual speaker stereo mod (I figured I'd install everything else while I'm at it), but I don't hear anything from the earpiece at all. That's why I figured it didn't install correctly. Also, do I just manually uninstall the biQuad application if I want to get rid of it?
[Google Pixel XL Themes, Apps, and Mods] chdloc:
run the following command in a root shell

cd /data/local/tmp && tar -xf chdloc_hardware_audio_mods_pixel__ull_oreo_september7.tar && cd chdloc_hardware_audio_mods_pixel && chmod 744 install_chdloc_mods.sh

and then

./install_chdloc_mods.sh

Do you see a new speaker control app/service in your app drawer? If so you should have a new permanent notification which which you can control the gain of the main loudspeaker.

If not, let me know and I'll help you get it installed.
[Google Pixel XL Themes, Apps, and Mods] Spartan117H3:
Yeah PixelSpeakerCtr. But as far as I can tell, all it does is raise/lower the bottom speakers, the earpiece is never enabled (I put it next to my ear). Unless I'm missing something.

Edit: I just had to reboot it again for it to work, the first reboot didn't for some reason. Cool. How do I get it to keep stereo the entire time even when the screen is off/I don't really get the adaptive vs stock? And is there a way to change it without having the persistent notification, i.e. if I want to set it every so often instead of having the option to do it always on my screen? Or maybe have it turn to stereo for when I'm playing music and mono for anything ringtone related? I have Tasker if that helps with what I'm looking for. If not, that's okay.
[Google Pixel XL Themes, Apps, and Mods] chdloc:
The idea behind the permanent notification (the speaker control app/service) is to the give the user some control of when to invoke stereo mode and when stock behavior is desired.

"Adaptive" means that stereo mode (spatial playback, but low levels) is active when the screen is on and mono (stock levels) when the screen is off. In this mode users can still toggle between stereo and mono within the notification controls when the screen is on (stereo/mono buttons). "Stock" means that the mono mode is active in all scenarios. I understand that usage patterns vary, but I could not really think of a scenario where a user may want stereo (low volume sound) when the screen is off. When the screen is not on, you are not looking at it and stereo playback with two speakers that are closely spaced is rather pointless. In addition, the volume is too low to be really useful in that case.

If you are "fluent" in Tasker, you can certainly come up with your own logic to control the loudspeaker's behavior. All you really need to know is how to control the volume of the main loudspeaker and to control mono vs stereo mixing in the loudspeaker DAC/amp. The easiest way would be to write to the relevant i2c registers.

To go to stereo mode simply execute the following two commands in a root shell:

echo 0x2a0f > /sys/kernel/debug/tfa98xx-34/regs/06-AUDIO_CTR # lower the gain of the main loudspeaker; here by 21 dB, which makes my setup sound balanced

and

echo 0x8093 > /sys/kernel/debug/tfa98xx-34/regs/04-I2SREG # main loudspeaker plays the right audio channel only

To go back to mono (stock behavior) issue the following commands in a root shell

echo 0x000f > /sys/kernel/debug/tfa98xx-34/regs/06-AUDIO_CTR # increase the gain of the main loudspeaker to 0 dB

and

echo 0x809b > /sys/kernel/debug/tfa98xx-34/regs/04-I2SREG # main loudspeaker plays mono mix

A small little wrinkle to keep in mind when designing your own logic: Android seems to reset the main speaker during speakerphone (telephony) usage.
[Google Pixel XL Themes, Apps, and Mods] Lost497:
Thank you very much, install the Mod 5 but if I put it in Stereo both in Adaptive and in Stock you hear very low, what am I doing wrong?
[Google Pixel XL Themes, Apps, and Mods] xmoox:
I am having an issue with this Mod I am running Elemental 2.01 android Oreo on a regular Pixel not XL. I installed all three mods. I got the stereo part to work. Once I plug in the headphones it takes a couple seconds and then its output both through the headphones and the earpiece. When I unplug the headphones the earpiece goes quiet and the stereo stops working until I turn the screen off then back on. I uninstalled the mod and now my headphones no longer work. I took a log but not sure which to filter on. Is it audio_hw_primary?

Edit: After restart with the headphones plugged in it started working with headphones and now switches correctly.

09-25 21:44:00.865 809 1108 D audio_hw_primary: disable_audio_route: usecase(0) reset and update mixer path: deep-buffer-playback speaker

I am running this

chdloc_hardware_audio_mods_pixel__ull_oreo_september7.tar

edit: to answer my own question. The reason I am hearing audio out of only one channel is because the power gating in the kernel that interferes with the Bi-quad mod. I guess I made a mistake with the Kernal install. This post linked below explains more.

https://xdaforums.com/showpost.php?p=72988211&postcount=420
[Google Pixel XL Themes, Apps, and Mods] chdloc:
You are not doing anything wrong. It works as designed. In order to actually obtain some sort of spatial audio experience the main loudspeaker's volume has to be reduced considerably in any "Stereo" mode . At the hardware level, the earpiece speaker's volume cannot be increased further without introducing serious distortions. The only way the earpiece's volume could be increased would be to add a compressor into the signal path, which is impossible at the mixer level. So stereo mode is really only useful when you are consuming media in a relatively quiet environment.
[Google Pixel XL Themes, Apps, and Mods] Lost497:
Since installing the Mod, when connecting the headphones comes sound from one, but not from the other, but from the upper speaker the audio comes out of what is being played ..

Probe with the option to return to STOCK but the problem is still.

any ideas?
[Google Pixel XL Themes, Apps, and Mods] chdloc:
It sounds like you installed the biQuads mod, but are not running a custom kernel with power gating disabled. Please read this post for some details.
[Google Pixel XL Themes, Apps, and Mods] kirschdog1:
Chdloc,

I keep getting this error after pushing the file.
[Google Pixel XL Themes, Apps, and Mods] kirschdog1:
Here is what is in my data file
[Google Pixel XL Themes, Apps, and Mods] chdloc:
Did you try the second command given in the OP or the "custom" one that I suggested to you a few weeks ago?

Looking at the screenshot you shared, the instructions in OP should work for you.
[Google Pixel XL Themes, Apps, and Mods] kirschdog1:
Ok I tried the custom command you gave me. I'll try the 2nd line in op and report back.
[Google Pixel XL Themes, Apps, and Mods] kirschdog1:
Op line worked. Thanks
[Google Pixel XL Themes, Apps, and Mods] bigsnack:
How does the front speaker quality compare to the 5x?
[Google Pixel XL Themes, Apps, and Mods] tbaker077:
Legit mod. Just did this on my Pixel that is systemless(I think that's what root no twrp is called?), can I still get OTA, and just redo the mod via terminal once a month or not possible?
[Google Pixel XL Themes, Apps, and Mods] bigsnack:
I am having some issues uninstalling. I just want to uninstall the quad headphone mod, and did the full uninstall, then just did the speaker mod only, but the headphone mod is still there(running stock kernel so I only get sound on my left headset).
[Google Pixel XL Themes, Apps, and Mods] chdloc:
Systemless root is initialized after the mixer is applied by Android. As a result, this mod cannot be systemless and the mixer actually needs to change. Hence, you will not be able to receive an OTA update.

It seems that the uninstall procedure has failed in your case. Did you see any error messages?
[Google Pixel XL Themes, Apps, and Mods] tbaker077:
If I uninstall the app when the OTA shows up and i am systemless, I should be fine right? Then apply terminal code and back to normal. Just like two small steps i have to copy and paste extra, right.
[Google Pixel XL Themes, Apps, and Mods] chdloc:
Yes, I designed it this way, but I have never tested it myself as I've always just manually flashed the full OTA.
[Google Pixel XL Themes, Apps, and Mods] bigsnack:
I was able to uninstall it as I had headphones working again. Then just installed the speaker mod(nothing else), but headphones are only working from one ear. I am not sure what to do, ugh.

Do you manually flash OTA via twrp?
[Google Pixel XL Themes, Apps, and Mods] chdloc:
Do you by any chance interchangeably use the Oreo version on a Nougat ROM or vice versa? Are you seeing any error messages during the install/uninstall process? Which option(s) did you select?

The fact that you hear audio only coming out of the right headphone tells me that your kernel does not disable the codec's power saving feature. You would either need to install a kernel that does, for instance elementalX, or do it yourself.

Yes.

If you cannot go back to stock using the installer, then you could simply take the file 'mixer_paths__stock.xml' from the installer's archive and manually copy it -- on Oreo -- to /vendor/etc/mixer_paths.xml, change the permissions to 644 (rw-r--r--), and reboot.
[Google Pixel XL Themes, Apps, and Mods] bigsnack:
I used both option 1 and the option that lets me install the speaker mod and the stereo recording mod without any error messages. Both gave me issues with headphones only working on one side, and using the Oreo version on Oreo(October update). Right now I am back to stock(headphones work normally), but trying to get the speaker mod to work, even under option one, give me issue with headphones only working from one side. As far as I can tell it installed correctly as I did not get any error messages.
[Google Pixel XL Themes, Apps, and Mods] tbaker077:
Can any of the HTC 10s improved audio tuning be used on the Pixel and Pixel XL?
[Google Pixel XL Themes, Apps, and Mods] chdloc:
You were right, I had a bug in my mod. Please try the attached dual loudspeaker only version.

Rename to mixer_paths.xml, copy to /vendor/etc, change permissions, to 644 (rw-r--r--), and reboot.

What tuning are you referring to? On the headphone side, the HTC 10 and Pixel share the same codec. At least on the Pixel side, none of the theoretically available tweaks make any audible difference.
[Google Pixel XL Themes, Apps, and Mods] mistermojorizin:
Just wanted to add my thanks. Applied the stereo speaker and stereo recording mods and phone still passes safetynet with suhide. Just wanted to let others know because I searched for this info before installing and couldn't find it.
[Google Pixel XL Themes, Apps, and Mods] bigsnack:
So do I install the mod then add this?
[Google Pixel XL Themes, Apps, and Mods] Sefyron:
i dont know if the mod is installed successfully or not plus the biquads app have no interface.

Med Saoud

Installing components required for biQuads...

biQuads installer script by chdloc

copying binaries

mkdir: '/su': Read-only file system

cp: /su/xbin/: No such file or directory

chmod: /su/xbin/bc: No such file or directory

cp: /su/xbin/: No such file or directory

chmod: /su/xbin/myawk: No such file or directory

creating biQuads directory and copying required files

mkdir: '/su': Read-only file system

cp: '/su/xbin/biQuads/' not directory

chmod: /su/xbin/biQuads/*.sh: No such file or directory

trying to install the biQuads app...

Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install com.chdloc.biquads

without first uninstalling.]

biQuads installation complete

Installation complete sailfish:/data/local/tmp/chdloc_hardware_audio_mods_pixel #

is this normal ? did installtion went succesfuly

i'm using elementalx with disabled core power gating