-
Notifications
You must be signed in to change notification settings - Fork 663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redmi Note 9T 5G (cannon/cannong) In-Call volume not adjustable #1908
Comments
Yup that's a global mediatek issue. So far I haven't found anything
relevant to this.
Could you make the exact same logcat, but on stock rom?
Le ven. 18 juin 2021 à 16:19, David ***@***.***> a écrit :
… I can't adjust the in-call volume on my device. Logcat suggests the button
press is being recognised (and the change displays on the slider on
screen), but there's no effect on the volume. Full Logcat is attached.
Here's an example of a relevant section after a volume button press:
logcat.txt
<https://github.com/phhusson/treble_experimentations/files/6677529/logcat.txt>
06-18 14:27:53.461 1722 3794 D MediaSessionService: Adjusting com.android.server.telecom/HeadsetMediaButton (userId=0) by -1. flags=4113, suggestedStream=-2147483648, preferSuggestedStream=false
06-18 14:27:53.464 1722 3794 D MediaSessionService: dispatchVolumeKeyEvent, pkg=com.google.android.dialer, opPkg=com.google.android.dialer, pid=10813, uid=10151, asSystem=true, event=KeyEvent { action=ACTION_UP, keyCode=KEYCODE_VOLUME_DOWN, scanCode=114, metaState=0, flags=0x8, repeatCount=0, eventTime=6518763, downTime=6518636, deviceId=2, source=0x101, displayId=-1 }, stream=-2147483648, musicOnly=false
06-18 14:27:53.464 1722 3794 D MediaSessionService: Adjusting com.android.server.telecom/HeadsetMediaButton (userId=0) by 0. flags=4116, suggestedStream=-2147483648, preferSuggestedStream=false
06-18 14:27:53.474 1017 1197 I hwcomposer: [DPY] receive refesh frquest from driver: type[4]
06-18 14:27:53.474 1017 1197 I hwcomposer: [HWC] fire a callback of refresh to SF
06-18 14:27:53.476 1937 2237 I vol.Events: writeEvent level_changed STREAM_VOICE_CALL 3
06-18 14:27:53.480 1610 1620 D AudioALSAHardware: setVoiceVolume(), volume = 0.600000, mUseTuningVolume = 0
06-18 14:27:53.480 1610 1620 D AudioALSAStreamManager: setVoiceVolume(), volume = 0.600000
06-18 14:27:53.480 1610 1620 D AudioMTKGainController: setVoiceVolume(), index = 4, devices = 0x1, mode = 2, mBand = 1, mNetwork = 0, mVoiceVolume = 0.600000
06-18 14:27:53.480 1610 1620 D SpeechDriverOpenDSP: SetDownlinkGain(), gain = 0x0, old mDownlinkGain = 0x0
06-18 14:27:53.481 1610 1620 D AudioMTKGainController: ApplyMicGain(), analogidx = 2, mSceneIndex = 0, _mic_mode = 1, _gain_device = 0, mode = 2, micgain = 23, mULTotalGain = 164, mBand = 1, mNetwork = 0
06-18 14:27:53.481 1610 1620 E AudioMTKGainController: SetAdcPga3(), Error: get mixer ctl fail,
06-18 14:27:53.481 1610 1620 D SpeechDriverOpenDSP: SetUplinkGain(), gain = 0x3c, old mUplinkGain = 0x3c
06-18 14:27:53.481 1610 1620 D AudioMTKGainController: GetSPKGain
06-18 14:27:53.481 1610 1620 D AudioMTKGainController: GetSPKGain i = 0 index = 31
06-18 14:27:53.481 1610 1620 D AudioMTKGainController: updateSidetone(), DSP_ST_GAIN = 0, positive_gain_db = 0, dlPGAGain 0, sidetone 0, ulGain 15
06-18 14:27:53.481 1610 1620 D AudioMTKGainController: ApplySideTone gainDevice 0, sidetone 0, updated_sidetone 0
06-18 14:27:53.490 1937 2237 I vol.Events: writeEvent key STREAM_VOICE_CALL 3
06-18 14:27:53.500 1937 1937 I vol.Events: writeEvent show_dialog volume_changed keyguard=false
I'm also having an issue with headphones not being recognised by the audio
jack, which could be related as it's tied in to the audio system, but the
in-call volume problem is more of an issue right now.
I've already set "Bluetooth workarounds" to "Mediatek" and "Force-disable
A2DP offload" to "on". This fixed bluetooth audio output, but not the
in-call volume issue.
So far I've tried copying over the audio_policy files from the stock
system image, but could see no change in my issue.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1908>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAA4OVDS4JPR3VBRWHRPY3TTNIXNANCNFSM465YRDMQ>
.
|
I'm a bit reluctant to go back to the stock rom at the moment as there's not currently a custom recovery for this phone that will do a full backup. I'll ask on the XDA forum to see if anyone can provide a stock logcat with in-call volume adjustments. If not I'll do it myself tomorrow. |
Considering this issue is pretty widespread, it can even come from people
with other mediatek devices with same issue.
Le dim. 20 juin 2021 à 16:58, David ***@***.***> a écrit :
… I'm a bit reluctant to go back to the stock rom at the moment as there's
not currently a custom recovery for this phone that will do a full backup.
I'll ask on the XDA forum to see if anyone can provide a stock logcat with
in-call volume adjustments. If not I'll do it myself tomorrow.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1908 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAA4OQC3RBX7O3M4PZ7GTTTTX62PANCNFSM465YRDMQ>
.
|
I've gone ahead and done it myself. Please see logcat attached. The "KeyEvents" show where I've done the volume button presses. e.g.
|
Just to add, my headphones issue was solved by turning on "Use alternate way to detect headsets". The in-call volume is still an issue though. |
I guess the trick is in I'll dig with that. Thanks. |
Thanks. I was wondering if it's something to do with the "mBand" setting? On the stock rom it's: and on the custom rom it's: I had a browse around some code on GitHub (https://github.com/iykex/vendor_mediatek_proprietary_hardware/blob/a592a52719cb43d2364e9c4d641f68ff6442d959/audio/common/V3/aud_drv/AudioALSAGainController.cpp and https://github.com/PixelExperience/vendor_mediatek-opensource/blob/eleven/external/audio_utils/common_headers/gain_table/AudioGainTableParam.h), and it looks like the stock rom sets it to GAIN_SPEECH_NB and the custom rom sets it to GAIN_SPEECH_WB. I have no idea what this actually means in practice though? I couldn't find info on what the "band" means in this context. |
I've done a bit more digging. GAIN_SPEECH_NB means Narrow Band and GAIN_SPEECH_WB means Wideband, which from what I gather Wideband is VoLTE. I had a go at enabling VoLTE via the "IMS Features" to see if that would help, but I've turned on what it would let me, and "Install IMS APK" says "NOT SUPPORTED", so that idea is out. I think what's happening is that the custom rom is assuming the call is in VoLTE mode, and attempting to change the volume for a VoLTE call, but in reality the call is running in standard narrow band mode, so the volume change isn't being applied - but I might still be completely wrong! |
I tried turning off VoLTE using any VoLTE setting from getprop: I'm still seeing mBand = 1 in logcat when trying an in-call volume change: |
Before going into side-effect stuff, you first need to look at first-effects -_-' The line I quoted So yeah if the command to set volume is not set, volume won't be set. No need to look into VoLTE for that |
I have attached my logcats. I am not sure if it's the same issue as my logcat looks a bit different gsi: Both logs are somewhat old, but i can get new ones alongside anything else you need. |
Point taken! I've downloaded the source tree using the build.sh. I've run a search for "AudioALSAStreamOut", "AudioMTKGainController", and "AudioALSAHardware". But found no results. I can see results for the "setVoiceVolume" function, but these tie up to "AudioFlinger". Am I even looking in the right place? |
Yes. That's precisely the issue. volumeDevice/volumeIndex commands are proprietary mediatek, and need to be added for this to work. |
there is some code on the Github |
I can provide ALPS android 9.0 source codes (t-alps-release-p0.mp1-V5.75.mt6750) if it can help. I do not yet have enough knowledge to deal with this problem alone. |
I've had a look at the sound controller down at the device level. If I run the following command as su during a call (using tinymix) I can reduce the in-call volume (CANNONG specific): This sets "Handset Volume" to 16. The number needs to be between 0 and 18, and then 31 is mute. 0 is loud, 18 is quiet (I.E. the higher the number the quieter it is). Mileage will vary depending on your device. You probably won't be lucky enough that "Handset Volume" is item 390 in tinymix for other devices, so you'll need to run tinymix yourselves and find out which number "Handset Volume" is registered under. Something like this should help: @phhusson I don't know the feasibility of implementing this somehow as a framework code patch? It would obviously be very hacky. |
You should be able to do
`tinymix "Handset Volume" 16`
But I don't want that in my GSI, since I'm expecting that the audio system parameters I've given earlier are enough to set volume
19 juil. 2021 18:24:43 David ***@***.***>:
… I've had a look at the sound controller down at the device level. If I run the following command as su during a call (using tinymix) I can reduce the in-call volume (CANNONG specific):
*tinymix 390 16*
This sets "Handset Volume" to 16. The number needs to be between 0 and 18, and then 31 is mute. 0 is loud, 18 is quiet (I.E. the higher the number the quieter it is).
Mileage will vary depending on your device. You probably won't be lucky enough that "Handset Volume" is item 390 in tinymix for other devices, so you'll need to run tinymix yourselves and find out which number "Handset Volume" is registered under. Something like this should help:
*tinymix | grep 'Handset Volume'*
@phhusson[https://github.com/phhusson] I don't know the feasibility of implementing this somehow as a framework code patch? It would obviously be very hacky.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub[#1908 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AAAA4OU3T6TLJ3JLZARVGU3TYRGUXANCNFSM465YRDMQ].
[data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAAjSURBVGiB7cEBDQAAAMKg909tDwcUAAAAAAAAAAAAAADApwExOAABR9ZGcwAAAABJRU5ErkJggg==###24x24:true###][Image de pistage][https://github.com/notifications/beacon/AAAA4OQCLYKWE66GQX4WBWLTYRGUXA5CNFSM465YRDM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGSOLF4Y.gif]
|
That's good to hear. We will wait for Your implementation. Thank You |
I didn't say I would do it... I don't have much time available
19 juil. 2021 20:39:52 xenon205 ***@***.***>:
…> But I don't want that in my GSI, since I'm expecting that the audio system parameters I've given earlier are enough to set volume
>
That's good to hear. We will wait for Your implementation. Thank You
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub[#1908 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AAAA4OQDIEWJUGYA7RUXLQ3TYRWPRANCNFSM465YRDMQ].
[data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAAjSURBVGiB7cEBDQAAAMKg909tDwcUAAAAAAAAAAAAAADApwExOAABR9ZGcwAAAABJRU5ErkJggg==###24x24:true###][Image de pistage][https://github.com/notifications/beacon/AAAA4OTBQCC6JXOBERHWD53TYRWPRA5CNFSM465YRDM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGSPAPHI.gif]
|
Fair enough maybe some one else will be able to pick up gloves :) |
As a short term solution, I've hacked together a script which can be used in Magisk (create it in /data/adb/service.d/).
It makes calls to the Audio service to work out Android's idea of what the volume should be, then calculates and applies it to the Hardware using tinymix. If anyone wants to try it out let me know how you get on. |
Doesn't seem to work for me. I created a .sh file called "InCall_Volume.sh" and pasted your script into the file. Then I copied the file to /data/adb/service.d and restarted my phone. I don't see this in Magisk (probably because it's not a module), but I can see in Magisk logs it says "running service.d scripts". I made a test call and tried adjusting volume and it doesn't do anything... but it could be because I'm using OctaviOS and not Lineage? UPDATE: If I run "tinymix 390 16" in Termux while in a call, it lowers my volume so it is definitely working. However, the script itself doesn't seem to work... If I run the script in Termux, I get this: line 42: syntax error near unexpected token 'elif' UPDATE 2: UPDATE 3:
I don't know why, but if I copy the script from my PC to my microSD card and then from there, copy it to service.d, it won't work. I have to edit the script in Termux first. Also, you may need to put in "sleep 10" (without quotations) in the 2nd line of the script. I read somewhere that this is required, as the script may be executed too quickly during startup and not actually run or something like that. Anyway, I just switched back to OctaviOS and did all the above and confirmed that the fix is working. My only concern is, does this script create a wakelock or use up battery? If it needs to be running/monitoring in the background constantly, then I'm not sure how good this is for the battery. Having said that, I also don't understand the script and I'm not a programmer.... |
Great to hear you got it working, and thanks for the tip on the "sleep 10". I've had the script running on my phone for a few months now, and I haven't noticed any impact on the battery (I charge my phone each day, and after a full day of my use I still have over 70% battery left). I think most phones have a lot more running in the background anyway, so this script is pretty lightweight. |
* add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * kang idea by phhusson/treble_experimentations#1908
* add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * kang idea by phhusson/treble_experimentations#1908
* add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * kang idea by phhusson/treble_experimentations#1908
* add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * kang idea by phhusson/treble_experimentations#1908
* add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * kang idea by phhusson/treble_experimentations#1908
* add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * kang idea by phhusson/treble_experimentations#1908
* add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * kang idea by phhusson/treble_experimentations#1908 Change-Id: I0599b27c0d742c06d0b6ee15014f5063a61100d4
* add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * kang idea by phhusson/treble_experimentations#1908 * also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * kang idea by phhusson/treble_experimentations#1908 * also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * kang idea by phhusson/treble_experimentations#1908 * also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
I understand this is beyond the scope of treble but here is a simple audio parameters config fix which fixes in call volume adjustment for the earpiece. This is at least better than the bash scripts some people have been temporarily using hence why I am posting this here, just sharing knowledge. |
* add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * kang idea by phhusson/treble_experimentations#1908 * also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
This is a much better solution. Tested and confirmed working using Magisk (MTKInCallVolume.zip). I'd be interested to know if this fixes the global Mediatek issue or just our Note9Ts? |
* Add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * Kang idea by phhusson/treble_experimentations#1908 * Refactored code * Also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* Add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * Kang idea by phhusson/treble_experimentations#1908 * Refactored code * Also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* Add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * Kang idea by phhusson/treble_experimentations#1908 * Refactored code * Also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* Add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * Kang idea by phhusson/treble_experimentations#1908 * Refactored code * Also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* Add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * Kang idea by phhusson/treble_experimentations#1908 * Refactored code * Also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* Add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * Kang idea by phhusson/treble_experimentations#1908 * Refactored code * Also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* Add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * Kang idea by phhusson/treble_experimentations#1908 * Refactored code * Also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* Add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * Kang idea by phhusson/treble_experimentations#1908 * Refactored code * Also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* Add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * Kang idea by phhusson/treble_experimentations#1908 * Refactored code * Also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* Add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * Kang idea by phhusson/treble_experimentations#1908 * Refactored code * Also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* Add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * Kang idea by phhusson/treble_experimentations#1908 * Refactored code * Also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* Add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * Kang idea by phhusson/treble_experimentations#1908 * Refactored code * Also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* Add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * Kang idea by phhusson/treble_experimentations#1908 * Refactored code * Also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* Add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * Kang idea by phhusson/treble_experimentations#1908 * Refactored code * Also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* Add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * Kang idea by phhusson/treble_experimentations#1908 * Refactored code * Also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* Add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * Kang idea by phhusson/treble_experimentations#1908 * Refactored code * Also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* Add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * Kang idea by phhusson/treble_experimentations#1908 * Refactored code * Also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* Add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * Kang idea by phhusson/treble_experimentations#1908 * Refactored code * Also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* Add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * Kang idea by phhusson/treble_experimentations#1908 * Refactored code * Also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* Add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * Kang idea by phhusson/treble_experimentations#1908 * Refactored code * Also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* Add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * Kang idea by phhusson/treble_experimentations#1908 * Refactored code * Also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
* Add shell daemon for correcting volumes using tinymix (don't forget add this tool to build) * Kang idea by phhusson/treble_experimentations#1908 * Refactored code * Also adapt channels and sh path for A12 Signed-off-by: 7Soldier <reg.fm4@gmail.com>
This method's does not work for me(( |
I can't adjust the in-call volume on my device. Logcat suggests the button press is being recognised (and the change displays on the slider on screen), but there's no effect on the volume. Full Logcat is attached. Here's an example of a relevant section after a volume button press:
logcat.txt
I'm also having an issue with headphones not being recognised by the audio jack, which could be related as it's tied in to the audio system, but the in-call volume problem is more of an issue right now.
I've already set "Bluetooth workarounds" to "Mediatek" and "Force-disable A2DP offload" to "on". This fixed bluetooth audio output, but not the in-call volume issue.
So far I've tried copying over the audio_policy files from the stock system image, but could see no change in my issue.
The text was updated successfully, but these errors were encountered: