yashsingh1/xdaforums huggingface dataset:
[Nexus 5X Themes and Apps] peikojose:
hey Jose I am using 2.1 vol86 (my speakers seems to be weak).. and it sounds ok... before I would get distortion at 70-80%... now I only get it at the higest volume!! Thanks for your work
[Nexus 5X Themes and Apps] TheBurgh:
Which zip do you use to return to original sound settings if something gets out of wack?
[Nexus 5X Themes and Apps] ice711:
Anyone know why when I try to install, it keeps saying zip is corrupt? I've been using it fine and then today I updated chroma ROM and now I can't install it..
[Nexus 5X Themes and Apps] sshafranko:
In OP it says Revert To Stock...

Sent from my SM-N920T
[Nexus 5X Themes and Apps] sshafranko:
Try pushing it manually to system/etc...i know it doesnt fix your prob but at least youll have it for now...you have latest recovery? Also you can dl on your pc then push to phone like someone mentioned earlier and it was confirmed to work...

Sent from my SM-N920T
[Nexus 5X Themes and Apps] Jose-MXL:
First of all thanks as always for the feedback and work to improve this. I know how long it takes to put together these replies with proper guidance.

For the -0.5dB attenuation across all frequencies on the Left channel, that's just a cheap trick to move away from the bell shaped filter to a more flat trapezoidal filter with sharper attenuation on frequency ranges that I spotted to contribute to distortion, plus avoiding focalized distortion when mixing to the Right channel. I couldn't figure a more civilized way despite a lot of reading and trying off-the-book 0.7071 lowpass and highpass attempts (among other off-the-book ones).

Can you explain a little more (point it out)?, where is this second set of IIR input controls in the mixed file? I thought I had gotten did of them already.

It has been tough :(

Yes, but probably we need the patch as you pointed out. I don't want to go in that direction, I'm trying to do easy things on my spare time, if any other brave soul wants to do that or take over my work and improve it, I will humbly just step back and say thanks!

Will try this and all of the other unquoted recommendations you posted for the next version development.

Everyone help me give [MENTION=2760454]chdloc[/MENTION] a big shoutout for the support and big contribution to this work in progress!!!!

---------- Post added at 05:18 PM ---------- Previous post was at 04:57 PM ----------

Thanks Bro! Yes I'm doing the low volume setting earpiece flavors based on your recommendation. I'm glad you liked it!! Hows is it working for you, crisp and loud? Main speaker still too loud? Is it a good ground to start working on V3?

I have been playing some Daft Punk and Coldplay on my phone that helps me spot clipping and distortion and it has been working so far so good with V2.1 vol 88. Apparently my main speaker also liked the 2 notches down on volume, so this is a Test in progress for me too.

---------- Post added at 05:35 PM ---------- Previous post was at 05:18 PM ----------

By the way [MENTION=5108383]sshafranko[/MENTION], can you update OP with the V2.1 vol87 file and reference the V2.1 post? I don't want to give you extra work. I thought of starting my own post to off-load this work from you if you don't feel like sustaining my mod too. Let me know.
[Nexus 5X Themes and Apps] chdloc:
No problem. I'm thrilled that my biQuads app is being put to good use by someone other than myself.

The filters in the attached image would not work?

[IMG="Highpass + Lowpass"]https://drive.google.com/thumbnail?...1VWc&authuser=0&v=1462471091373&sz=w1416-h642[/IMG]

Second-order highpass @ 200 Hz and lowpass @ 8000 Hz, both with Q=0.7.

Lower than 200 Hz for the highpass doesn't make sense for a phone loudspeaker, in my opinion. I would even go higher than 200 Hz.

I see two sets of

<ctl name="IIR1 INP1 Volume" value="84" />
<ctl name="IIR2 INP1 Volume" value="84" />

in the "speaker" device of your latest mod (v2.1).

A kernel mod is probably too much for people to stomach. I'll take a quick look at the kernel sources. I may have time over the weekend to throw together a test kernel, which I cannot test as I don't have a 5x...
[Nexus 5X Themes and Apps] sshafranko:
I have no problem sustaining your mod or if you start your own thread. Whatever you feel like doing is ok with me but its no bother to me at all. I welcome with open arms everyone and anyone that wants to perfect, expand, etc this mod in any way. Actually im happy people are interested. I started this mod a couple years ago as an idea that popped into my head while listening to music and after tinkering around, printing out 30 pages of xml code so i could keep track of my trials, when i finally got it i instantly shared it on xda because i really loved the mod and i knew a lot of people would.

I cant imagime keeping that to myself. Anyway with that said, i am no Audio Engineer, far from it actually i just love to tinker with phones as most here on xda so beleive me when i see posts from people like you guys who know your audio I'm happy and thankful and i try to learn at the same time.

I'll update the op for you in a couple hrs and make a seperate section for yours and anyone elses mods. Keep it up guys and Thank you for sharing with the community?

Sent from my SM-N920T
[Nexus 5X Themes and Apps] chdloc:
I checked the Nexus 5x kernel sources and I think my kernel patch for the Nexus 5 should not be required for the Nexus 5x. Please test the attached zip for which I used your V2.1 mod (vol=87) as a basis.

Mixing should now be done within the IIR filter with the filter gains appropriately set such that digital clipping of the main loudspeaker is avoided. The volume of the main loudspeaker may now be a bit lower, though...

Update: removed attachment as it did not do what it was designed for.
[Nexus 5X Themes and Apps] Jose-MXL:
Nope, no go.

I had tried that already, it doesn't work, I flashed it anyways for the sake of flashing.

The reason I had not replied until now is because I was trying different roms and kernels to see if at least one had the plumbing. I have tried all flavors except stock rom. And since I'm not planning to go stock (plus I doubt that all kernels except stock are missing the plumbing), this won't work for me.
[Nexus 5X Themes and Apps] chdloc:
That's surprising as crossfeed worked out-of-the-box for the Note 4, which has the same audio codec as the Nexus 5x (WCD9330).

I'll go through the source code a little more carefully and try it on my Nexus 5 as I've not added the patch to my current kernel. Plus, I've only tried crossfeed in the context of headphone playback in the past.
[Nexus 5X Themes and Apps] chdloc:
Try the new attached version. This one now works -- earpiece only plays the left channel and main loudspeaker plays left and right channels via IIR-level distortionless mixing-- on my Nexus 5. No kernel mod should be required on the Nexus 5x.
[Nexus 5X Themes and Apps] Jose-MXL:
The funny thing about your file is that it work, BUT I already had tried to do that before and it didn't work. It only leads me to conclude that whatever kernel I was using at the timr had something broken and it harmed my development. Thanks for the hard work, I'll get this and new filters into an aroma installer for testers.
[Nexus 5X Themes and Apps] suku_patel_22:
This has a lower volume than the previous one.

Please don't reduce the volume.
[Nexus 5X Themes and Apps] peikojose:
Hi... in fact volume is lower... but no distortion!! Which is good... volume level I think is around stock or 90%stock... I think it is really clear

By the way, is possible to play in the earpiece the same than the loudspeaker? I mean.... left and right channel mixed... best regards
[Nexus 5X Themes and Apps] Jose-MXL:
Hi peikojose, yes it is totally possible. I am planning to put together an Aroma installer midweek with that mod and a bunch of volume flavors and filters. I think at some point [MENTION=2760454]chdloc[/MENTION] and I have been working on the same thing at the same time since we are both supporting and developing this tweetmod or dualmonomod of ours, I'm really sorry if we are slow but speaking for myself, I am a househead and my toddler is very time demanding. I've been trying a bunch of things that I didn't posted 'cause the kernel I was using didn't had the functionality, hopefully no one else runs into this.
[Nexus 5X Themes and Apps] sshafranko:
Jose can you attach the mods you want me to zip or post in the op in a seperate post for me here so i can put them in op tonight for everyone? I know you made a bunch of different versions and i havent been around for a couple days so not sure what to post. If i put them in the OP with your own section it might be less confusing for new people. Thanks
[Nexus 5X Themes and Apps] chdloc:
I don't think there was an issue with your kernel. Upon closer inspection I found a problem with your mixer_paths.xml file ("speaker" device). Instead of:

<ctl name="RX1 MIX1 INP1" value="IIR1" />
<ctl name="RX2 MIX1 INP1" value="IIR2" />

it should have been:

<ctl name="RX1 MIX1 INP1" value="IIR1" />
<ctl name="RX[B]7[/B] MIX1 INP1" value="IIR2" />

The instructions on crossfeed in my biQuads thread was written specifically for the headphone use-case.

Let me know if I can be of further assistance.
[Nexus 5X Themes and Apps] EVR_PR:
Deleted.
[Nexus 5X Themes and Apps] Lukest85:
LoL, I also have my own thread for this on recent Moto devices and include [MENTION=5108383]sshafranko[/MENTION] [MENTION=2760454]chdloc[/MENTION] & [MENTION=281070]bjrmd[/MENTION] as an influence (will add props to my OP v.soon guys) though I do not own any of your devices and am pretty quiet on XDA.

Here is an uninstaller for you that should work for hammerhead & bullhead to restore stock files or from .bak

I've also included a sample installer if you want an alternative to AROMA (its also on my list to get to).

Take a look and let me know what u think as I only put together for you here and can remove if anyone disapproves.

edit1: add new beta

Change TweetMod as default xml to install (set as the soft edition)

Made some adjustments to headphone gain & volume + switched off compander (revert to COMP1="1" if no improvement)

Re-ordered some speaker controls

Confirmed the included TweetMod.xml has the HPHL DAC switched off for speakers (pretty sure it's v2.1 edited by [MENTION=2760454]chdloc[/MENTION])

edit2: add new beta -b2 (bug fix)
[Nexus 5X Themes and Apps] Jose-MXL:
I had fixed that too already. In fact I was so pissed with that, that I moved on to trying not to demuxing the channels to start with (setting channels to "One") and just cloning the output to a temporary location and running it through the IIR filters. That gave me freedom to apply filters separately to each physical transducer instead of by channel, but I think I am missing something because it only works when you start playing it on the screen, if you move the process to the background one of the speakers shuts off.

Anyways, whatever it was, it's gone now, that's the only thing I can say. Hopefully I don't get into these stupid issues again.

Once again Thanks a lot for the mentoring!!! [MENTION=2760454]chdloc[/MENTION]

---------- Post added at 10:58 PM ---------- Previous post was at 10:50 PM ----------

Hi, [MENTION=6167433]Lukest85[/MENTION] sorry I don't see any attachments, did you mean going into your post and downloading it from AFH? There are 6 files each in the test and installer folders, I am a little bit lost, can you clarify a little bit?

I am eager to stea.....borrow your work so I can apply it to the Nexus 5X and learn a lot more. :)
[Nexus 5X Themes and Apps] Lukest85:
argh :eek: attachments didn't upload correctly...now fixed !

Sorry for the confusion, I was hoping to avoid that with direct attachments ;) plus I've added some mod info for you and [MENTION=5108383]sshafranko[/MENTION] to this installer (sample only and can be adjusted)

