[Google Pixel XL Themes, Apps, and Mods] chdloc:
Attached In the OP there is an installer for up to three hardware-level audio mods that I've created over the last few years.

Important

: This installer is not flashable via TWRP, but needs to be installed using an adb root shell as outlined below.

The three mods that can be installed in any combination are

The dual speaker playback mod as originally presented in this thread. When installing this mod, an app will also be installed that offers the following functionality:

when the screen is on, the main loudspeaker level is reduced significantly to bring down its volume to the one that is attainable with the earpiece speaker. The idea is that when the screen is on you may want to use it to watch a movie or play a game where the stereo effect may enhance the listening experience. This is a "personal" use-case where the lower overall volume may not be a huge problem

when the screen is off the main loudspeaker level is again raised to its maximum capability to not miss notifications and alarms, etc

There is an option offered to force maximum gain also in case the screen is on, for instance when sharing a YouTube video with friends or when using the speakers in the car in navigation mode

The above functionality can be controlled with a new permanent notification with three buttons: "stereo", "mono", and "mode", which can be "adaptive" or "stock". If you install the dual speaker mod, an accompanying app/service will be installed that automatically shows the above referenced permanent notification. This "app" has no UI other than the permanent notification. It is really a service that automatically starts upon boot. Keep in mind that you will need to unlock the phone twice after the boot process has been completed for the service to become active. The reason for this is that Android only makes most services available only after the initial unlock as a security feature. After that the screen needs to turn off at least once for the speaker control service to detect the screen state. Also, this service requires root privileges to function properly.

Stereo camcorder audio recording mod. Any app that uses the CAMCORDER device is now capable of recording stereo sound. Examples are Google's stock camcorder or "Easy Voice Recorder Pro".

Headphone biquad filtering for frequency response compensation as first made available here. This option will also install the accompanying biQuads app and relevant files. REQUIREMENTS: system-less root and [MENTION=4684315]flar2[/MENTION] 's excellent ElementalX kernel starting with version 1.02, with codec power gating option disabled in the installer. I also have a 100% stock kernel available here which disables the codec power gating.

To install, download the attached archive to your PC and push it to /data/local/tmp on your Pixel

adb push chdloc_hardware_audio_mods_pixel.tar.gz /data/local/tmp/

Then enter an adb shell and copy the following string of commands into a root shell:

cd /data/local/tmp && gzip -d chdloc_hardware_audio_mods_pixel.tar.gz && tar -xf chdloc_hardware_audio_mods_pixel.tar && cd chdloc_hardware_audio_mods_pixel && chmod 744 install_chdloc_mods.sh

to install type

./install_chdloc_mods.sh

and select your install option, which also includes "revert to stock".