Comments (5)
Config(48000, 12, 1152000)
This looks like it might be failing because the audio track buffer size is too big (> 1MB). The suppression also indicates the DefaultAudioSink
automatically retried with a 1MB buffer but still failed.
As far as I see, the error code "-12" from AudioTrack also means NO_MEMORY
, pointing in the same direction.
Are there any other tracks playing at the same time or any other sort of memory pressure? Alternatively, you could retry with an even lower audio track buffer somehow, but it feels like if a 1MB buffer is failing then slightly smaller buffers might fail too.
from media.
@tonihei not using ffmpeg and not making any other change does fix it for the user.
(I have an option that just change the order of the factory)
This is the same for the other linked issue, not using ffmpeg fixes it.
Seems there's something different the ffmpeg does that can impact BT on some devices but I'm clueless.
If you have ideas of hidden stuff on the extension I can try that last users is more cooperative so I might get him to run tests.
from media.
The only reason I can imagine at the moment is that using FFmpeg causes too much memory to be used, leaving not enough memory for the AudioTrack. I'm not sure if this is a reasonable hypothesis, but it could be related to the fact that both need to allocate native memory outside of the Java layer.
from media.
That would not explain the other issue that looks similar, I'm currently trying to read code and add some logs on my custom build to help move on those as it's a pain for my users.
I've triple checked and both paths are using the exact same sink:
val audioSink = DefaultAudioSink.Builder(context)
.setAudioProcessorChain(
DefaultAudioSink.DefaultAudioProcessorChain(
SilenceSkippingAudioProcessor(),
SonicAudioProcessor(),
replayGainProcessor,
),
)
.setEnableAudioTrackPlaybackParams(true)
.setEnableFloatOutput(hires)
.build()
if (haveRApi) {
audioSink.setOffloadMode(offloadMode)
}
It's just a matter of the order of creation to pass from one case to the other
override fun createRenderers(
eventHandler: Handler,
videoRendererEventListener: VideoRendererEventListener,
audioRendererEventListener: AudioRendererEventListener,
textRendererOutput: TextOutput,
metadataRendererOutput: MetadataOutput,
): Array<Renderer> {
return if (preferInternalDecoder) {
arrayOf(
getFfmpegRenderer(eventHandler, audioRendererEventListener),
getDefaultRenderer(eventHandler, audioRendererEventListener),
MetadataRenderer(metadataRendererOutput, eventHandler.looper),
)
} else {
arrayOf(
getDefaultRenderer(eventHandler, audioRendererEventListener),
getFfmpegRenderer(eventHandler, audioRendererEventListener),
MetadataRenderer(metadataRendererOutput, eventHandler.looper),
)
}
}
Reading internals I think the real cause may be hidden and those devices returns a wrong error code and it's not an issue with memory but just some parameters passed to the sink that will then generate different AudioTrack settings.
Specially since both DecoderAudioRenderer and MediaCodedcAudioRenderer do not create exactly the same the outputFormat passed down.
To be sure I'll add some debug logs at start of DefaultAudioSink.configure()
to log the exact full params and see if there's differences with and without ffmpeg for that user.
Do you think about something else that could be useful?
And @tonihei since this is really low level, can you clarify if the AudioTrack
itself is somehow related to BT and how? Or it's it's before and then the fact that playing outside BT is working gives another clue. Like a missing event somewhere that prevent releasing the AudioTrack.
from media.
To be sure I'll add some debug logs at start of DefaultAudioSink.configure() to log the exact full params and see if there's differences with and without ffmpeg for that user.
That sounds useful to check.
can you clarify if the AudioTrack itself is somehow related to BT and how
AudioTrack is related to BT in that it handles the entire output path of the audio data. So it will behave differently depending the path and also the capabilities of the output device will be different.
from media.
Related Issues (20)
- Duplicate child manifest and segment is loaded at the beginning of HLS playback HOT 3
- HLS stream cannot be played from the beginning. Need to seek forward a little to be able to play it. HOT 6
- Why Exoplayer downloads content manifest before pre-roll manifest? HOT 7
- demo-session process restarted when swiped away from paused state HOT 3
- How to construct ExoPlayer as TextureView rather than SurfaceView in C# .NET? HOT 2
- CastPlayer returns wrong currentMediaItemIndex when cast is stopped HOT 1
- Disable Jetifier HOT 4
- Swiping away demo-session while playing does not end process HOT 5
- ExoPlayer's DownloadManager download priority
- Decoder init failed
- com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException HOT 1
- Forcing a timeline change after modifying MediaMetadata extras HOT 2
- How to show playback notification for basic player implementation HOT 1
- Handle frame which has negative presentationTimeUs value HOT 3
- Using test utilities to produce a fake media source which emulates buffering behaviour HOT 7
- Transformer does not work with supported image MimeTypes when the type comes from ContentResolver HOT 1
- Pause the download and not cancel the notification HOT 1
- Exoplayer cannot be constructed with a specification for "surface_type" programmatically? Why not? HOT 5
- ExoPlayer wrongly decode some MP3 file HOT 8
- There is an issue with supporting ass subtitles, exo version 1.3.1 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from media.