(only one AIO installer and one uninstaller is required, setup instructions are included in the mixer.prop file and DIY MixerMod-Package instructions are at the bottom of the README.txt and commented in script under "Template" sections).

currently my zips check device compatibility so the AFH files are only work with Moto G & E (now also the Note3).

hint: The installer can also be used to install stock or CM files so it's almost a universal package.

If I get approval from other modders and/or when I add a few more devices to my MixerMod I am keen to start a general thread for a collaborative universal/unified device package with all available/tested mods/tweaks...any thoughts/interest guys?

I will maintain the multi-device installer in anycase so feel free to adapt for your mod ;) with appropriate credits oc
[Nexus 5X Themes and Apps] chdloc:
To get what you set out to do to work I also cleaned up the "speaker" device that you've been using. In particular, I removed the following entry

<ctl name="HPHL DAC Switch" value="1" />

which should be active for the headphone use-case only. I'm guessing that this was one of the problems you have been struggling with as, strangely, the earpiece and the left headphone (HPHL) channel share the same signal path inside the codec.

It is also important to remember that the codec's IIR filter are really intended for sidetone -- capture (microphone feedback) -- equalization only. I simply reverse-engineered its internal representation and succeeded in hijacking its use for playback (headphones and loudspeaker) equalization.

The fact that audio would stop playing when moved to the background is possibly due to the sidetone setup being live during periods of active hotword detection (temporarily disable hotword detection to confirm). If you run into that problem again issue the following command in an adb shell (may need root shell)

logcat | grep select_devices

this will list the audio devices (to be found in mixer_paths) selected for servicing audio. You would need to remove the following entries

<ctl name="IIR1 INP1 MUX" value="DECX" />

where X is a number between 1 and 10, of any activated device other than the "speaker" one.
[Nexus 5X Themes and Apps] Nex23:
Hey guys, just to sum it up:

-I need bootlocker unlocked/oem unlocked

-I DONT need root

-Version 6.0.1 works on Android 6.0.1

There are some discussion about tweaking and stuff/errors going on here ... Can i just install it and it will work or do i have to do more tweaks (too lazy for that) ?
[Nexus 5X Themes and Apps] Lukest85:
:o hope no one minds me jumping in...

1. Yep BL unlocked (for rw /system access or to install system-less SuperSU)

2. Install Requirements depend on the zip package (ie busybox, etc) but you'll most likely need rw /system to install most (can be temp TWRP boot) or root access

3. Version#'s match so good to go :good: (6.0.1 source file is prob also fine for 6.0.0 & earlier anyway)

...manual editing of the .xml file generally requires root access

If this differs for any release in this thread, please correct me !?

If your happy with the sound after installation then no need to do anything else :victory:

There are different versions & releases because not everyone uses their phone/speaker for the same scenario and many variables in an Android/any audio setup ;) Plus many different ears to cater for !

The extra tweaking & recent dev chat is to produce the best sound for your device :cool: so you don't have to (tweak) !

edit: try a zip and report back !

my v1.0 for Moto devices has been successful on stockROM with only BL unlock + TWRP
[Nexus 5X Themes and Apps] Jose-MXL:
Haaaaa!! Sir you are the master, yes indeed it is the hotword detection that shuts down IIR1 when going into the home screen.... It started to happen when I installed a new ROM and gapps that included the Google Launcher and my previous one had AOSP trebuchet. I just couldn't figure why until you told me.

I am not sure I understood the instruction to fix this, is this related to the sidetone you spoke about disabling if I ran into hotword detection issues? Or is it a different thing? [MENTION=2760454]chdloc[/MENTION]
[Nexus 5X Themes and Apps] myawan:
Is there any chance of damaging handset speaker when using this mod??? I am skeptical. Does it work on latest PureNexus ROM?
[Nexus 5X Themes and Apps] karthik432:
Is Surround sound mod working on Android N preview?
[Nexus 5X Themes and Apps] parthabhatta:
Yes
[Nexus 5X Themes and Apps] chrisch91:
Also possible to flash with custom kernel?
[Nexus 5X Themes and Apps] suku_patel_22:
Nothing to do with a kernel
[Nexus 5X Themes and Apps] chdloc:
Yes, this is exactly the issue I referred to earlier. The way to fix this is to figure out which recording audio device is being used for hotword detection and turn off sidetone in that mode. To find the active device, follow my instructions above (logcat). If things work the same way as on my Nexus 5, then the device in question would be "voice-rec-mic". Now go into your mixer_paths.xml file. The "voice-rec-mic" device calls the "handset-mic" device, which in turn finally calls the "dmic1" device. In that "dmic1" device you need to disable/remove the call to "IIR1 INP1 MUX". See the attached new version of my most recent mod for the Nexus 5x. In the mixer_paths.xml file therein I disabled that particular line (1466) along with the corresponding call in the "dmic3" device (line 1482, used in speakerphone and camcorder use-cases) and "adc2" (line 1434, used for headsets with built-in mics). I also added a line (133) for an additional default definition.

Edit: you also may want/need to shut off the second speaker (set appropriate gain to 0) in the speakerphone use-case as an active second speaker may cause echo to be introduced into the far-end signal.
[Nexus 5X Themes and Apps] Lukest85:
I have updated my previous zip with your updates exc. mono speakerphone edit and attached here.

Changes:

-Minor scripting improvements

-add chdloc to credits (displayed)

-Unmodified [MENTION=3848518]josemxl[/MENTION] Tweetmodv2.1-r3 set as Soft edition

-Unmodified [MENTION=5108383]sshafranko[/MENTION] SurroundMod set as Loud & Boosted editions

-Increase & adjust vol of headphones & speakers for the Medium edition.

-Add IIR edition (based on medium edition + IIR passthrough filters for Headphones)

Overview

-MixerMod flashable zips are compatible with system-less SuperSU, and /system with or without SuperSU.

-All are signed so will work with recoveries other than TWRP

-Busybox is NOT required.

-Each one creates & restores a backup and includes an addon.d survival script, so no need to reflash after a ROM upgrade.

-Setup can be customized by editing /sdcard/mixer.prop (copy from zip or /tmp via TWRP straight after flashing, instructions included)

-Restore/Uninstall.zip is attached to my previous post

If anyone tries the medium edition (default) pls report back on the headphone sound/volume as I don't have an N5 to test/check and can still tweak/adjust further.

