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

Glitches on Samsung S8 (Pie) when WiFi enabled #1217

Open
paulorrfilho opened this issue Mar 10, 2021 · 16 comments
Open

Glitches on Samsung S8 (Pie) when WiFi enabled #1217

paulorrfilho opened this issue Mar 10, 2021 · 16 comments
Assignees
Labels
bug Samsung specific to Samsung devices

Comments

@paulorrfilho
Copy link

paulorrfilho commented Mar 10, 2021

Android version(s): 9
Android device(s): Samsung Galaxy S8
Oboe version: 1.5
App name used for testing:
Drumthumper (built locally or Play Store version)

Short description
Glitches consistently

Steps to reproduce
Easier way: Just download the drumthumper app from the Play Store
Or just run the stock project from Github
I also tried various different kBufferSizeInBursts sizes that had no impact.

There is another glitch bug reported for a Galaxy S10, not sure whether they are related, or this something wrong with Samsung devices.

Expected behavior
No glitches

Actual behavior
Consistent glitches

Device
Galaxy S8

Any additional context
Glitch Test
=== STARTED at Wed Mar 10 11:05:47 CST 2021
AutoGlitch
OboeTester (44) v 1.6.2, Oboe v 1.5.1
samsung, SM-G950U1, dreamqlteue
PPR1.180610.011.G950U1UES8DTJ1
========================== #1
Requested:
INP-L, ID = 0, SR = 0, Perf = LL, EX, ch = 1[0]
OUT-L, ID = 0, SR = 0, Perf = LL, EX, ch = 2[0]
Actual:
INP-L, ID = 10, SR = 48000, Perf = NO, SH, ch = 1[0]
OUT-L, ID = 3, SR = 48000, Perf = LL, SH, ch = 2[0]
Did not get requested sharing mode.
SKIP - share
========================== #2
Requested:
INP-L, ID = 0, SR = 0, Perf = LL, EX, ch = 2[0]
OUT-L, ID = 0, SR = 0, Perf = LL, EX, ch = 1[0]
Actual:
INP-L, ID = 10, SR = 48000, Perf = NO, SH, ch = 2[0]
OUT-L, ID = 3, SR = 48000, Perf = LL, SH, ch = 1[0]
Did not get requested sharing mode.
SKIP - share
========================== #3
Requested:
INP-L, ID = 0, SR = 48000, Perf = LL, SH, ch = 1[0]
OUT-L, ID = 0, SR = 48000, Perf = LL, SH, ch = 2[0]
Actual:
INP-L, ID = 10, SR = 48000, Perf = NO, SH, ch = 1[0]
OUT-L, ID = 3, SR = 48000, Perf = LL, SH, ch = 2[0]
Result:
#glitches = 587, #resets = 7, max no glitch = 1.419 secs
SNR = 30.1 db, #locked = 174752, xruns = 0/0, FAIL !!!!, glitch
========================== #4
Requested:
INP-L, ID = 0, SR = 48000, Perf = LL, SH, ch = 2[0]
OUT-L, ID = 0, SR = 48000, Perf = LL, SH, ch = 1[0]
Actual:
INP-L, ID = 10, SR = 48000, Perf = NO, SH, ch = 2[0]
OUT-L, ID = 3, SR = 48000, Perf = LL, SH, ch = 1[0]
Disable background test thread.
Tests finished without exception.
== TEST STOPPED ==

@philburk
Copy link
Collaborator

philburk commented Mar 10, 2021

@paulorrfilho - Thanks for this report. Also thanks for running the AutoGlitch test.

I suspect the bufferSize is too low on the S8. Can you please run the OboeTester TEST OUTPUT.
Tap OPEN then START. Do you hear glitches?
What is the burst size?
What happens if you change the bufferSize?
You can select 1,2,3 bursts or use the fader to get arbitrary sizes.

@paulorrfilho
Copy link
Author

Tried various possibilities and it is still glitching.
Tests: buffer size = 1, 2, 3 and 100% (1536)
API=Unspecified
Performance= Low Latency

Testing with "Performance = None" obviously there are no glitches.

@philburk
Copy link
Collaborator

Thanks for the quick reply.
How often are the glitches? A few per minute? A few per second? Constant?

Can you try opening with 1 or 2 channels to see if there is a difference?

@paulorrfilho
Copy link
Author

