oboe icon indicating copy to clipboard operation
oboe copied to clipboard

ErrorInternal when trying to open a stream

Open GayleDaVid opened this issue 4 years ago • 7 comments

Android version(s):12,11,10,9,8.1.0 Android device(s): Samsung Galaxy A Variants, Vivo 1807, Vivo 1811, vivo 1904, vivo 1906, vivo 2007, CPH2239, CPH2161, V2048, V2026, Redmi Note 9, Redmi 9A, Redmi 9, POCO X3 Pro, Realme C21-Y, realme Narzo 20, RMX3231, realme 6, realme 7, ANE-LX1, OnePlus Nord2 5G, vivo 1718,... Oboe version: 1.6.1 App name used for testing: Smule

Short description When opening a stream you are presented with the ErrorCode ErrorInternal

Steps to reproduce Select 'Sing' on any song from the Songbook, Select any method; Solo, Group, Duet, Join Error code shown

Expected behavior no error code

Actual behavior error code

Any additional context Point to note, that the record permission is in the manifest and the permission is requested from the user.

    stream_builder.setDirection(stream_direction);  //Direction::Output || Direction::Input
    stream_builder.setSampleRate(sample_Rate); // 48000
    stream_builder.setFramesPerDataCallback(buffer_size); //240 , 192, 1024, 256
    stream_builder.setSampleRateConversionQuality(oboe::SampleRateConversionQuality::Medium);
    stream_builder.setFormat(/AudioFormat::I16); 
    stream_builder.setSharingMode(oboe::SharingMode::Exclusive);
    stream_builder.setPerformanceMode(PerformanceMode::LowLatency);

The value we set for the setFramesPerDataCallback and setSampleRate are obtained from AudioManager. We were not able to reproduce this in house, however clients report experiencing it

GayleDaVid avatar Feb 10 '22 15:02 GayleDaVid

It looks like what you are doing is fine. And the failure happens rarely. I suspect it may be related to device specific failures, maybe at the hardware level.

There is not much we can do without a bugreport. If you can reproduce it, or get a bugreport from the field then we would be very happy to review it.

philburk avatar Feb 16 '22 17:02 philburk

Hey Phil I was able to obtain a bugreport. I have attached them to the issue tracker which can be found here https://issuetracker.google.com/issues/227624430

GayleDaVid avatar Apr 01 '22 15:04 GayleDaVid

The bugreport that you sent said the phone had been running for 42 days. Many activities were being killed around the same time. Internally we reboot several times per day when developing Android. I suspect that fragmentation, resource leaks, and other issues may have built up. We will continue to investigate this.

What devices crash most often? Any statistics you can share may be helpful.

philburk avatar Apr 06 '22 21:04 philburk

Hello Phil thanks for continuing to look into this. The device which we obtained the bugreport from was from our internal testing as we were unable to get any data from clients.

What devices crash most often? Any statistics you can share may be helpful.

So far we have seen 70% of devices on Android 11, 17% Android 8.1.0, 10% Android 10, 4% Android 9 48% on Vivo devices Vivo 1807, vivo 1811, vivo 1906, vivo 1904, v2026, V2068, V2033, V2037, vivo 1718, V2043, vivo 2015, V2102, vivo 2007 30% Samsung, Galaxy A12, Galaxy A10, Galaxy A22 5G, Galaxy M11, Galaxy A02s, Galaxy 10s, Galaxy A03s, Galaxy A20, Galaxy A03 Core, Galaxy A32 5G 11% Realme - RMX3231, realme C12, C21-Y, Narzo 50A, Narzo 20, 6 ,7, 8 5g, C21, C15, Narzo 30 9% Xiaomi - Redmi Note 9, Redmi 9, Redmi 9A, Redmi Note 8, POCO X3 Pro, Redmi 10 2022, Redmi Note 10 Pro, Mi A2 Lite

We will continue to try to reproduce in house to give more details/bugreports whenever we are able to experience it again.

GayleDaVid avatar Apr 08 '22 07:04 GayleDaVid

So far we have seen 70% of devices on Android 11, 17% Android 8.1.0, 10% Android 10, 4% Android 9

So you are not seeing any failures on Android 12. So this issue may have been fixed in 12. Or the number may be too low to measure.

philburk avatar Apr 13 '22 21:04 philburk

So you are not seeing any failures on Android 12. So this issue may have been fixed in 12. Or the number may be too low to measure.

From the previous report, it seemed like the value was too small to measure. Today I am able to see Android 12 in the report as well, I believe this is as more users are starting to adopt the Android 12 OS. As on today the stats are;

  • 69% Android 11
  • 16% Android 8
  • 10 %Android 9
  • 1% Android 12 Vivo devices with 49%, samsung with 29%, Xiaomi 8%, realme 7%, other devices such as Hauwei, Motorolla, Oppo, LGE with 7%.

GayleDaVid avatar Apr 14 '22 13:04 GayleDaVid

This is unrelated to the ErrorInternal, but...

The value we set for the setFramesPerDataCallback and setSampleRate are obtained from AudioManager.

Note that you should only setFramesPerDataCallback if you need a particular callback size or a fixed callback size. AAudio will choose its own optimal buffer size. For Legacy code the callback size may vary when there is sample rate conversion.

philburk avatar Apr 16 '22 16:04 philburk