[MENTION=2760454]chdloc[/MENTION]

I have included your Nexus5.xml mod with this one so you can also try this package !

Pls let me know what you think and/or PM !?
[Nexus 5X Themes and Apps] Eelviny:
Just running this on my bullhead Omnirom and I'm getting this line continually spammed in logcat when playing music. It seems to work great, and if there was another error attached with it then it's moving too fast for me to see.

05-12 16:52:27.626 411 2750 W volume_listener: vol_effect_process: something wrong, didn't handle in_buffer and out_buffer same address case

I have absolutely no clue how your tweaks work, so I'll just leave this here... Just FYI really.
[Nexus 5X Themes and Apps] chdloc:
No idea what this warning means.

Fundamentally, the mixer_paths mods directly only change audio routing, mixing, filtering, and gains inside the audio codec itself, although there may be some interaction between the mixer and the audio HAL (part of the ROM itself). It appears that OmniROM is trying to do something clever (whatever that may be). If you don't see or hear any side effects, I would not worry about it.

That brings me to one caution to anyone using this mod along with a Faux sound enabled kernel. Faux will disconnect RX1 and RX7 gain control from mixer_paths.xml and tinymix and offer its own control via a kernel interface. To find out whether your kernel uses Faux sound, type the following command in an adb shell:

find /sys -name 'sound_control_3'

If you see a line containing the string 'sound_control_3', then your kernel does offer Faux sound and you may need to adjust the gains via a kernel control app that offers sound adjustment (depending on whether Faux sound is actually enabled). The problem with Faux sound, however, is that you currently cannot separately control the earpiece speaker volume and left headphone volume as they share the same signal path.
[Nexus 5X Themes and Apps] Eelviny:
Thanks for the clarification.

I can confirm that the ElementalX kernel (1.14-eas) uses Faux sound and the mod works fine on my 5X, even if it may not be as perfect as it should be without Faux.

Omnirom and Cyanogenmod are similar in many respects - is anyone able to confirm the same issue on a CM ROM? Just curious - not sure if it will help anything.
[Nexus 5X Themes and Apps] chdloc:
The mod should work with or without Faux sound. However, if Faux sound is indeed active, you may not hear a balanced left-right image that some folks here are trying to achieve with their version of the mod. On my Nexus 5 with "true" stereo playback as well as level- and frequency-response-balanced speakers, the sound effects in this YouTube test video are convincing, albeit a little quiet due to physical limitations of (particularly) the earpiece speaker.
[Nexus 5X Themes and Apps] roofrider:
I'm on EX too, but that command returns: no such file or directory. Sorry, I see it now. But I think [MENTION=4684315]flar2[/MENTION] said something about including an option to disable sound control in the next update. Not sure if its the same thing that is needed here.
[Nexus 5X Themes and Apps] Eelviny:
Seems like it's coming!
[Nexus 5X Themes and Apps] Gabriel1495:
Sorry, I download and open the zip and mixer_paths.xml inside, but I didn't this line...what did I misunderstand? [emoji53]
[Nexus 5X Themes and Apps] Jose-MXL:
Nothing, that line is just for reference, you are good to go by downloading and flashing the file.

It is noteworthy to mention that most users might not be able to tell the difference between all of these changes, and the simple reason is that none of these changes affect dramatically the listening experience.

We are trying to get some sound out of the earpiece like if we were trying to squeeze something out of a dry brown lemon and expecting it not to bitter, we are filtering it to take some bitterness away, and we are playing with the left/right channel combinations in the process.

At this point the refinements would be cumulative and could be unnoticeable improvements with a different flavors of left/right combinations.
[Nexus 5X Themes and Apps] Jose-MXL:
It made sense before but I'm picturing in a higher level of understanding now. Thanks a ton.

You know, this is not the first time I noticed this comment, I don't recall who or where, but someone else commented that the surround sound mod (the earpiece transducer, to avoid jibber jabber) works a lot better on the Nexus 5. I wonder if there is a limitation that LG included in the circuitry (i.e. hardware passive filters, different impedance circuit, different amplifier) that crippled this output quality on the Nexus 5X.

The earpiece on the N5X is only capable of setting a somewhat old looking cherry on top of the not so promising pie, sound-wise. I am just working on making the damn cherry look better. Hopefully I'm delivering because I don't see many thumbs up but I don't see complaints either ;).