Also tested different channels, same thing.
Glitches at every second.
This has been an issue for a long time. My only app ported to Android also has the same issue, kind of got busy with other things and forgot about it. It is reflected in my app's rating :( in comparison with the iOS version.

@paulorrfilho
Copy link
Author

I did try going with SoundPools but the latency is not good enough in my opinion. Also tested AudioTrack, for which I experienced higher latencies. Oboe provides excellent latency results but it glitches so much :(
Not sure whether this is a very specific situation with my Samsung device or it is wide spread among older devices.

@philburk
Copy link
Collaborator

Thanks! We need to know how to workaround this in the QuirksManager.

What was the "burst = ?" for the low latency AAudio tests?
And capacity?
Is MMAP enabled? I don't think it is supported on S8.

Can you please set the Audio API to OpenSL ES in the TEST OUTPUT before you OPEN? Does it glitch?

In your app you could try requesting a larger Buffer Capacity and then increase the Buffer Size higher. At some point it may stop glitching and still be lower latency than the performance mode NONE.

@paulorrfilho
Copy link
Author

burst = 192, capacity = 1536
MMAP is disabled
Changing to OpenSL ES does not have any impact

Increased capacity to 6144 and kBufferSizeInBursts to 16, no difference

@philburk philburk added the Samsung specific to Samsung devices label Mar 10, 2021
@philburk
Copy link
Collaborator

Wow. Thanks again.

So to summarize: if performanceMode=LowLatency then output glitches even when the buffer size is large, stereo or mono, OpenSL ES or AAudio. The S8 is running Pie, Android 9.0. I assume the glitches are heard over the speaker.

It is hard to imagine this could be happening on all S8 devices. Perhaps a driver has gotten into a state where it is disabling interrupts for a long time. That would glitch the Fast Mixer and cause glitches downstream. That would be consistent with the observation.

Can you please try going into Airplane Mode? Pull down from top of screen and look for Airplane icon. That will disable the WiFi and Bluetooth drivers. They can sometimes disable interrupts.

If that does not work, try restarting the phone by long pressing the power button.

(I will report all this data back to Samsung.)

@paulorrfilho
Copy link
Author

Ok, just got some interesting results. All tests using a wired earphone.

  • Turning off the WiFi works! Even with the default settings (burst =192, buffer cap = 1536, burst multiplier = 2)
  • WiFi on will cause glitches regardless of the buffer settings. I tried many different settings: increased buffer capacity to 6144 and burst multiplier to 16, it has no effect.

Any suggestions on how to solve this? Is this an Oboe or Android or Samsung bug?

@paulorrfilho
Copy link
Author

For the record, the first time I turned WiFi off it reduced the glitching issue but it did not solve completely. I had to restart my phone to see the full impact of the WiFi interference.

@paulorrfilho
Copy link
Author

I just found a previous bug raised also related to wifi interference. [https://github.com//issues/1178]
It seems it was fixed in Android 11?

@paulorrfilho
Copy link
Author

Sorry to keep bugging you on this but is there any guidance on how to deal with this? It is not clear to me who is responsible for the bug and whether there is a solution.

@philburk
Copy link
Collaborator

Thanks for the DUP to #1178. That does sound like the same bug. Somehow I missed that.
This is probably a Samsung bug in their WiFi. I expect that the WiFi driver is disabling interrupts, which causes an underflow at the DSP level. So it glitches on both AAudio and OpenSL ES, and because increasing the buffer size did not help.

I don't think there is any workaround that we can do. I will ask Samsung if they have any advice.

@philburk philburk changed the title Glitches Samsung S8 - drumthumper Glitches on Samsung S8 (Pie) when WiFi enabled Mar 15, 2021
@philburk
Copy link
Collaborator

@paulorrfilho - I wonder if this is an Exynos device. What do you get if you enter:

    adb shell getprop ro.arch
    adb shell getpropro.hardware.chipname

@paulorrfilho
Copy link
Author

those commands don't work for me, however adb -s xxxxxxxxx shell getprop does the job.
This is what I got:
[ro.hardware]: [qcom]
[ro.hardware.chipname]: [MSM8998]

Which is a Qualcomm MSM8998 Snapdragon 835 (10 nm) - USA & China

There is a different S8 version in other countries, not mine, which uses a Exynos 8895

@philburk philburk self-assigned this Mar 17, 2021
@philburk
Copy link
Collaborator

Thanks. I passed that on to Samsung.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Samsung specific to Samsung devices
Projects
None yet
Development

No branches or pull requests

2 participants