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

Voice recording crashes on Android 10+ #6989

Closed
jmartinesp opened this issue Sep 1, 2022 · 4 comments
Closed

Voice recording crashes on Android 10+ #6989

jmartinesp opened this issue Sep 1, 2022 · 4 comments
Assignees
Labels
A-Android Version A-Voice-Messages O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Something isn't working: bugs, crashes, hangs and other reported problems Z-Crash

Comments

@jmartinesp
Copy link
Member

Steps to reproduce

The reason is unknown at the moment, but an empty file could cause it. I'm guessing it's either a too short voice message which didn't have its data flushed or some kind of path or issue with the logic that converts the uri into the file to read and send it.

It's not related to the Opus library since it only happens on Android versions >= 10, and VoiceRecorderQ uses the Opus encoder included in the OS.

Outcome

What did you expect?

The voice recording should work and be sent normally.

What happened instead?

It crashes with the error message:

Exception: java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
at android.media.MediaMetadataRetriever.setDataSource(Native Method)

Your phone model

Several

Operating system version

10+

Application version and app store

1.4.31, 1.4.32, 1.4.34

Homeserver

matrix.org

Will you send logs?

No

Are you willing to provide a PR?

Yes

@jmartinesp jmartinesp added T-Defect Something isn't working: bugs, crashes, hangs and other reported problems S-Major Severely degrades major functionality or product features, with no satisfactory workaround O-Uncommon Most users are unlikely to come across this or unexpected workflow labels Sep 1, 2022
@jmartinesp jmartinesp self-assigned this Sep 1, 2022
@jmartinesp jmartinesp changed the title Voice recording crashes on Android 12 Voice recording crashes on Android 10+ Sep 1, 2022
@jmartinesp
Copy link
Member Author

Can confirm, pressing the voice record button and quickly tapping it again throws the expected exception. The referenced voice message file is empty (size: 0B).

@jmartinesp
Copy link
Member Author

It's also preceded by:

2022-09-01 17:34:34.505 4262-4320/? W/MediaProvider: Failed to fetch original file descriptor
    java.io.IOException: stat failed: ENOENT (No such file or directory)
        at com.android.providers.media.MediaProvider.getFileFromFileDescriptor(MediaProvider.java:5822)
        at com.android.providers.media.MediaProvider.getOriginalMediaFormatFileDescriptor(MediaProvider.java:5739)
        at com.android.providers.media.MediaProvider.openTypedAssetFileCommon(MediaProvider.java:7162)
        at com.android.providers.media.MediaProvider.openTypedAssetFile(MediaProvider.java:7143)
        at android.content.ContentProvider$Transport.openTypedAssetFile(ContentProvider.java:548)
        at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:327)
        at android.os.Binder.execTransactInternal(Binder.java:1179)
        at android.os.Binder.execTransact(Binder.java:1143)
     Caused by: android.system.ErrnoException: stat failed: ENOENT (No such file or directory)
        at libcore.io.Linux.stat(Native Method)
        at libcore.io.ForwardingOs.stat(ForwardingOs.java:853)
        at libcore.io.BlockGuardOs.stat(BlockGuardOs.java:420)
        at libcore.io.ForwardingOs.stat(ForwardingOs.java:853)
        at android.app.ActivityThread$AndroidOs.stat(ActivityThread.java:7765)
        at android.system.Os.stat(Os.java:919)
        at com.android.providers.media.MediaProvider.getFileFromFileDescriptor(MediaProvider.java:5816)
        at com.android.providers.media.MediaProvider.getOriginalMediaFormatFileDescriptor(MediaProvider.java:5739) 
        at com.android.providers.media.MediaProvider.openTypedAssetFileCommon(MediaProvider.java:7162) 
        at com.android.providers.media.MediaProvider.openTypedAssetFile(MediaProvider.java:7143) 
        at android.content.ContentProvider$Transport.openTypedAssetFile(ContentProvider.java:548) 
        at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:327) 
        at android.os.Binder.execTransactInternal(Binder.java:1179) 
        at android.os.Binder.execTransact(Binder.java:1143) 
2022-09-01 17:34:34.506 1307-27255/? E/MetadataRetrieverClient: offset (0) bigger than file size (0)

@jmartinesp
Copy link
Member Author

I can also reproduce it some times if the recording gets into an inconsistent state and I lock the device or send the app to background, but I don't really know what causes it. It does look like a race condition of some kind.

@bmarty
Copy link
Member

bmarty commented Sep 7, 2022

Fixed by #7009 I guess.

@bmarty bmarty closed this as completed Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Android Version A-Voice-Messages O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Something isn't working: bugs, crashes, hangs and other reported problems Z-Crash
Projects
None yet
Development

No branches or pull requests

3 participants