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

Large opus files fail to play or cause UI lag #177

Open
yump opened this issue Aug 25, 2022 · 0 comments
Open

Large opus files fail to play or cause UI lag #177

yump opened this issue Aug 25, 2022 · 0 comments

Comments

@yump
Copy link

yump commented Aug 25, 2022

I don't know enough about Android to say much for sure, but I think this is an "ANR".

I've noticed some slowness with longer (3+ hours) files before, but it's so severe on Ian Cutress' 9:30 Hot Chips livestream that playback dies after a few seconds. Youtube-hosted files aren't exactly stable, but this ffmpeg command generates a file that exhibits the problem:

ffmpeg \
    -f lavfi -i anoisesrc=r=48000:a=0.5:c=pink \
    -t 10:00:00 \
    -c:a libopus \
    -b:a 64k \
    -ac 2 \
    10_hours_noise.opus

Attempting to play that results in a failure after 5-ish seconds. Replace libopus with libmp3lame, and .opus with .mp3, and it plays just fine. Attached is a logcat dump started just before pressing play, and ^C'd just after playback stopped. The interesting part begins at timestamp 08-24 21:23:12.424. AudioAnchor is uid=10249, pid=32752.

attempt_to_play_opus_everything.log

It seems like there's maybe some computation/memory cost that scales with file size or length. top shows 70-ish % CPU usage from mediaserver and media.extractor aextractor, but their RSS is < 15 MiB. I see no spike in memory or CPU footprint from AudioAnchor itself.

(Although the baseline of ~16% CPU just paused on the playback screen with any file is somewhat concerning. surfaceflinger is ~20%. Is it redrawing continuously?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant