Closed rdurish closed 8 months ago
@janusw pushed fix for this for your review.
Trying to reproduce this Android recording issue, I tried it with the Camera.MAUI.Test app on two devices (none of which worked) ...
[ExoPlayerImplInternal] Playback error
[ExoPlayerImplInternal] com.google.android.exoplayer2.ExoPlaybackException: Source error
[ExoPlayerImplInternal] at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:637)
[ExoPlayerImplInternal] at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:607)
[ExoPlayerImplInternal] at android.os.Handler.dispatchMessage(Handler.java:101)
[ExoPlayerImplInternal] at android.os.Looper.loop(Looper.java:164)
[ExoPlayerImplInternal] at android.os.HandlerThread.run(HandlerThread.java:65)
[ExoPlayerImplInternal] Caused by: com.google.android.exoplayer2.source.UnrecognizedInputFormatException: None of the available extractors (FragmentedMp4Extractor, Mp4Extractor, FlvExtractor, FlacExtractor, WavExtractor, AmrExtractor, PsExtractor, OggExtractor, TsExtractor, MatroskaExtractor, AdtsExtractor, Ac3Extractor, Ac4Extractor, Mp3Extractor, AviExtractor, JpegExtractor) could read the stream.
[ExoPlayerImplInternal] at com.google.android.exoplayer2.source.BundledExtractorsAdapter.init(BundledExtractorsAdapter.java:92)
[ExoPlayerImplInternal] at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1017)
[ExoPlayerImplInternal] at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)
[ExoPlayerImplInternal] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
[ExoPlayerImplInternal] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
[ExoPlayerImplInternal] at java.lang.Thread.run(Thread.java:764)
[ExoPlayerImplInternal] Playback error
[ExoPlayerImplInternal] com.google.android.exoplayer2.ExoPlaybackException: Source error
[ExoPlayerImplInternal] at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:637)
[ExoPlayerImplInternal] at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:609)
[ExoPlayerImplInternal] at android.os.Handler.dispatchMessage(Handler.java:102)
[ExoPlayerImplInternal] at android.os.Looper.loopOnce(Looper.java:230)
[ExoPlayerImplInternal] at android.os.Looper.loop(Looper.java:319)
[ExoPlayerImplInternal] at android.os.HandlerThread.run(HandlerThread.java:67)
[ExoPlayerImplInternal] Caused by: com.google.android.exoplayer2.upstream.FileDataSource$FileDataSourceException: java.io.FileNotFoundException: /data/user/0/com.companyname.camera.maui.test/cache/Video.mp4: open failed: ENOENT (No such file or directory)
[ExoPlayerImplInternal] at com.google.android.exoplayer2.upstream.FileDataSource.openLocalFile(FileDataSource.java:203)
[ExoPlayerImplInternal] at com.google.android.exoplayer2.upstream.FileDataSource.open(FileDataSource.java:114)
[ExoPlayerImplInternal] at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:262)
[ExoPlayerImplInternal] at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84)
[ExoPlayerImplInternal] at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1005)
[ExoPlayerImplInternal] at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)
[ExoPlayerImplInternal] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[ExoPlayerImplInternal] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
[ExoPlayerImplInternal] at java.lang.Thread.run(Thread.java:1012)
[ExoPlayerImplInternal] Caused by: java.io.FileNotFoundException: /data/user/0/com.companyname.camera.maui.test/cache/Video.mp4: open failed: ENOENT (No such file or directory)
[ExoPlayerImplInternal] at libcore.io.IoBridge.open(IoBridge.java:574)
[ExoPlayerImplInternal] at java.io.RandomAccessFile.<init>(RandomAccessFile.java:289)
[ExoPlayerImplInternal] at java.io.RandomAccessFile.<init>(RandomAccessFile.java:152)
[ExoPlayerImplInternal] at com.google.android.exoplayer2.upstream.FileDataSource.openLocalFile(FileDataSource.java:184)
[ExoPlayerImplInternal] ... 8 more
[ExoPlayerImplInternal] Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
[ExoPlayerImplInternal] at libcore.io.Linux.open(Native Method)
[ExoPlayerImplInternal] at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
[ExoPlayerImplInternal] at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
[ExoPlayerImplInternal] at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
[ExoPlayerImplInternal] at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:8756)
[ExoPlayerImplInternal] at libcore.io.IoBridge.open(IoBridge.java:560)
[ExoPlayerImplInternal] ... 11 more
MediaManager: Error: Error codename: ERROR_CODE_IO_FILE_NOT_FOUND, Error message: Source error
This confirms that there is a problem on Android 14. @rdurish Did you find an Android version where the recording works?
@janusw It works on android 11 API 30, I don't have access to android 8 to confirm atm
@janusw It works on android 11 API 30
Good to hear :+1:
I don't have access to android 8 to confirm atm
Nevermind, I just wanted to know if there is any version that works. Thanks for the feedback.
@janusw It works on android 11 API 30
On second thought, I'm a bit surprised that you say it works on Android 11: The fix was to request Permissions.Media, which was apparently introduced in Android 10, see https://developer.android.com/training/data-storage/shared/media#media-location-permission.
In any case, there is a report about problems with API 33 (https://github.com/hjam40/Camera.MAUI/issues/130), which probably has the same cause as this one.
@janusw It works on android 11 API 30
On second thought, I'm a bit surprised that you say it works on Android 11
This comment suggests that Android 11 was not working with version 1.4.4: https://github.com/hjam40/Camera.MAUI/issues/104#issuecomment-1913965087
@rdurish Probably I got you wrong, and you were actually saying that it works on Android 11 with your fix?
Correct.
Correct.
Thanks for the clarification!
So, for the record: The original problem (with v1.4.4 and v1.4.5) probably affects Android version 10 and above (API 29+). v1.4.6 should hopefully work on all reasonably recent Android versions now. It was verified on Android 11 and 14 by the two of us :)
I'm not sure if anyone actually cares about the Android 8 problem I mentioned above ...?
Access Denied Error is thrown on start recording.