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

media: bcm2835-codec: Limit video callbacks #4646

Merged

Conversation

jc-kynesim
Copy link
Contributor

Limit the number of allowed video callbacks. This helps with limiting
the size of the coded input FIFO which in turn helps to control latency.
Choose -5 as the magic number as it translates to DPB+5 buffers which
has been proven to be a good number in the past.

Ideally coded buffers would not be returned to the user until they
had been decoded into the DPB or been discarded as bad, but that grade
of control is unavailable to us.

Signed-off-by: John Cox jc@kynesim.co.uk

Limit the number of allowed video callbacks. This helps with limiting
the size of the coded input FIFO which in turn helps to control latency.
Choose -5 as the magic number as it translates to DPB+5 buffers which
has been proven to be a good number in the past.

Ideally coded buffers would not be returned to the user until they
had been decoded into the DPB or been discarded as bad, but that grade
of control is unavailable to us.

Signed-off-by: John Cox <jc@kynesim.co.uk>
@jc-kynesim
Copy link
Contributor Author

The helps with (but on its own does not solve) some of my issues with ffmpeg on the command line + hwaccel. As stated above I picked -5 as its a number Dom has used in the past that seemed to work. Ideally -1 or -2 would be better but those have stalled for Dom in the past so don't do that.

@popcornmix
Copy link
Collaborator

I used this setting for kodi with mmal acceleration as otherwise the latency between enqueued and dequeued buffers can grow to several seconds and media players generally don't expect that behaviour.
So seems sane to me.

@6by9
Copy link
Contributor

6by9 commented Oct 22, 2021

I see no issues with that, although it'd be useful to check it against GStreamer. Give me a mo to do that.

@6by9
Copy link
Contributor

6by9 commented Oct 22, 2021

All good in GStreamer (1.18.4 anyway), so I'm good with it.

@pelwell pelwell merged commit f814bfc into raspberrypi:rpi-5.10.y Oct 22, 2021
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Oct 25, 2021
kernel: ARM: dts: vc4-kms-v3d: Always disable firmware HDMI
See: raspberrypi/linux#4652

kernel: media: bcm2835-codec: Limit video callbacks
See: raspberrypi/linux#4646

kernel: staging/bcm2835-camera: Add support for H264_MIN_QP, H264_MAX_QP, MPEG_VIDEO_FORCE_KEY_FRAME
See: raspberrypi/linux#4647

kernel: bcm2835-isp: Colorspace fixes
See: raspberrypi/linux#4643

kernel: Unicam Media Controller support
See: raspberrypi/linux#4641

kernel: config: Enable FSFS_FS_SECURITY
See: raspberrypi/linux#4637

kernel: gpio: bcm-virt: Fix the get() method
See: raspberrypi/linux#4638

firmware: userland: Reduce debug_sym error messages
See: https://forums.raspberrypi.com/viewtopic.php?f=98&t=322238

firmware: arm_dt: Increase maximum line length to 98
See: raspberrypi/linux#4638
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Oct 25, 2021
kernel: ARM: dts: vc4-kms-v3d: Always disable firmware HDMI
See: raspberrypi/linux#4652

kernel: media: bcm2835-codec: Limit video callbacks
See: raspberrypi/linux#4646

kernel: staging/bcm2835-camera: Add support for H264_MIN_QP, H264_MAX_QP, MPEG_VIDEO_FORCE_KEY_FRAME
See: raspberrypi/linux#4647

kernel: bcm2835-isp: Colorspace fixes
See: raspberrypi/linux#4643

kernel: Unicam Media Controller support
See: raspberrypi/linux#4641

kernel: config: Enable FSFS_FS_SECURITY
See: raspberrypi/linux#4637

kernel: gpio: bcm-virt: Fix the get() method
See: raspberrypi/linux#4638

firmware: userland: Reduce debug_sym error messages
See: https://forums.raspberrypi.com/viewtopic.php?f=98&t=322238

firmware: arm_dt: Increase maximum line length to 98
See: raspberrypi/linux#4638
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

Successfully merging this pull request may close these issues.

4 participants