Originally created by @jmt-gh on GitHub (Jun 6, 2022).
Steps to reproduce
Get a large fsingle M4B file in to ABS (~1.3GB, though might vary depending on phone model)
Open abs-app
Start logcat
Start streaming
Notice it goes from direct -> transcode
Notice in logcat that it fails to stream direct due to an OOM, and falls back to transcoding
Expected behaviour
It should handle the direct playback better, and support the larger file without the need to fallback to transcoding
Actual behaviour
It falls back to transcoding due to OOMing
Environment data
Audiobookshelf Version:
Android App?
iOS App?
Android Issue
Android version: Android 11
Device model: OnePlus 6
Stock or customized system: Stock
Originally created by @jmt-gh on GitHub (Jun 6, 2022).
### Steps to reproduce
1. Get a large fsingle M4B file in to ABS (~1.3GB, though might vary depending on phone model)
2. Open abs-app
3. Start logcat
4. Start streaming
5. Notice it goes from direct -> transcode
6. Notice in logcat that it fails to stream direct due to an OOM, and falls back to transcoding
### Expected behaviour
It should handle the direct playback better, and support the larger file without the need to fallback to transcoding
### Actual behaviour
It falls back to transcoding due to OOMing
### Environment data
Audiobookshelf Version:
- [x] Android App?
- [ ] iOS App?
#### Android Issue
Android version: Android 11
Device model: OnePlus 6
Stock or customized system: Stock
adam
added the bug label 2026-04-24 23:11:23 +02:00
I have the same issue happening with a particular audiobook.
Log
03-27 18:43:37.028 27000 27170 I iobookshelf.ap: Clamp target GC heap from 206MB to 192MB
03-27 18:43:37.028 27000 27170 I iobookshelf.ap: Alloc concurrent copying GC freed 54644(1902KB) AllocSpace objects, 3(152KB) LOS objects, 4% free, 182MB/192MB, paused 759us total 78.038ms
03-27 18:43:37.029 27000 27016 I iobookshelf.ap: WaitForGcToComplete blocked Background on HeapTrim for 176.182ms
03-27 18:43:37.029 27000 27170 W iobookshelf.ap: Throwing OutOfMemoryError "Failed to allocate a 33322704 byte allocation with 9799456 free bytes and 9569KB until OOM, target footprint 201326592, growth limit 201326592" (VmSize 31614788 kB)
03-27 18:43:37.029 27000 27170 I iobookshelf.ap: Starting a blocking GC Alloc
03-27 18:43:37.029 27000 27170 I iobookshelf.ap: Starting a blocking GC Alloc
03-27 18:43:37.042 27000 27170 I iobookshelf.ap: Alloc young concurrent copying GC freed 383(105KB) AllocSpace objects, 0(0B) LOS objects, 4% free, 182MB/192MB, paused 81us total 12.588ms
03-27 18:43:37.042 27000 27170 I iobookshelf.ap: Starting a blocking GC Alloc
03-27 18:43:37.092 27000 27170 I iobookshelf.ap: Clamp target GC heap from 206MB to 192MB
03-27 18:43:37.092 27000 27170 I iobookshelf.ap: Alloc concurrent copying GC freed 33(63KB) AllocSpace objects, 0(0B) LOS objects, 4% free, 182MB/192MB, paused 56us total 49.740ms
03-27 18:43:37.092 27000 27170 I iobookshelf.ap: Forcing collection of SoftReferences for 31MB allocation
03-27 18:43:37.092 27000 27170 I iobookshelf.ap: Starting a blocking GC Alloc
03-27 18:43:37.156 27000 27170 I iobookshelf.ap: Clamp target GC heap from 206MB to 192MB
03-27 18:43:37.156 27000 27170 I iobookshelf.ap: Alloc concurrent copying GC freed 113(20KB) AllocSpace objects, 0(0B) LOS objects, 4% free, 182MB/192MB, paused 63us total 63.338ms
03-27 18:43:37.156 27000 27170 W iobookshelf.ap: Throwing OutOfMemoryError "Failed to allocate a 33322704 byte allocation with 9813192 free bytes and 9583KB until OOM, target footprint 201326592, growth limit 201326592" (VmSize 31614788 kB)
03-27 18:43:37.158 27000 27170 E LoadTask: OutOfMemory error loading stream
03-27 18:43:37.158 27000 27170 E LoadTask: java.lang.OutOfMemoryError: Failed to allocate a 33322704 byte allocation with 9813192 free bytes and 9583KB until OOM, target footprint 201326592, growth limit 201326592
03-27 18:43:37.158 27000 27170 E LoadTask: at com.google.android.exoplayer2.extractor.mp4.AtomParsers.parseStbl(AtomParsers.java:688)
03-27 18:43:37.158 27000 27170 E LoadTask: at com.google.android.exoplayer2.extractor.mp4.AtomParsers.parseTraks(AtomParsers.java:148)
03-27 18:43:37.158 27000 27170 E LoadTask: at com.google.android.exoplayer2.extractor.mp4.Mp4Extractor.processMoovAtom(Mp4Extractor.java:494)
03-27 18:43:37.158 27000 27170 E LoadTask: at com.google.android.exoplayer2.extractor.mp4.Mp4Extractor.processAtomEnded(Mp4Extractor.java:453)
03-27 18:43:37.158 27000 27170 E LoadTask: at com.google.android.exoplayer2.extractor.mp4.Mp4Extractor.readAtomPayload(Mp4Extractor.java:435)
03-27 18:43:37.158 27000 27170 E LoadTask: at com.google.android.exoplayer2.extractor.mp4.Mp4Extractor.read(Mp4Extractor.java:253)
03-27 18:43:37.158 27000 27170 E LoadTask: at com.google.android.exoplayer2.source.BundledExtractorsAdapter.read(BundledExtractorsAdapter.java:127)
03-27 18:43:37.158 27000 27170 E LoadTask: at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1042)
03-27 18:43:37.158 27000 27170 E LoadTask: at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)
03-27 18:43:37.158 27000 27170 E LoadTask: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
03-27 18:43:37.158 27000 27170 E LoadTask: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
03-27 18:43:37.158 27000 27170 E LoadTask: at java.lang.Thread.run(Thread.java:923)
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: Playback error
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: com.google.android.exoplayer2.ExoPlaybackException: Source error
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:640)
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:616)
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: at android.os.Handler.dispatchMessage(Handler.java:102)
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: at android.os.Looper.loop(Looper.java:223)
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: at android.os.HandlerThread.run(HandlerThread.java:67)
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: Caused by: com.google.android.exoplayer2.upstream.Loader$UnexpectedLoaderException: Unexpected OutOfMemoryError: Failed to allocate a 33322704 byte allocation with 9813192 free bytes and 9583KB until OOM, target footprint 201326592, growth limit 201326592
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:441)
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: at java.lang.Thread.run(Thread.java:923)
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: Caused by: java.lang.OutOfMemoryError: Failed to allocate a 33322704 byte allocation with 9813192 free bytes and 9583KB until OOM, target footprint 201326592, growth limit 201326592
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: at com.google.android.exoplayer2.extractor.mp4.AtomParsers.parseStbl(AtomParsers.java:688)
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: at com.google.android.exoplayer2.extractor.mp4.AtomParsers.parseTraks(AtomParsers.java:148)
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: at com.google.android.exoplayer2.extractor.mp4.Mp4Extractor.processMoovAtom(Mp4Extractor.java:494)
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: at com.google.android.exoplayer2.extractor.mp4.Mp4Extractor.processAtomEnded(Mp4Extractor.java:453)
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: at com.google.android.exoplayer2.extractor.mp4.Mp4Extractor.readAtomPayload(Mp4Extractor.java:435)
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: at com.google.android.exoplayer2.extractor.mp4.Mp4Extractor.read(Mp4Extractor.java:253)
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: at com.google.android.exoplayer2.source.BundledExtractorsAdapter.read(BundledExtractorsAdapter.java:127)
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1042)
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)
03-27 18:43:37.167 27000 27121 E ExoPlayerImplInternal: ... 3 more
Audio
ID : 1
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 26 h 51 min
Bit rate mode : Variable
Bit rate : 126 kb/s
Maximum bit rate : 133 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 44.1 kHz
Frame rate : 43.066 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 1.41 GiB (99%)
Language : English
Encoded date : UTC 2020-05-28 14:03:01
Tagged date : UTC 2020-05-28 14:03:01
Menus : 2
Menu
ID : 2
Format : Timed Text
Codec ID : text
Duration : 26 h 51 min
Language : English
Encoded date : UTC 2020-05-28 14:03:01
Tagged date : UTC 2020-05-28 14:03:01
Menu For : 1
Source duration : 96719064
Source frame count : 555
Source stream size : 13767
Frame count : 555
Stream size : 13767
mdhd_Duration : 96719104
00:00:00.000 : Kapitel 1
00:00:19.456 : Kapitel 2
...
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @jmt-gh on GitHub (Jun 6, 2022).
Steps to reproduce
Expected behaviour
It should handle the direct playback better, and support the larger file without the need to fallback to transcoding
Actual behaviour
It falls back to transcoding due to OOMing
Environment data
Audiobookshelf Version:
Android Issue
Android version: Android 11
Device model: OnePlus 6
Stock or customized system: Stock
@jmt-gh commented on GitHub (Jun 6, 2022):
Relevant conversation in Discord: here
Logcat:
@advplyr commented on GitHub (Jul 5, 2022):
Are you able to test this again? This PR https://github.com/advplyr/audiobookshelf/pull/791 may fix this
@jmt-gh commented on GitHub (Jul 6, 2022):
Looks like it's still happening with HEAD at f27982d
@advplyr commented on GitHub (Jul 17, 2022):
Does your device have a small amount of storage space?
@maltejur commented on GitHub (Mar 27, 2023):
I have the same issue happening with a particular audiobook.
Log
mediainfo of the audiobook
I can send the m4b privately if you want.
@advplyr commented on GitHub (May 23, 2023):
Fixed in v0.9.64-beta