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

v0.21.2 video playback performance regression #6207

Closed
4 tasks done
FrostKiwi opened this issue Apr 30, 2021 · 44 comments · Fixed by #6294
Closed
4 tasks done

v0.21.2 video playback performance regression #6207

FrostKiwi opened this issue Apr 30, 2021 · 44 comments · Fixed by #6294
Labels
bug Issue is related to a bug device/software specific Issues that only happen on some devices or with some specific hardware/software player Issues related to any player (main, popup and background)

Comments

@FrostKiwi
Copy link

With the update to v0.21.2 my OnePlus One is unable to playback 1080p60 videos smoothly any more. Instead it drops it's framerate to below 10fps and becomes a slide show. Going down to 720p60 solves the issue.
This was not the case before v0.21.2.
Anyone else having this experience or is it just my device?

Checklist

Device info

  • Android version/Custom ROM version: Android 10, LineageOS 17.1
  • Device model: OnePlus One (A0001)
@FrostKiwi FrostKiwi added the bug Issue is related to a bug label Apr 30, 2021
@AudricV
Copy link
Member

AudricV commented Apr 30, 2021

Maybe this was caused with the last ExoPlayer update (#5856)? @Redirion What do you think?
Also @FrostKiwi what format are you using to stream videos? MP4 or WEBM?

From a personnal note, on my device, an Honor 9X running EMUI 10, I can't play smoothly videos in 1080p60 with WEBM but I can with MP4. This happens before this release and is related to my device and its performances.

@AudricV AudricV added device/software specific Issues that only happen on some devices or with some specific hardware/software player Issues related to any player (main, popup and background) labels Apr 30, 2021
@FrostKiwi
Copy link
Author

FrostKiwi commented Apr 30, 2021

Maybe this was caused with the last ExoPlayer update (#5856)? @Redirion What do you think?

I'll go ahead and mess with downgrades then, thx for the reference

I can't play smoothly videos in 1080p60 with WEBM but I can with MP4.

Unfortunately, it concerns MPEG-4 as well :S

@FrostKiwi
Copy link
Author

@TiA4f8R
Arright, here are the downgrading results:
Downgraded to v0.21.0 - MPEG-4 1080p60 videoplayback is smooth
Upraded to v0.21.1 - MPEG-4 1080p60 videoplayback is smooth
Upraded to v0.21.2 - MPEG-4 1080p60 videoplayback is a 10fps slideshow mess. Besides that, turning the phone from vertical to horizontal with this version takes forever, like up to 3 seconds.
The one major feature introduced with 0.21.2 was the playback control while buffering...

@AudricV
Copy link
Member

AudricV commented May 1, 2021

I always think it's a problem with ExoPlayer.
@FrostKiwi Can you capture logs from a debug APK with ADB, like this one based on 4a9c790 and post only the entries of the app in this issue? Thanks!

@FrostKiwi
Copy link
Author

FrostKiwi commented May 2, 2021

@TiA4f8R
Here is the ADB logcat output, from the moment I started that NewPipe Debug apk.

Actions performed in log in chronological order: I opened NewPipe Debug, opened a video, changed to 1080p60, NewPipe Debug crashed, misclicked and opened for a splitsecond the releasebuild of Newpipe, opened NewPipe Debug again, started the video again, changed to 1080p60, watched the video in the 10fps slideshow lag awfulness and finally closed the app.
catlog.txt

If by "capture logs from a debug APK with ADB" you were not referring to logcat, pls elaborate and tell me how to capture the log in the format you asked for.

@AudricV
Copy link
Member

AudricV commented May 2, 2021

I was indeed refering to Android's logcat, thank you! Now you will need to a wait that a developer checks what's wrong (I am not one). This can take some time.

@TobiGr
Copy link
Contributor

TobiGr commented May 2, 2021

I can onyl make guesses, but that's what I've found:

Framedrops

We are getting a bunch of lines which are similar to this one:

05-02 14:54:01.494 22575 22575 I Choreographer: Skipped 52 frames!  The application may be doing too much work on its main thread.

These are always preceeded by some kind of animate() method being called. Looks like some animations require too much CPU time. I cannot think of any changes in animation handling from 0.21.1 to 0.21.2. That's why I guess the unterlying issue might be something else which triggers the animation.

Log 1
05-02 14:54:01.350 22575 22575 D VideoDetailFragment@e21e61e: handleResult() called with: result = [StreamInfo[url="https://www.youtube.com/watch?v=3Nj96AS_QJ8", name="Valve needs to be communicating right."]]
05-02 14:54:01.350 22575 22575 D ViewUtils: animate():    false →  [ProgressBar:loading_progress_bar] [ALPHA 0:0] execOnEnd=null
05-02 14:54:01.351 22575 22575 D ViewUtils: animate():    false →  [LinearLayout:error_panel] [ALPHA 150:0] execOnEnd=null
05-02 14:54:01.351 22575 22575 D ViewUtils: animate(): view was already gone > view = [android.widget.LinearLayout{2b8a38c G.E...... ......I. 0,0-0,0 #7f0a011c app:id/error_panel}]
05-02 14:54:01.363 22575 22575 D LeakCanary: Watching instance of android.widget.RelativeLayout (org.schabi.newpipe.fragments.list.comments.CommentsFragment received Fragment#onDestroyView() callback (references to its views should be cleared to prevent leaks)) with key b610cb7f-2897-4d36-80e3-401d3e43f40f
05-02 14:54:01.364 22575 22575 D LeakCanary: Watching instance of androidx.loader.app.LoaderManagerImpl$LoaderViewModel (androidx.loader.app.LoaderManagerImpl$LoaderViewModel received ViewModel#onCleared() callback) with key 0ec5eb39-c1f8-46af-a101-95f154d94a88
05-02 14:54:01.364 22575 22575 D LeakCanary: Watching instance of leakcanary.internal.ViewModelClearedWatcher (leakcanary.internal.ViewModelClearedWatcher received ViewModel#onCleared() callback) with key 354faa72-cb95-4d1b-816e-84bf1f26e100
05-02 14:54:01.365 22575 22575 D LeakCanary: Watching instance of org.schabi.newpipe.fragments.list.comments.CommentsFragment with key 9b2ad367-0f97-4061-bd12-604eff849407
05-02 14:54:01.365 22575 22575 D StateSaver: onDestroy() called with: savedState = [131946954587161 > ]
05-02 14:54:01.365 22575 22575 D LeakCanary: Watching instance of org.schabi.newpipe.fragments.list.comments.CommentsFragment (org.schabi.newpipe.fragments.list.comments.CommentsFragment received Fragment#onDestroy() callback) with key e08a8cdd-17ff-411b-a2e9-05c8a5024fed
05-02 14:54:01.369 22575 22575 D LeakCanary: Watching instance of android.widget.RelativeLayout (org.schabi.newpipe.fragments.list.videos.RelatedItemsFragment received Fragment#onDestroyView() callback (references to its views should be cleared to prevent leaks)) with key 0e4819ef-c4b3-4547-9dc6-912554a70c29
05-02 14:54:01.370 22575 22575 D LeakCanary: Watching instance of androidx.loader.app.LoaderManagerImpl$LoaderViewModel (androidx.loader.app.LoaderManagerImpl$LoaderViewModel received ViewModel#onCleared() callback) with key 456a5c3c-50c5-4382-99b2-832432f80e5c
05-02 14:54:01.370 22575 22575 D LeakCanary: Watching instance of leakcanary.internal.ViewModelClearedWatcher (leakcanary.internal.ViewModelClearedWatcher received ViewModel#onCleared() callback) with key db21eeef-c02b-469e-a52a-a8f52f2fff45
05-02 14:54:01.371 22575 22575 D LeakCanary: Watching instance of org.schabi.newpipe.fragments.list.videos.RelatedItemsFragment with key e801cc4f-0075-432e-9781-b36394f53f9d
05-02 14:54:01.371 22575 22575 D StateSaver: onDestroy() called with: savedState = [131946862158186 > ]
05-02 14:54:01.371 22575 22575 D LeakCanary: Watching instance of org.schabi.newpipe.fragments.list.videos.RelatedItemsFragment (org.schabi.newpipe.fragments.list.videos.RelatedItemsFragment received Fragment#onDestroy() callback) with key 4e449ea5-d63c-485c-a722-01b1dd6e3d99
05-02 14:54:01.373 22575 22575 D CommentsFragment@f082f8d: onCreate() called with: savedInstanceState = [null]
05-02 14:54:01.375 22575 22575 D RelatedItemsFragment@43f4ec1: onCreate() called with: savedInstanceState = [null]
05-02 14:54:01.395 22575 22575 D CommentsFragment@f082f8d: onViewCreated() called with: rootView = [android.widget.RelativeLayout{2c55138 V.E...... ......I. 0,0-0,0}], savedInstanceState = [null]
05-02 14:54:01.399 22575 22575 D CommentsFragment@f082f8d: doInitialLoadLogic() called
05-02 14:54:01.399 22575 22575 D CommentsFragment@f082f8d: startLoading() called with: forceLoad = [false]
05-02 14:54:01.400 22575 22575 D ViewUtils: animate():    false →  [LinearLayout:empty_state_view] [ALPHA 150:0] execOnEnd=null
05-02 14:54:01.400 22575 22575 D ViewUtils: animate(): view was already gone > view = [android.widget.LinearLayout{f161676 G.E...... ......I. 0,0-0,0 #7f0a0104 app:id/empty_state_view}]
05-02 14:54:01.400 22575 22575 D ViewUtils: animate():     true →  [ProgressBar:loading_progress_bar] [ALPHA 400:0] execOnEnd=null
05-02 14:54:01.401 22575 22575 D ViewUtils: animate():    false →  [LinearLayout:error_panel] [ALPHA 150:0] execOnEnd=null
05-02 14:54:01.401 22575 22575 D ViewUtils: animate(): view was already gone > view = [android.widget.LinearLayout{1a48e4 G.E...... ......I. 0,0-0,0 #7f0a011c app:id/error_panel}]
05-02 14:54:01.403 22575 27082 D InfoCache: getFromKey() called with: serviceId = [0], url = [https://www.youtube.com/watch?v=3Nj96AS_QJ8]
05-02 14:54:01.403 22575 27082 D ExtractorHelper: loadFromCache() called, info > CommentsInfo[url="https://m.youtube.com/watch?v=3Nj96AS_QJ8" (originalUrl="https://www.youtube.com/watch?v=3Nj96AS_QJ8"), name="Comments"]
05-02 14:54:01.422 22575 22575 D RelatedItemsFragment@43f4ec1: onViewCreated() called with: rootView = [android.widget.RelativeLayout{d60f175 V.E...... ......I. 0,0-0,0}], savedInstanceState = [null]
05-02 14:54:01.431 22575 22575 D RelatedItemsFragment@43f4ec1: doInitialLoadLogic() called
05-02 14:54:01.431 22575 22575 D RelatedItemsFragment@43f4ec1: startLoading() called with: forceLoad = [false]
05-02 14:54:01.431 22575 22575 D ViewUtils: animate():    false →  [LinearLayout:empty_state_view] [ALPHA 150:0] execOnEnd=null
05-02 14:54:01.431 22575 22575 D ViewUtils: animate(): view was already gone > view = [android.widget.LinearLayout{7e9817b G.E...... ......I. 0,0-0,0 #7f0a0104 app:id/empty_state_view}]
05-02 14:54:01.432 22575 22575 D ViewUtils: animate():     true →  [ProgressBar:loading_progress_bar] [ALPHA 400:0] execOnEnd=null
05-02 14:54:01.432 22575 22575 D ViewUtils: animate():    false →  [LinearLayout:error_panel] [ALPHA 150:0] execOnEnd=null
05-02 14:54:01.432 22575 22575 D ViewUtils: animate(): view was already gone > view = [android.widget.LinearLayout{5c2ff1 G.E...... ......I. 0,0-0,0 #7f0a011c app:id/error_panel}]
05-02 14:54:01.448 22575 22575 D ViewUtils: animate():     true →  [AppCompatImageView:detail_thumbnail_play_button] [ALPHA 200:0] execOnEnd=null
05-02 14:54:01.463 22575 22575 D ViewUtils: animate():     true →  [AppCompatTextView:detail_duration_view] [ALPHA 100:0] execOnEnd=null
05-02 14:54:01.493 22575 22575 D Player  : onBroadcastReceived() called with: intent = [Intent { act=org.schabi.newpipe.debug.VideoDetailFragment.ACTION_VIDEO_FRAGMENT_RESUMED flg=0x10 }]
05-02 14:54:01.494 22575 22575 I Choreographer: Skipped 52 frames!  The application may be doing too much work on its main thread.
Log 2
05-02 14:54:52.002 27693 27693 D RelatedItemsFragment@4896a3f: doInitialLoadLogic() called
05-02 14:54:52.002 27693 27693 D RelatedItemsFragment@4896a3f: handleResult() called with: result = [RelatedItemInfo[url="https://www.youtube.com/watch?v=3Nj96AS_QJ8", name="Valve needs to be communicating right."]]
05-02 14:54:52.002 27693 27693 D ViewUtils: animate():    false →  [LinearLayout:empty_state_view] [ALPHA 150:0] execOnEnd=null
05-02 14:54:52.002 27693 27693 D ViewUtils: animate(): view was already gone > view = [android.widget.LinearLayout{74893da G.E...... ......I. 0,0-0,0 #7f0a0104 app:id/empty_state_view}]
05-02 14:54:52.003 27693 27693 D ViewUtils: animate():    false →  [ProgressBar:loading_progress_bar] [ALPHA 0:0] execOnEnd=null
05-02 14:54:52.003 27693 27693 D ViewUtils: animate(): view was already gone > view = [android.widget.ProgressBar{b8f900b G.ED..... ......I. 0,0-0,0 #7f0a01f3 app:id/loading_progress_bar}]
05-02 14:54:52.003 27693 27693 D ViewUtils: animate():    false →  [LinearLayout:error_panel] [ALPHA 150:0] execOnEnd=null
05-02 14:54:52.003 27693 27693 D ViewUtils: animate(): view was already gone > view = [android.widget.LinearLayout{d85dee8 G.E...... ......I. 0,0-0,0 #7f0a011c app:id/error_panel}]
05-02 14:54:52.003 27693 27693 D ViewUtils: animate():     true →  [RecyclerView:items_list] [ALPHA 300:0] execOnEnd=null
05-02 14:54:52.004 27693 27693 D ViewUtils: animate(): view was already visible > view = [androidx.recyclerview.widget.RecyclerView{b5ac901 VFED.V... ......I. 0,0-0,0 #7f0a01b7 app:id/items_list}]
05-02 14:54:52.064 27693 27693 D SearchFragment@a615680: onResume() called
05-02 14:54:52.065 27693 27693 D SearchFragment@a615680: hideKeyboardSearch() called
05-02 14:54:52.065 27693 27693 D SearchFragment@a615680: hideSuggestionsPanel() called
05-02 14:54:52.066 27693 27693 D ViewUtils: animate():    false →  [LinearLayout:suggestions_panel] [LIGHT_SLIDE_AND_ALPHA 200:0] execOnEnd=null
05-02 14:54:52.066 27693 27693 D ViewUtils: animate(): view was already gone > view = [android.widget.LinearLayout{24fef2c GFE...... ......ID 0,0-0,0 #7f0a0333 app:id/suggestions_panel}]
05-02 14:54:52.086 27693 27693 D Player  : onBroadcastReceived() called with: intent = [Intent { act=android.intent.action.CONFIGURATION_CHANGED flg=0x70200010 }]
05-02 14:54:52.089 27693 27693 D Player  : onConfigurationChanged() called
05-02 14:54:52.094 27693 27693 D Player  : updateScreenSize() called: screenWidth = [1920.0], screenHeight = [1080.0]
05-02 14:54:52.097 27693 27693 D Player  : Thumbnail - updateEndScreenThumbnail() called with: currentThumbnail = [android.graphics.Bitmap@ab381c2], 600x337, scaled end screen height = 337.0, scaled end screen width = 600
05-02 14:54:52.098 27693 27693 I Choreographer: Skipped 67 frames!  The application may be doing too much work on its main thread.

Buffering

I did not yet compare the log with a "normal" log, but your log contains the word "buffer" very often: In the ~7000 lines, we got ~1800 lines with info about buffer stuff.

05-02 14:53:48.982   236  1629 W         : buffer descriptor with invalid usage bits 0x2002000
05-02 14:54:22.504  9831 21063 D CCodecBuffers: [c2.android.aac.decoder#182:1D-Output.Impl[N]] Client returned a buffer it does not own according to our record: 4
05-02 14:54:52.517 27693 27818 E BufferQueueProducer: [SurfaceTexture-1-27693-0] detachBuffer: slot 2 is not owned by the producer (state = FREE)
05-02 14:54:56.130 27693 27818 I CCodecConfig: query failed after returning 12 values (BAD_INDEX)
05-02 14:55:01.366 27693 27789 D PipelineWatcher: onInputBufferReleased: frameIndex not found (729); ignored

I do not have time to look into this, but my next steps would be:

  1. Get a 0.21.1 debug version
    1. and check how often the animations are performed
    2. check if we have that many debug info related to buffering
  2. Try the exoplayer update Update to ExoPlayer 2.12.3 #5457
  3. Try to understand what these lines say:
05-02 14:54:45.318   299 13446 E qcreverb: 	[vendor/qcom/proprietary/mm-audio-noship/audio-effects/safx/android-adapter/qcreverb/qcreverb.c:531] Assertion fail: pConfig->inputCfg.format == AUDIO_FORMAT_PCM_16_BIT
05-02 14:54:48.820   299   379 E qcbassboost: 	[vendor/qcom/proprietary/mm-audio-noship/audio-effects/safx/android-adapter/qcbassboost/qcbassboost.c:395] Assertion fail: pConfig->inputCfg.format == AUDIO_FORMAT_PCM_16_BIT
05-02 14:54:48.831   299  5350 E qcvirt  : 	[vendor/qcom/proprietary/mm-audio-noship/audio-effects/safx/android-adapter/qcvirt/qcvirt.c:568] Assertion fail: pConfig->inputCfg.format == AUDIO_FORMAT_PCM_16_BIT
05-02 14:54:48.844   299   384 E qcreverb: 	[vendor/qcom/proprietary/mm-audio-noship/audio-effects/safx/android-adapter/qcreverb/qcreverb.c:531] Assertion fail: pConfig->inputCfg.format == AUDIO_FORMAT_PCM_16_BIT
  1. Ask @Redirion for help

@Redirion
Copy link
Member

Redirion commented May 2, 2021

it looks like the development of your Lineageos version for your device has advanced to a new version. 18.1.
Are you using the latest nightly of 17.1? If not you could try to upgrade to that. And if you already do, you could try 18.1
https://download.lineageos.org/bacon

But yes please also try the updated ExoPlayer to see if that makes a difference

@Redirion
Copy link
Member

Redirion commented May 3, 2021

ah @TobiGr you have linked the wrong update.
The correct PR is #6206

@FrostKiwi please try that ExoPlayer version and please comment on my Lineageos question

@FrostKiwi
Copy link
Author

FrostKiwi commented May 3, 2021

ah @TobiGr you have linked the wrong update.
The correct PR is #6206

@FrostKiwi please try that ExoPlayer version and please comment on my Lineageos question

Tried the debug build provided by PR #6206
Same deal. choppy slideshow during 1080p60 playback. The Animations of the NewPipe app btw still play at full framerate and are smooth. (The slide animations, rotate animations... it's just the video that's choppy)

I am on the 11th April build of LineageOS 17.1 as provided by this ROM
Although LineageOS 18.1 has been out for a year for my device, it was still young and stability was wonky, so I stuck around with 17.1 till now. If it helps tracking down the issue, I can wipe and cleanflash my device to 18.1.

@Redirion
Copy link
Member

Redirion commented May 4, 2021

MediaCodecInfo: NoSupport [codec.profileLevel, avc1.64002A, video/avc] [OMX.qcom.video.decoder.avc, video/avc] [bacon, A0001, OnePlus, 29]

VideoCapabilities: Unrecognized profile/level 0/3 for video/mpeg2
VideoCapabilities: Unrecognized profile 2130706433 for video/avc

Can you please try if it works better with webm?

@Redirion
Copy link
Member

Redirion commented May 4, 2021

this is curious:
CacheDataSink: fragmentSize is below the minimum recommended value of 2097152. This may cause poor cache performance.

@TobiGr
Copy link
Contributor

TobiGr commented May 4, 2021

@Redirion Good catch!
@FrostKiwi Can you please test the APK from #6238. It is a debug APK, so its is genereally slower than the normal release build. However, if @Redirion tackeled the casue for your frame drops, you should notice that.

@FrostKiwi
Copy link
Author

I have tested the APK as provided in the PR.
Unfortunately there were absolutely no performance changes between v0.21.2 and v0.21.2 "fixfragmentsize". Launching into MPEG-4 1080p60 results in a laggy single digit fps mess. @Redirion Though I'm glad to have indirectly contributed to an improvement already :D

Can you please try if it works better with webm?

On all version, v0.21.1, v0.21.2 and v0.21.2 "fixfragmentsize" the playback of WebM 720p60 and WebM 1080p60 is equally a single-digit fps slideshow. This kinda leads me to believe that my Device has stopped providing Hardware decoding for MPEG-4 with v0.21.2 maybe? Is there a way to check that?

For reference, here is a video showing off all symptoms in all versions, captured externally, as not to fudge the results:

00006.mp4

In chronological order:

  • Starting v0.21.1 and confirming the version, showing smooth playback of MPEG-4 1080p60
  • Switching to v0.21.2 "fixfragmentsize" and confirming the version, showing Choppy playback of MPEG-4 1080p60 and Smooth playback MPEG-4 720p60 and lastly, showing horizontal orientation 1080p60 still being choppy.
  • Switching to v0.21.1 and confirming the version, showing switching playback default to WebM and showing Choppy playback of both WebM 1080p60 and 720p60

@Redirion
Copy link
Member

Redirion commented May 5, 2021

Thank you for the video!
I tried to dig through your logs again but there is so much going on. Is it possible to disable the audio_effects module / bass boost stuff? Maybe you have some sort of Equalizer app that can be disabled.
Video playback requires uninterrupted audio stream for syncing timestamps.
Later I will make another "media tunneling disabled" test APK based on current dev and one with downgraded ExoPlayer version. It might be an issue with offloading syncing timestamps to the device. But in any case I would like to find the root cause.

@Mr-Mime
Copy link

Mr-Mime commented May 10, 2021

Just wanted to add my 2 cents here, maybe it helps tracking down the problem/bug.

NewPipe version: 0.21.2
Device: OnePlus Two (ONE A2003)
OS: LineageOs 16.0

For me happened the same after updating to 0.21.2.
1080p60 videos are lagging, while 1080p Videos run normal.

Changing to WEBM changed nothing.
I am also seeing a lot of fragmentSize is below minimum... in the log.

One line that sticks out when opening a 1080p60 video is:
2021-05-10 19:12:15.685 31583-31675/org.schabi.newpipe E/ACodec: [OMX.google.h264.decoder] setPortMode on output to DynamicANWBuffer failed w/ err -1010
This is in line 51.

Situation:
Open NewPipe -> Choose video which starts playing at 1080p60 -> watch for few sec. -> close video -> choose video which opens in 1080p -> watch for a few sec.
Logs for the situation: newPipe.log

If I can help/ test with anything let me know.
I am also having a OnePlus One laying around, which I could upgrade to LineageOs 18.1.

Edit: Commented before finishing comment...

@matterharz
Copy link

matterharz commented May 10, 2021

I tried to dig through your logs again but there is so much going on. Is it possible to disable the audio_effects module / bass boost stuff? Maybe you have some sort of Equalizer app that can be disabled.
Video playback requires uninterrupted audio stream for syncing timestamps.
Later I will make another "media tunneling disabled" test APK based on current dev and one with downgraded ExoPlayer version. It might be an issue with offloading syncing timestamps to the device. But in any case I would like to find the root cause.

I also have a OnePlus 2 (A2003) (but running LineageOS 17.1) and can confirm the 1080p60 behavior. The comment above caught my attention since the lags started to occur at roughly the same time I installed the ViperFX equalizer Magisk module. However, even after making sure every last file was removed after deinstallation of the module, the performance remained the same.

What's interesting about this regression is the difference in performance between 1080p60 (slideshow) and 720p60 (perfectly smooth). I would at least expect some lagging.

@FrostKiwi
Copy link
Author

I wanted to clean flash my Phone before posting again, but since we are here:

I tried to dig through your logs again but there is so much going on. Is it possible to disable the audio_effects module / bass boost stuff? Maybe you have some sort of Equalizer app that can be disabled.

As @matterharz reported, I disabled that audio effects and there was no change either.
The audio effects came in my case from the preinstalled "AudioFX" solution. Though I also used Viper4Android in the past. Never an issue and Audio never lags. With all of that disabled, no changes.
All the "qcXXXX: [vendor/qcom/proprietary" stuff refers to the in-built hardware audio proccessing by QualComm, is commanded by the kernel and always running, as far as I'm aware. It can be used by to tune the spaekers, redirect audio to different speakers for Stereo and so on. It is only accessible to the OEM or if you have root.

@TobiGr
Copy link
Contributor

TobiGr commented May 14, 2021

I found thesesn lines in @FrostKiwi's and @Mr-Mime's log:

05-02 14:54:45.557 27693 27783 D MediaCodecInfo: NoSupport [codec.profileLevel, avc1.64002A, video/avc] [OMX.qcom.video.decoder.avc, video/avc] [bacon, A0001, OnePlus, 29]
05-02 14:54:45.558 27693 27783 D MediaCodecInfo: NoSupport [codec.profileLevel, avc1.64002A, video/avc] [OMX.qcom.video.decoder.avc, video/avc] [bacon, A0001, OnePlus, 29]

05-02 14:54:42.637 27693 27783 W VideoCapabilities: Unrecognized profile/level 0/3 for video/mpeg2
05-02 14:54:42.642 27693 27783 W VideoCapabilities: Unrecognized profile/level 0/3 for video/mpeg2
2021-05-10 19:12:15.490 31583-31666/org.schabi.newpipe W/VideoCapabilities: Unrecognized profile 4 for video/hevc
2021-05-10 19:12:15.492 31583-31666/org.schabi.newpipe W/VideoCapabilities: Unrecognized profile/level 0/3 for video/mpeg2
2021-05-10 19:12:15.495 31583-31666/org.schabi.newpipe W/VideoCapabilities: Unrecognized profile/level 0/3 for video/mpeg2
2021-05-10 19:12:15.511 31583-31666/org.schabi.newpipe W/VideoCapabilities: Unrecognized profile 2130706433 for video/avc
2021-05-10 19:12:15.526 31583-31666/org.schabi.newpipe I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es

@Mr-Mime I think you did not use a debug version to create the crash log, did you? Can you please create a more detailed log with the latest dev version?

@Mr-Mime
Copy link

Mr-Mime commented May 14, 2021

@TobiGr, this time I used the lastest dev version you linked. I also set the logcat output level to "Debug", last time it was set to "Info".

Here are the new logs.
I opened he app and started a Video in 720p, worked fine.
Then switched to 1080p60 and it started stuttering.
I added 3 lines to separate the 720p part from the 1080p part in the logs.

I also see these lines, which were also in @FrostKiwi's log...

2021-05-14 10:48:22.492 12090-12354/org.schabi.newpipe.debug D/MediaCodecInfo: NoSupport [codec.profileLevel, avc1.64002A, video/avc] [OMX.qcom.video.decoder.avc, video/avc] [OnePlus2, ONE A2003, OnePlus, 28]
2021-05-14 10:48:22.494 12090-12354/org.schabi.newpipe.debug D/MediaCodecInfo: NoSupport [codec.profileLevel, avc1.64002A, video/avc] [OMX.qcom.video.decoder.avc, video/avc] [OnePlus2, ONE A2003, OnePlus, 28]

BTW my lineage is degoogled, not that I think it is related to this issue, but who knows :)

@Redirion
Copy link
Member

Please check with the apk from this PR #6288 if it works for you. It could be that there is an issue with media tunneling where syncing audio and video timestamps is being offloaded to the device if the device claims support for that. In the event that media tunneling is broken on the device sync timestamps might be missing / incorrect and could lead to stutter or low fps.

@Mr-Mime
Copy link

Mr-Mime commented May 14, 2021

@Redirion the apk from the PR did nothing for me. Turned tunneling off and still had stuttering video. (MP4 and WEBM)

However I can say that 4a9d210 introduced the stuttering on my device.

I built the app locally.
First at ad8f3aa, and the video playback @1080p60 was smooth.
Then I switched to 4a9d210, built the apk and the stuttering occurred.

@TobiGr
Copy link
Contributor

TobiGr commented May 14, 2021

@Mr-Mime That looks like a wrong conclusion. The history is not linear. ad8f3aa is directly based on the 0.21.0 release (464d0e5). So when you do not experience the problem with ad8f3aa, that only tells us, that the problem did not exist in the 0.21.0 release. However, 4a9d210 has a bunch more commits which made changes to the player. I really do not believe that the performance regression was introduced by preventing a single device from using media tunneling. Can you test 5739caa?

@Redirion
Copy link
Member

the first commit was based on an outdated dev branch at that time it appears.
For example it was still at ExoPlayer 2.12, while the other commit was on recent dev branch at that time with ExoPlayer 2.13

@Mr-Mime
Copy link

Mr-Mime commented May 14, 2021

Yes, sorry I completely overlooked that.

@TobiGr with 5739caa I experience the stuttering.

@Redirion
Copy link
Member

please try ExoPlayer 2.12 from PR #6294
and ExoPlayer 2.14 from PR #6295
both were created on current dev branch

@Mr-Mime
Copy link

Mr-Mime commented May 14, 2021

For me with the downgrade the stuttering is gone.
But the version with ExoPlayer 2.14 also has the stuttering.

@FrostKiwi
Copy link
Author

Damn you guys are fast 0.0

please try ExoPlayer 2.12 from PR #6294
and ExoPlayer 2.14 from PR #6295
both were created on current dev branch

Can confirm aswell with my OnePlus One. #6294 runs smoothly, #6295 is a slideshow.
I think I now hold the world record for most NewPipe Apps installed at the same time.

@opusforlife2
Copy link
Collaborator

Huhuhu. One of our devs had something like 30+ Newpipes installed at one point. But keep trying. ;P

@sami155
Copy link

sami155 commented May 14, 2021

I kinda have the same problem(?)
For me it is like this: when a video is playing, the playback stutters randomly in the video, as if my internet was bad. But with the yt app oder via firefox mobile i dont have this problem.

@Redirion
Copy link
Member

Redirion commented May 14, 2021

my guess is that it all boils down to this issue and its fix in ExoPlayer that is present since 2.13:
equeim/ExoPlayer@78a975c

ExoPlayer checks decoder capabilities and dismisses probable decoders as they do not correctly announce profileLevel support for what is needed for Youtube 1080p60

MediaCodecInfo: NoSupport [codec.profileLevel, avc1.64002A

so the normally well performing decoder gets dismissed and another, inferior, software decoder like Googles own gets used instead resulting in sluggish performance.

In my opinion this should be an issue of LineageOS and can be fixed by correctly reporting supported h264 codec profile levels.

@Mr-Mime
Copy link

Mr-Mime commented May 14, 2021

Just as a note:

I updated my OnePlus One to the latest LineageOs 18.1 build.
Unfortunately the stuttering is still there.

Thus I think the issue described by @Redirion should be reported to LineageOs.

@Redirion
Copy link
Member

We will downgrade ExoPlayer for the next version

@Mr-Mime
Copy link

Mr-Mime commented May 15, 2021

FYI: Created a issue at LineageOs's issue tracker here.
Feel free to add information there if I forgot something or you have new one.

@opusforlife2
Copy link
Collaborator

@Mr-Mime Might be a good idea to also submit a post to their subreddit. Quite a few devs are active there, so it might increase the chances of someone having a look at this.

@FrostKiwi
Copy link
Author

We will downgrade ExoPlayer for the next version

This clears the issue for now then.
Thank you for the indepth analysis.

@opusforlife2
Copy link
Collaborator

Let's keep it open to keep track of LineageOS developments.

@FrostKiwi
Copy link
Author

@opusforlife2 @TobiGr
tenor_1

@opusforlife2
Copy link
Collaborator

ᕕ( ᐛ )ᕗ

@Redirion
Copy link
Member

@Mr-Mime any news regarding avc profile level support for your chipset? I don't see any recent patch in https://review.lineageos.org/q/project:LineageOS%252Fandroid_hardware_qcom_media

@Mr-Mime
Copy link

Mr-Mime commented Jan 17, 2022

Lost focus on this in summer...
But today the issue was closed for lineage. (issue in lineage git)
Actually it was closed in November, but the devs forgot to close the issue.

@Redirion
Copy link
Member

Redirion commented Jan 17, 2022

sounds good! Can you confirm that the issue is not present in the current NewPipe release with the latest LinageOS?

@Mr-Mime
Copy link

Mr-Mime commented Jan 18, 2022

I am on the latest LineageOS and have NewPipe 21.15 installed. I see no stuttering.
Also this line from the log, seems to indicate, that the media codec is set correctly

org.schabi.newpipe I/MediaCodec: [OMX.qcom.video.decoder.avc] setting surface generation to 4811790

Edit: Just wanted to mention that I tested it with an 1080p60 video, just to be clear.

@Redirion
Copy link
Member

perfect! I will close this issue then :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug device/software specific Issues that only happen on some devices or with some specific hardware/software player Issues related to any player (main, popup and background)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants