-
Notifications
You must be signed in to change notification settings - Fork 573
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 although oboeStream->getXRunCount() returns 0 ? Huawei P, 8.0 #402
Comments
What device and version of Android are you using?
Note that GetXRunCount does not work with openSL ES for callback mode.
Glitches may be caused by getting less data than you expect when you read
from the input stream. It can take a while for the input and output streams
to synchronize so that there's always data in the buffer.
preemption could cause a glitch low down in the audio stack and that would
not show up and oboe. That could be caused by a flakey device driver.
Phil Burk
…On Sat, Mar 9, 2019, 2:18 AM PindongaFlores ***@***.***> wrote:
I have glitches even when oboeStream->getXRunCount() returns zero.
What are the possible causes?
My code is based on the example LiveEffectEngine.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#402>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AE76aVeN6v7Yfdi_aixse0jN2uL2S-eqks5vU4p_gaJpZM4bmmaM>
.
|
Try turning on airplane mode to see if the glitches go away.
|
Huawei P Smart on Android 8.0.0 with AAudio (in airplane mode already). Any other ideas? |
found the problem:
|
There was a problem with AAudio on 8.0 involving reference counting. #40 OpenSL ES does not support getXRunCount(). #216
Are those for input or output streams?
You may need to increase the BufferCapacity using the Builder. The "BufferCapacity" is the allocated size. The "BufferSize" is how much of the capacity is being used and determines the current latency. The Capacity must be set using the builder. Size can sometimes be varied after the stream is created. Size cannot exceed the Capacity. |
By the way, my question about the function |
In the 1.1.1 release, Oboe should pick OpenSL ES on 8.0 and earlier versions. Oboe should use AAudio on 8.1 and later versions. If not then that is a bug.
The data path is very different for those devices. The problem could be in Android. We will try to reproduce the issue. The "USB sound card" are you using? |
Here are USB sound cards I tried so far:
|
Does LiveEffecEngine glitch on that phone?
That sounds like a low level USB issue. Do you get more glitches at the beginning and then they happen less often over time? That would be a sign that the streams are slowly getting into sync. Additional buffering between inout and output may be needed.
Sometimes AAudio will have a very short callback of just a few frames. Do you see any small callbacks? |
No, if you try to read more data than is available then the read method will just return the smaller amount. That does not count as an XRun. An XRun for input would happen if you do not read enough data and the input stream fills up and overruns.
We are ordering one of those. It's the only one we can get in the US. Have you tried any other USB devices that do work? I am trying to figure out whether the problem is in the USB device, the Huawei phone, your app, or Android in general. Does does the unmodified LiveEffec demo glitch on that phone? |
The problem is definitely Huawei and/or Android. I tested different things "without" Oboe and I still see the problem. Sorry I didn't check that before.
That is exactly what I thought. I want to investigate that too.
I have only that phone to test.
Not really. After making more tests I see that the glitches happen just randomly. Though, up to now I have only tested < 1 Min.
Yes, I can see clear cycles in the callback, decreasing and then increasing nr. of samples again.
No. But I think 3 out of 3 points clearly in direction Huawei/Android, not the USB devices. |
I think I now understand what you mean: but I don't call the double-buffer with every call to the callback, I first wait for the double-buffer to get filled, and it has enough space for several calls (e.g. 10ms). Anyways, as you can see from my previous comment the glitches occurr playing normal .wav files on the Huawei music player, e.g. in the 300Hz test-audio the glitches can be clearly seen happening quite randomly. |
@philburk : am I getting an answer yet? is Huawei still supported at all?...shall I throw my phone away?...still waiting here...please give me an update |
The sample code, including LiveEffect has been refactored. There have been improvements in the LiveEffect full-duplex stream so that it synchronizes better between input and output. Does that work any better. Also we have added more tests to OboeTester. Have you tried the Glitch test in OboeTester? Also what happens if you try the Record and Play test from OboeTester? Can you upgrade the phone to Android P, 9.0?
Yes. There are complications from trade restrictions. But we can definitely support Huawei for older phones. And Huawei continues to support their phones. Also we have seen issues where input and output streams can get opened at different rates internally, which can result in garbled audio. Can you attach a very short WAV files so we can hear the glitching? We can tell a lot from the sound. |
@philburk: Hi Phil, don't get me wrong. I am happy that you come back to my question BUT I raised it 6 months ago! |
Sorry that we do not always respond quickly to issues. It is because we have been busy working on trying to solve these glitch issues in the underlying code. Regarding your original question about getting glitches when there are no XRun counts. There are several possible reasons:
We are also working on automated glitch tests using Oboe Tester. Then we can test more devices more quickly. We obtained a VIGO speedlink device and will be testing with that.
That sounds like a separate Issue. Please open a separate Issue so the two issues do not get tangled up. Also in the new Issue, please give more details about your request, (Input? Output? Both?) Do you want to combine two USB devices or USB+speaker or USB+microphone? What have you tried? What happened? Please answer in the new Issue, not here. |
attached you find 2 files I recorded by connecting the smartphone to my PC microphone and playing a test.wav file with the standard preinstalled app. I did that once with the USB-Audio device ICY BOX (there you find some glitches) and once with the direct audio jack output (no glitches here as far as I can tell). |
Thanks for the recordings. Very interesting. There was also lots of low energy noise. This gives me some concrete clues that I can give to Huawei. |
Yes, I actually created some time ago a function to remove those glitches and it worked really well because removing inserted silence restored the signal. But I remember there were also many cases where the silences were NOT inserted (the silence region was exactly the length of the missing signal). |
We have not heard back from Huawei and there is not much we can do about this. |
I have glitches even when
oboeStream->getXRunCount()
returns zero.What are the possible causes?
My code is based on the example LiveEffectEngine.
The text was updated successfully, but these errors were encountered: