Skip to content
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

Echo and no background noise suppression during call #125

Open
rinigus opened this issue Mar 6, 2021 · 36 comments
Open

Echo and no background noise suppression during call #125

rinigus opened this issue Mar 6, 2021 · 36 comments
Labels
fix available hybris-10 AOSP 10 based port

Comments

@rinigus
Copy link
Contributor

rinigus commented Mar 6, 2021

During phone call, there is a major echo for the other party (someone calling tama phone) and sounds like the background sound suppression is absent. Should check which microphones were used.

@rinigus rinigus added the hybris-10 AOSP 10 based port label Mar 6, 2021
@rinigus
Copy link
Contributor Author

rinigus commented Mar 6, 2021

All working as it should in AOSP9 based port: logcat_hybris9_works.txt

Echo in AOSP10 based port: logcat_hybris10_echo.txt

@rinigus
Copy link
Contributor Author

rinigus commented Apr 4, 2021

I wonder, whether /sparse/etc/pulse/xpolicy.conf.d/voicecall.conf is needed. Right now, carried over from Seine

@rinigus
Copy link
Contributor Author

rinigus commented Apr 5, 2021

Dropped /sparse/etc/pulse/xpolicy.conf.d/voicecall.conf and not much changed. Probably not needed for Tama.

Interestingly, there is major echo in AOSP10 as well. In my build and seems to be there in PixelExperience as well. So, would have to look how to fix that first.

In general, AOSP10 base (Android itself or SFOS on top of it), seem to have very sensitive microphone with all kind of background being picked up.

@rinigus
Copy link
Contributor Author

rinigus commented Apr 5, 2021

Stock Android 10 does not have such echo as AOSP10 variants

@rinigus
Copy link
Contributor Author

rinigus commented Apr 6, 2021

Experimenting on SFOS hybris-10:

Reverting sonyxperiadev/device-sony-apollo@ee49826 seems to reduce it somewhat. But it is still there

Switching to older ACDB didn't help, unfortunately.

@rinigus
Copy link
Contributor Author

rinigus commented Apr 8, 2021

As from more testing, reverting increase in microphone sensitivity dropped echo to very small, I will revert the commits increasing microphone volumes and we can adjust the levels later as required:

Let's see if we need to change it later.

@rinigus rinigus changed the title Echo and no background noise suppression during call Echo and no background noise suppression during call [fix available] Apr 9, 2021
@rinigus rinigus changed the title Echo and no background noise suppression during call [fix available] Echo and no background noise suppression during call Apr 9, 2021
@rinigus
Copy link
Contributor Author

rinigus commented Apr 9, 2021

Current fix includes building with the reverted commit, as described in https://github.com/sailfishos-sony-tama/main/blob/hybris-10/hadk-sony-xz2.md

@rinigus
Copy link
Contributor Author

rinigus commented Apr 27, 2021

We will have to test it within the port and see what works best. Looks like AOSP devs are too busy with AOSP11 and maybe it is not an issue for XZ3. Let's keep it open over here and be ready to test microphone performance.

@rinigus
Copy link
Contributor Author

rinigus commented Jun 28, 2021

@pagism: Please check whether phone calls work fine for you on XZ3. In terms of echo and microphone sensitivity.

@pagism
Copy link

pagism commented Jun 28, 2021

@rinigus initial test with my landline answer machine, call was loud and clear at both ends, I will have the chance to test it further later this afternoon.

@rinigus
Copy link
Contributor Author

rinigus commented Jun 28, 2021

@pagism: thank you very much! when you get a chance, call someone that you call frequently and ask them to listen whether they hear any echo while they talk to you.

in addition, you could call from landline your phone, let it lay in the other room and try to talk to it using discrete words. you may hear very little echo, but hopefully not much. this test I used for debugging, but, in the end, talking to others is more important one than this artificial test.

@rinigus
Copy link
Contributor Author

rinigus commented Jun 30, 2021

@pagism: any update on this?

@pagism
Copy link

pagism commented Jun 30, 2021

I had a test call and they have not reported any echo and was clear, sound volume on both modes loudspeaker/ear is a bit low.

@rinigus
Copy link
Contributor Author

rinigus commented Jun 30, 2021

Is this sound volume on XZ3 side or sound on the other side? To figure out if it is XZ3 microphone issue or not

@pagism
Copy link

pagism commented Jun 30, 2021

the zx3 side

@rinigus
Copy link
Contributor Author

rinigus commented Jun 30, 2021

So, XZ3 microphone was working fine then and it is more about call volume on XZ3 side. I presume you did try to increase the volume, right?

@pagism
Copy link

pagism commented Jun 30, 2021

yes, i had to increase the volume a lot. compared to xa2 which is very loud. not a big issue tho, also during the call i was outside

@rinigus
Copy link
Contributor Author

rinigus commented Jul 1, 2021

In this case, we have the fix for echo during the calls confirmed for all devices (XZ2 XZ2c XZ3). Fix is to revert microphone boosting patch as done in SFOS builds. Closing

@rinigus rinigus closed this as completed Jul 1, 2021
@pagism
Copy link

pagism commented Dec 3, 2021

We might have to re-open this issue. I have to use my XZ3 as my main driver for the next few weeks and I have the chance to test phone calls in normal use. In both 4.2 and 4.3 releases echo can be heard at the other end.
Using headphones removes the echo. Also while using headphones reducing the sound volume to 1/5 the audio signal is like muted.

@rinigus
Copy link
Contributor Author

rinigus commented Dec 3, 2021

If you hear echo, you would have to reduce mic volumes even further. See sonyxperiadev/device-sony-akatsuki@1313e29 and https://github.com/sailfishos-sony-tama/main/blob/hybris-10/patches/device/sony/akatsuki/0001-revert-mixer_paths-Fix-microphone-low-capture-volume.patch for reference

On your device, edit /vendor/etc/mixer_paths.xml and start reducing gains to reduce echo

@pagism
Copy link

pagism commented Dec 3, 2021

there are several sets that need adjusting and it's not very clear which, I lowered speaker-mono-mic another option is to adjust the mic gain values.
do I have to restart a service so new values become effective?

@rinigus
Copy link
Contributor Author

rinigus commented Dec 4, 2021

I suspect you have to restart, but don't know for sure. As for many tunable parameters - yes, there are many. Cannot help with the selection of them either, you would have to experiment.

@rinigus
Copy link
Contributor Author

rinigus commented Dec 6, 2021

Reopening as I got echo feedback as well, on XZ2

@rinigus rinigus reopened this Dec 6, 2021
@pagism
Copy link

pagism commented Dec 6, 2021

It's a bit tricky to test adjustments, I managed already to make angry few friends lol. Btw using headphones/mic set can avoid that annoying problem. There is an issue in Echo on Sailfish X during call but no conclusive answer.

/vendor/etc/mixer_paths.xml has several settings to adjust, DEC7 and DEC8 seems to be the two mics. There are several groups in that setting configuration file (current values in brackets):

  • volume controls (84/84)
  • adj gain offset calibration (94/94)
  • stereo mic (86/90)
  • speaker mono mic (92/-)
  • voice rec mic (90/86)
  • camcoder mic (86/90)
  • capture ahc (83/83)

Lowering mic sensitivity e.g. in either gain or speaker mono groups will reduce echo to some degree, unless there is another active echo cancelling process that we might miss? I will be able to experiment with some of those values later this week.

@rinigus
Copy link
Contributor Author

rinigus commented Dec 6, 2021

I think we have to follow the same pattern as was used by others and reverted. By just lowering them further... But looks like you have done some more thorough research on it.

@pagism
Copy link

pagism commented Dec 19, 2021

this link might be relevant, I think it's more than an echo cancellation issue than adjusting mic sensitivity.

@rinigus
Copy link
Contributor Author

rinigus commented Dec 19, 2021

Maybe, depends on whether you have a case or not. So far, I have had only one complaint about echo and echo with that link has not resurfaced. Maybe mic is too quiet, but that I have to test a bit more.

In Tama case, it did help to drop the levels as I did. But feel free to experiment and see where it brings you. I am quite sure we engage the correct microphones during a call. You could check that as well via logcat - I'd prefer to continue work on other project that is in the middle right now (not port specific).

@KeTbl4
Copy link

KeTbl4 commented Jan 12, 2022

Hello. This problem is also relevant for me (h8324 xz2c). Tell me how to use it .xml ? In order for fix to work, you need to open the file in the editor and change the parameters manually ? Or is there a way through the console ?

@pagism
Copy link

