yashsingh1/xdaforums huggingface dataset:
[OnePlus 5T  Themes, Apps, and Mods] CazeW:
Or better yet, toss that into a Magisk template and make a module out of it and it will be a lot easier to disable/revert.
[OnePlus 5T  Themes, Apps, and Mods] osm0sis:
It works! The mod from this thread has more of a balance between the earpiece and main speaker though, since surprisingly, the OP5T has a decent earpiece capable of cranking out more volume than your average one. Any way for me to easily experiment with raising the earpiece volume?

Also, could you explain adaptive vs. stock mode in your app? And what is the default mode and stereo/mono setting without the app running?
[OnePlus 5T  Themes, Apps, and Mods] chdloc:
Well, the mod in this thread does provide a louder earpiece, but that comes with lots of distortion. See, in the mod the OP offers, I noticed that the earpiece gain is set to "96", which is controlled by "RX0 Digital Volume". 96 corresponds to +12 dB of digital gain. If you pump in a signal that is already close to full-scale (0 dB), which happens when you set the Android gain (volume control) to max, then all the additional 12 dB does is apply brute-force compression at the cost of excessive distortion. It does sound louder, sure, but unacceptable in my opinion. In my mod I set the earpiece digital gain to 0 dB, which corresponds to 84 in the mixer. Hence, the OP5T does not have a earpiece amp that is any better than anything else out there.

But sure, if you want to play with the earpiece gain, you can do so easily by playing media via the now dual-speaker setup, open a root shell and issue

tinymix "RX0 Digital Volume" X

where X can be anything between 0 (-84dB) and 124 (+40 dB). If you want to apply a gain value permanently you will need to edit your mixer file and hard-code it in there. After that you will need to reboot for the new gain value to take system-wide effect.

Adaptive mode switches the setup to true stereo when the screen is on (in situations where only you consume stereo media in a quiet environment), but it reverts back to stock (which can be manually set to loud dual-mono or true stereo) when the screen is off. The idea is that when the screen is off you would likely not benefit from a stereo effect anyway. Plus, you won't miss notifications and alarms as the levels will go back to stock when the screen is off.

Stock mode basically gives you the option to switch back-and-forth manually.

Without the app, the earpiece will play the left audio channel only as loud as it can while the main speaker will play a downmixed mono stream at its maximum volume. Both volumes are still controlled by playing with the volume rocker as usual.

Sorry, I don't "do" modules. I'm more of a "bare metals" kind of guy and let others have fun with installers. While I have experience with sound mods at a low level, I do not have a lot of experience with the UI side of things...
[OnePlus 5T  Themes, Apps, and Mods] CazeW:
Just meant osm0sis or someone else could easily do that if they'd like an easy way to revert it. :D

But nicely done fixing this so quickly. :highfive:
[OnePlus 5T  Themes, Apps, and Mods] osm0sis:
Sounds good! I'd like to make the main speaker more quiet then so it doesn't overpower the earpiece as much. What's the tinymix command for that with your new setup?
[OnePlus 5T  Themes, Apps, and Mods] chdloc:
Is the main speaker still louder in true stereo mode?

The main speaker's volume control cannot be adjusted with tinymix. For that you will need to write to the speaker codec/amp registers directly. Take a look at the hidden text in the OP of my Pixel mod for instructions. Basically what you need to do is adjust the ZZ value in the following shell script which needs to be executed as root:

echo 0xZZ0f > /sys/kernel/debug/tfa9891-36/regs/06-AUDIO_CTR
[OnePlus 5T  Themes, Apps, and Mods] osm0sis:
Thanks! You've done a wealth of research and your expertise is very much appreciated. :)

Yeah, I found it overpowering in both modes. I had to put the phone up to my face and physically block the main speaker holes to tell that the earpiece was working.

I'll experiment to see if I can get it feeling somewhat balanced. :good:
[OnePlus 5T  Themes, Apps, and Mods] osm0sis:
Turns out just dropping the main speaker a bit worked great! Seems like that's all it needed on top of your mod!

#!/system/bin/sh

