Repository navigation
staging: vc04_services: bcm2835-codec: Signal every buffer returned during a flush - #7713
Open
rahmounirabii wants to merge 1 commit into
Open
rahmounirabii wants to merge 1 commit into
rahmounirabii wants to merge 1 commit into
Conversation
…uring a flush buffers_with_vpu is decremented in buffer_work_cb() before the buffer callback runs. With the port disabled, ip_buffer_cb() and op_buffer_cb() only signalled frame_cmplt if the counter was still non-zero, so the callback of the last returned buffer never signalled. When bcm2835_codec_flush_buffers() saw one buffer still with the VPU, it then slept the whole COMPLETE_TIMEOUT (2 s) under dev_mutex and logged "Timeout waiting for buffers to be returned - 0 outstanding", stalling QBUF/DQBUF of every other decoder instance meanwhile (a video playing in another instance freezes for ~2 s). Signal frame_cmplt for every buffer returned while the port is disabled, including the EOS and error paths that are also counted in buffers_with_vpu, and make the flush wait loop while buffers remain with the VPU, each wait still bounded by COMPLETE_TIMEOUT. Link: raspberrypi#7712 Signed-off-by: Rabii Rahmouni <rahmounirabii.me@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
buffers_with_vpu is decremented in buffer_work_cb() before the buffer callback runs. With the port disabled, ip_buffer_cb() and op_buffer_cb() only signalled frame_cmplt if the counter was still non-zero, so the callback of the last returned buffer never signalled. When bcm2835_codec_flush_buffers() saw one buffer still with the VPU, it then slept the whole COMPLETE_TIMEOUT (2 s) under dev_mutex and logged "Timeout waiting for buffers to be returned - 0 outstanding", stalling QBUF/DQBUF of every other decoder instance meanwhile (a video playing in another instance freezes for ~2 s).
Signal frame_cmplt for every buffer returned while the port is disabled, including the EOS and error paths that are also counted in buffers_with_vpu, and make the flush wait loop while buffers remain with the VPU, each wait still bounded by COMPLETE_TIMEOUT.
Tested on a Pi 4B (6.18.50+rpt-rpi-v8): no occurrence of the timeout since 22 Oct, over ~45 h of signage playback plus an 8 h stress run (~4,700 decoder reuse cycles while another video plays). Details and reproduction in #7712.
Fixes #7712