pagism commented Jan 12, 2022

there is also pactl commands that might be an easier way to experiment, you can adjust pulseaudio server settings like:
pactl set-sink-volume2 120% for speakers
pactl set-source-volume2 120% for microphone
but I am not familiar with any of those settings

@rinigus
Copy link
Contributor Author

rinigus commented Jan 12, 2022

That XML could be edited by any editor you are comfortable with. Don't know if you have to reboot after each change, you would have to establish it. It is pretty much manual process and trying to figure out what makes sense to change.

@KeTbl4
Copy link

KeTbl4 commented Jan 12, 2022

Don't know if you have to reboot after each change, you would have to establish it.

maybe there is a ready - made file for replacement ? Or do I have to do everything with pens ? and where does the essence of the problem come from ? is it really only the three of us who have been affected by this problem ?

@KeTbl4
Copy link

KeTbl4 commented Jan 12, 2022

there is also pactl

I am ready to enter the necessary parameters into the console . just specify which ones :)

@pagism
Copy link

pagism commented Jan 12, 2022

I do not know the necessary parameters, and might be very difficult to find them. One way is to experiment, I suggested pactl as it can be easier to apply temporary controls, e.g.

[defaultuser@XperiaXZ3 ~]$ pactl list sinks short
0	sink.primary_output	module-droid-card.c	s16le 2ch 48000Hz	SUSPENDED
1	sink.deep_buffer	module-droid-card.c	s16le 2ch 48000Hz	SUSPENDED
2	sink.null	module-null-sink.c	s16le 2ch 48000Hz	SUSPENDED
[defaultuser@XperiaXZ3 ~]$ pactl list sources short
0	sink.primary_output.monitor	module-droid-card.c	s16le 2ch 48000Hz	SUSPENDED
1	sink.deep_buffer.monitor	module-droid-card.c	s16le 2ch 48000Hz	SUSPENDED
2	source.droid	module-droid-card.c	s16le 2ch 48000Hz	SUSPENDED
3	sink.null.monitor	module-null-sink.c	s16le 2ch 48000Hz	SUSPENDED
4	source.null	module-null-source.c	s16le 2ch 48000Hz	SUSPENDED

I guess the ID of those can be used to set its value, with set-sink-volume[x] parameters?

@rinigus
Copy link
Contributor Author

rinigus commented Jan 12, 2022

To my knowledge, that echo which was experienced on Dec 6 was the only one for me. No recent reports and echo experienced anymore. So, it seemed like it came out on random and disappeared for mine XZ2.

maybe there is a ready - made file for replacement ? Or do I have to do everything with pens ?

not sure what you mean by that. No, there is no ready replacement. There is a file on your device (/vendor/etc/mixer_paths.xml) that you can try to modify. Maybe it is possible to do with pactl, but I don't know for sure. It may not include mics involved in noise cancelling.

When you call, check that noise cancelling is involved. For that, use /usr/libexec/droid-hybris/system/bin/logcat as root.

As an example, I get voice-dmic-ef started:

01-12 20:13:04.527  5721  5721 D audio_hw_primary: select_devices: changing use case voicemmode1-call output device from(0: , acdb -1) to (20: voice-handset, acdb 7)
01-12 20:13:04.527  5721  5721 D audio_hw_primary: select_devices: changing use case voicemmode1-call input device from(0: , acdb -1) to (151: voice-dmic-ef, acdb 6)

where does the essence of the problem come from ? is it really only the three of us who have been affected by this problem ?

No idea, cannot reply to any of those two questions.

I guess the ID of those can be used to set its value, with set-sink-volume[x] parameters?

I think that noise cancelling is done on Android backend and is not exposed to PA, at least not fully. But I could be wrong.

@teleshoes
Copy link

  • microphone volume is absurdly quiet on tama (xz2c)
  • editing the XML works fine
  • changing with pactl does NOTHING. all source/sink volumes are ignored by phone call. (source#2 is droid.source). changing the port from call-input to handset does nothing. i have no idea why.

@rinigus
Copy link
Contributor Author

rinigus commented May 31, 2022

Interesting, when I last tested on my xz2c, mic levels were fine. It is possible that something has changed in between or we have some differences between our models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix available hybris-10 AOSP 10 based port
Projects
None yet
Development

No branches or pull requests

4 participants