# scale is 0 (-84 dB) to 124 (+40 dB), default 84 (0 dB)
tinymix "RX0 Digital Volume" 84; #0 dB

# scale is 00 (0 dB) to FE (-127 dB), default 00 (0 dB)
echo 0x120f > /sys/kernel/debug/tfa9891-36/regs/06-AUDIO_CTR; #-9 dB
[OnePlus 5T  Themes, Apps, and Mods] chdloc:
Nice!

I realized that the speaker control app I attached to a previous post had a bug and it would never switch to true stereo mode and would also not drop the gain of the main speaker to balance the sound. Try the new one. I also modified it according to your findings, i.e. the gain drops by 9 dB in true stereo mode.

In addition, I'll also share the Tasker project source with which I generated the attached app, so you guys can take the ball from here.

At least on the Pixel having an app or service control the speakers is beneficial since the Pixel resets the main speaker's settings (the chip registers) to default for the speakerphone use-case. I have Tasker monitor for this event and re-apply the settings as necessary. Things may be different on the OP5T, though.

Another thing to add is that, on the Pixel, dual-speaker did not work in the ull (ultra low-latency) playback mode, which some apps may request. I have a comment in the modified mixer that I shared. There is a workaround that I'm using on my phone, but that involves more hacking by disabling ull playback mode altogether which is done in the audio_platform_info.xml file) and default to low-latency playback mode unbeknownst to the calling app. Again, this may not be a problem on the OP5T.

Edit: Added the required mixer that I shared previously to this post, so all required files are in one place. To install, rename the mixer file to mixer_paths_tasha.xml, copy to /vendor/etc, change permissions to 644 (rw-r--r--), and reboot. I'll leave it up to you guys to come up with a Magisk module.
[OnePlus 5T  Themes, Apps, and Mods] :
Wooo you guys rock!
[OnePlus 5T  Themes, Apps, and Mods] DrGreem:
Hey guys I have stock oxygen OS 5.0.2 with MagisK v 15.3 and I'm trying to install the mod but I keep getting error that MagisK is not activated, any suggestions?
[OnePlus 5T  Themes, Apps, and Mods] Ell1s:
i Have the same issue, OOS 5.0.2, ibe TWRP and Magisk 15.3, waiting for solution. Odd thing. It worked on the OOS 5 betas, but not the stable.
[OnePlus 5T  Themes, Apps, and Mods] DrGreem:
Yeah and that sucks because that mod is really awesome, I'm more happy with the mod than the phone itself :p
[OnePlus 5T  Themes, Apps, and Mods] CazeW:
It could be because the zips in the OP are using the old Magisk zip template. I've attached below the mods from the OP using Magisk v15 templates. If they still fail, then there might be something wrong with your Magisk installation. And as no one else seemed to be making one, I also made a module of the version chdloc created (get the apk from his post).

EDIT: Added a noApp version with a loop by [MENTION=4544860]osm0sis[/MENTION] to adjust the volume instead of the Tasker app. If you use this version, you don't need that app.

If in doubt on which one to use, get the noApp version. Both should work on both Nougat and Oreo.
[OnePlus 5T  Themes, Apps, and Mods] DrGreem:
So I installed Franco kernel and the mode works fine so I guess as you said it's OP's issue.
[OnePlus 5T  Themes, Apps, and Mods] osm0sis:
[MENTION=2760454]chdloc[/MENTION], after using it a bit more, it seems like with your mod the earpiece audio is off-time with the main speaker by a fraction of second.. any way to resolve that? Also, any way to add my volume reduction with the mixer paths? Setting it on boot with a su.d/post-fs-data.d script is a bit tricky since it resets itself after 16-30 seconds, which I have of course worked around, but fixing it in the xml would be far cleaner. :)

#!/system/bin/sh

# run in an asynchronous subshell to not impede the boot with su.d/post-fs-data.d
{

until [ "$(getprop sys.boot_completed)" == 1 ]; do
sleep 1;
done;

until [ "$(cat /sys/kernel/debug/tfa9891-36/regs/06-AUDIO_CTR)" == "0x120f" ]; do

# scale is 0 (-84 dB) to 124 (+40 dB), default 84 (0 dB)
tinymix "RX0 Digital Volume" 84; #0 dB

# scale is 00 (0 dB) to FE (-127 dB), default 00 (0 dB)
echo 0x120f > /sys/kernel/debug/tfa9891-36/regs/06-AUDIO_CTR; #-9 dB

sleep 32;

done;

}&
[OnePlus 5T  Themes, Apps, and Mods] chdloc:
Yes, the same is happening on my Pixel. The reason for the delay is that we are using two different DACs and the speaker DAC seems to be buffering more. The result is more audible when using true stereo playback as offered by my mod as compared to the one offered by the OP, which is not stereo. I tried using my biQuads mod to design Allpass filters to add some delay to the earpiece speaker. Unfortunately, five biquads (10th-order IIR filter) do not offer sufficient delay to make an audible difference. The only way this could be fixed is to use something like Viper to apply a sufficiently long linear phase (FIR) filter to the earpiece path only. I have never used Viper or any other system-wide audio libraries to know whether this would be an option.

Unfortunately, there is -- currently -- no way to modify the main speaker's volume via the mixer. Another wrinkle is -- at least on my Pixel -- that the speaker setup gain and mono/stereo mode is reset in the speakerphone use-case, so adjusting the gains once during startup may not be sufficient. At least for me, Tasker was the answer...
[OnePlus 5T  Themes, Apps, and Mods] osm0sis:
Could always just make my loop repeat forever rather than exit and reduce the sleep time to 1 then it would always restore the volume any time it changes. I've done stuff like that for schedulers in the past and there's no noticeable hit on battery life from the background shell script loop. As a fan of bare metal I figure you'd find this more fun than Tasker. ;)

/magisk/op5speakermod_chdloc/post-fs-data.sh:

#!/system/bin/sh
# osm0sis @ xda-developers

# earpiece speaker scale is 0 (-84 dB) to 124 (+40 dB), default 84 (0 dB)
earvol=84; #0 dB
# main speaker scale is 00 (0 dB) to FE (-127 dB), default 00 (0 dB) as ZZ in 0xZZ0f
mainvol=0x120f; #-9 dB

while sleep 1; do
if [ "$(cat /sys/kernel/debug/tfa9891-36/regs/06-AUDIO_CTR)" != "$mainvol" ]; then
tinymix "RX0 Digital Volume" $earvol;
echo $mainvol > /sys/kernel/debug/tfa9891-36/regs/06-AUDIO_CTR;
fi;
done&

[MENTION=1346563]CazeW[/MENTION] could you add this to the chdloc zip you made?
[OnePlus 5T  Themes, Apps, and Mods] chdloc:
Oh, absolutely! But on the Pixel I have to drop the main speaker by 18 dB (!) for a balanced sound. The resulting overall volume is useless in all cases but individual media consumption and gaming in relatively quiet acoustic environments. Therefore, I needed an interface for user interaction. If I used your script, I would have to have some user-accessible parameter to offer the flexibility to raise the main speakers' gain on-the-fly. All possible to do on "bare metal", but sometimes Tasker just makes more sense.
[OnePlus 5T  Themes, Apps, and Mods] CazeW:
Done. Added a noApp version with the loop to my post incase someone wants to use the Tasker app instead.
[OnePlus 5T  Themes, Apps, and Mods] osm0sis:
Thanks!

Hrmm.. didn't work because in config.sh you also need to set POSTFSDATA=true

Also it didn't need MODDIR=${0%/*} or any of that added, since it's not using $MODDIR. You can just drop it in as-is from my previous post. You can remove .gitattributes and README.md while you're at it since they aren't used and are just the default module template stuff. :highfive:
[OnePlus 5T  Themes, Apps, and Mods] CazeW:
Ah yeah, forgot to change that. Updated the file and removed the template stuff. I just left them there originally as it doesn't really matter if they are there or not.
[OnePlus 5T  Themes, Apps, and Mods] osm0sis:
Working perfectly now, thanks! :)
[OnePlus 5T  Themes, Apps, and Mods] DrGreem:
Hello all, so i updated my 5t to OOS 5.0.3 and installed bluspark kernel, i have an issue with the incoming calls, my earpiece is not working so i have to enable and then disable the speaker to make the earpiece work.

As i found out later if i disable the mod then everything work fine but when i enable it again (from Magisk) the issue comes back again.

Anyone else experiencing the same issue?

Also what is the difference between OOS and OREO?
[OnePlus 5T  Themes, Apps, and Mods] sardelisp:
I also had installed bluespark kernel.

And I had installed Stereo_Sound_Mod_OP5T_by_chdloc-Magisk-v15.zip

I found out that the lock sound plays once at several times. It's not stable. Sure it conflict s with something .

But then delete chdloc magisk module and flashed the original one.

It's working perfect.

But I want to use [MENTION=2760454]chdloc[/MENTION] mod because of the app.

Please can you search what is going on? Can you flash latest bluespark kernel and try to fix it??
[OnePlus 5T  Themes, Apps, and Mods] CazeW:
There are some differences in the mixer_paths_tasha files between Oreo (stock) and OOS but I suspect that the Oreo version would work on OOS as well. Give the version made my chdloc a try as I think it's probably the most stable one of them.
[OnePlus 5T  Themes, Apps, and Mods] Yaj00j:
got it running on stock 7.1.1 with magisk v15.3. Is there any way to get this working with all apps like Mx Player or music apps? and is this mod damaging for the ear speaker on high volume?
[OnePlus 5T  Themes, Apps, and Mods] opponent:
I've installed the dual speaker mod on oxygen open beta3. But I find a problem that there is no sound after video recording by the default camera app.

Anyone come across it?
[OnePlus 5T  Themes, Apps, and Mods] xocomaox:
So with this I should expect to have a louder-by-default earpiece volume compared to the bottom speaker? Is that what the Adaptive mode does?
[OnePlus 5T  Themes, Apps, and Mods] andrizmitnick:
special thanks to chdloc and osm0sis for their help on this mod while i'm away, sorry for not doing any help.

instruction:

1. flash via magisk manager

2. open OP5TSpeakerCtrl app

3. you're good to go, you can control the true stereo mode via notification panel

Changelog:

----10/2/2018----

updated magisk template

added new version of Oreo for true stereo mode

*credits goes to chdloc for mixer modification and OP5TSpeakerCtrl app
[OnePlus 5T  Themes, Apps, and Mods] naruto20007:
The first 2 seconds audio are really loud and clipping when record video via stock camera. Only happens in video recorder, voice recorder apps work fine. Stock 5.0.3

---------- Post added at 01:15 PM ---------- Previous post was at 01:11 PM ----------

For me the first 2 sec video sound recording are really loud and clipping
[OnePlus 5T  Themes, Apps, and Mods] chdloc:
No, the earpiece is already as loud as it gets without distorting and it does not get modified from always playing the left audio channel.

What my version of the mod modifies is the behavior of the main speaker only:

"Mono" mode -- the main loudspeaker's volume is set to maximum (stock behavior) and it is fed with a downmix of the left and right channels (also stock behavior)

"Stereo" mode -- the main loudspeaker's volume is lowered to match the volume of the earpiece and is fed with the right audio channel (true stereo)

In "Adaptive" mode, stereo operation is applied when the screen is on and mono when the screen is off. In "Stock" mode (I should have named it "Manual"), the mode of operation does not change automatically, but is manually selected by tapping the "Mono" and "Stereo" buttons in the app's permanent notification.
[OnePlus 5T  Themes, Apps, and Mods] DrGreem:
Thank you very much for the time and the effort you put in this guys.

I installed this version, all seemed to work good until I changed the mode from stereo to adaptive the sound has gone.

I'm on OOS 5.0.3 with with bluspark kernel.

Edit i plugged in earphones and then plugged them out and the sound came back but the volume on stereo is very low and on the earpiece speaker it's almost zero...

I pressed pause and then play and the sound gone again. (all of that using poweramp).

I think it might be because of the poweramp? Because when i used youtube everything worked fine in stereo and the volume levels were also high.

P.S PowerAmp is on stock settings.
[OnePlus 5T  Themes, Apps, and Mods] Reb0rn:
It would be good to have a "back to stock" zip or something. At least for oos 5.0.x .
[OnePlus 5T  Themes, Apps, and Mods] andrizmitnick:
what i can get it's maybe the PowerAmp sampling rate or ur music files, try with different music files like 44Khz, 48khz, or etc.

Or deep dive & change the PowerAmp settings

u can easily just remove it from magisk manager :)
[OnePlus 5T  Themes, Apps, and Mods] naruto20007:
This is magisk module. Just uninstall it or disable it by magisk manager to go back to stock
[OnePlus 5T  Themes, Apps, and Mods] Yaj00j:
will this work on stock 4.7.6 nougat 7.1.1 aswell? or strictly oreo?
[OnePlus 5T  Themes, Apps, and Mods] joaoennes:
In the OP there's a version for Nougat. Use that one
[OnePlus 5T  Themes, Apps, and Mods] MultiCulti:
may you make this also with Custom Roms based on Aosp or Linage compatible? :confused: :)
[OnePlus 5T  Themes, Apps, and Mods] MrPhilo:
Does the APP work for Nougat, or just Oreo only atm?
[OnePlus 5T  Themes, Apps, and Mods] Kreuzfelder:
I turned off the notification. How can I reactivate them? There are the attitudes in it.
[OnePlus 5T  Themes, Apps, and Mods] USHERROB:
A few people in earlier posts already said that it was working fine in Omni 8.1 and I'm using it on LiquidRemix 8.1.

---------- Post added at 11:00 AM ---------- Previous post was at 10:59 AM ----------

Please read the Title and the OP
[OnePlus 5T  Themes, Apps, and Mods] MrPhilo:
The app that comes with the Oreo version. Does that work on Nougat. There is no mention of it.
[OnePlus 5T  Themes, Apps, and Mods] xocomaox:
This explains everything, thank you. :)
[OnePlus 5T  Themes, Apps, and Mods] MultiCulti:
Hmm .. tried it on LR as well ... but i lost sound at all!
[OnePlus 5T  Themes, Apps, and Mods] USHERROB:
When you say APP, are you speaking about the Magisk Module? Or something else?

---------- Post added at 12:48 PM ---------- Previous post was at 12:41 PM ----------

What is your setup and current Modules?
[OnePlus 5T  Themes, Apps, and Mods] MrPhilo:
OP5TSpeakerCTRL App, it's mention on the OP V2.0

Just wondered if that would work on Nougat. Since v2.0 is for Oreo
[OnePlus 5T  Themes, Apps, and Mods] bounti:
I too am on the latest LR and lost all sound through my speakers. Headset audio works fine. Only audio related module I have installed is Viper4Android FX Materialized. It's not enabled though, just installed through Magisk.
[OnePlus 5T  Themes, Apps, and Mods] PsychOlli:
On OOS OB3 the App shows up but still no sound from earpiece. And the app just closes when opened so i don't know how ot disable the notification of it.
[OnePlus 5T  Themes, Apps, and Mods] jesper801:
When I install this mod My mic doesn't work anymore when filming a video, am I the only one facing this problem?
[OnePlus 5T  Themes, Apps, and Mods] dodgeviper12003:
I have the same issue but I can control it in the notifications. I'm on 8.0, if I install the 7.0 on on 8.0 it works fine
[OnePlus 5T  Themes, Apps, and Mods] chdloc:
You guys need to remember that I based my version of the mod -- which is now being used as the "Oreo" version in the OP -- on the mixer configuration file that [MENTION=4544860]osm0sis[/MENTION] posted a few weeks ago. Custom ROMs may not necessarily be based on the stock audio HAL, which in turn may call for a different mixer configuration file. In the past I've seen that CM (or now LineageOS) and CAF-based ROMs, indeed, make use of a heavily modified audio HAL. Those ROMs will need their own modified mixer files. Using the one provided in the OP may cause loss of audio as described by some of you.

Also, even the stock audio HAL may change over time. Hence, you will need to track those changes and appropriately adapt the mod going forward.

In addition, when an app asks for the audio-ull-playback use-case (you can check for that using logcat), the earpiece is currently not supported. We would need to experiment some more to enable the earpiece in that use-case.
[OnePlus 5T  Themes, Apps, and Mods] DorianX:
Stupid question: what's the difference between Stereo_Sound_Mod_OP5T_Oreo-Magisk-v15

and

Stereo_Sound_Mod_OP5T_Oreo_OOS-Magisk-v15?

Enviado desde mi ONEPLUS A5000 mediante Tapatalk
[OnePlus 5T  Themes, Apps, and Mods] yung40oz84:
Ones OOS and the other is not.
[OnePlus 5T  Themes, Apps, and Mods] gunyz:
Hi guys don't know if someone already reported it but when the module is active in magisk it causes some weird sound for 3-4 secondes in the beginning of any video recording. I am using camera M mod and gcam and it does it with these 2 cams. The mod works fine tho thanks. On OB3.
[OnePlus 5T  Themes, Apps, and Mods] jesper801:
When I use this mod via magisk I can't record any sound :( do you think we'll have the same problem when we flash it via TWRP?
[OnePlus 5T  Themes, Apps, and Mods] ps000000:
Can user adjust the main speaker volume down a bit?

(I feel the main speaker still more louder than the earpiece.):fingers-crossed:
[OnePlus 5T  Themes, Apps, and Mods] yuval328:
It works but somthing worng withe the stereo, when testing, it use both speakers neither left or right sound
[OnePlus 5T  Themes, Apps, and Mods] gunyz:
I just tried flashing it via TWRP it doesn't change anything same issue unfortunately.
[OnePlus 5T  Themes, Apps, and Mods] dodgeviper12003:
Did you try the N version? It's the only one that worked for me and I'm on Oreo.
[OnePlus 5T  Themes, Apps, and Mods] gunyz:
What version are you talking about? There are only 2 versions of the mod on the original post, one for nougat and one for oreo.
[OnePlus 5T  Themes, Apps, and Mods] dodgeviper12003:
I'm using the nougat one on Oreo because the Oreo one would not work.
[OnePlus 5T  Themes, Apps, and Mods] Skinpipe:
I'm on stock Oos latest with the oreo mod and my ringtone doesn't play when it's enabled, anybody experience the same?
[OnePlus 5T  Themes, Apps, and Mods] osm0sis:
Everyone with issues try the "noApp" version CazeW posted, it has my script in it and it's been working flawlessly for me, speaker phone and all.
[OnePlus 5T  Themes, Apps, and Mods] Yaj00j:
does this mod work with other apps apart from youtube, spotify yet?
[OnePlus 5T  Themes, Apps, and Mods] gunyz:
Can you please link it ? I can't find it
[OnePlus 5T  Themes, Apps, and Mods] osm0sis:
https://xdaforums.com/showpost.php?p=75438442&postcount=127
[Moto E Q&A, Help & Troubleshooting] booo159159:
so here goes,

yesternight,i wanted to try out lineage 15.1 by anderson mendes

well, as the usual procedure, i did a NANDroid backup in twrp 3.2.1.-0 from twrp site

wiped system, cache/dalvik and data, flashed lineage 15.1

tried it out, wanted to go back to my backup ( data and all, necessary features etc )

tried to restore data, first it showed extracttarfork() failed error 255 etc, well i had to make space on my storage,

moving on, restored succesfully, then when i reboot system from recovery, this happens

moto bootlogo appears -> black screen -> wait few seconds -> fastboot opens -> normal powerup -> same thing

it however boots into recovery

anyhow, i found this https://xdaforums.com/showpost.php?p=74320886&postcount=6

but i am hesitant as this is my one and only primary device :rolleyes: :crying:

please suggest your solutions and recommendations

disclaimer - i am in no way bashing any ROM or developer, respective developer have done amazing work on our device and i am grateful for that, but we are flashers and problems happens