-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
bcm2835-codec fixes #3877
bcm2835-codec fixes #3877
Conversation
Hiding a use of "HZ" as a timeout is a little nasty. Signed-off-by: Dave Stevenson <[email protected]>
"cac8c90 staging: vc04_service: codec: Allow start_streaming to update the buffernum" allowed the number of buffers configured to be decreased as well as increased, but there is no requirement for all buffers to have been queued when start_streaming is called. Only allow increasing the buffernum. Fixes: "cac8c90 staging: vc04_service: codec: Allow start_streaming to update the buffernum" Signed-off-by: Dave Stevenson <[email protected]>
@jc-kynesim The second of these is the push of the change we discussed yesterday. @popcornmix FYI in case it makes a difference to you and Kodi. |
@@ -89,6 +89,9 @@ static const char * const components[] = { | |||
"ril.isp", | |||
}; | |||
|
|||
/* Timeout for stop_streaming to allow all buffers to return */ | |||
#define COMPLETE_TIMEOUT (2 * HZ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What you're actually doing is doubling the timeout - was 1 second not sufficient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that was discussed in another issue, so probably intended, but not mentioned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mentioned on #3325
It needs investigation as to why it wanted we aren't getting the buffers back, but that's not made it to the top of the job list as yet. (videobuf2 deals with it all anyway, but whinges loudly about having to do it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just encountered issue #3325 on Pi3B+ with gstreamer webrtc examples. Apparently the double timeout was not enough and the video stream was freezing after 1-5 minutes every time. Just changed the line #define COMPLETE_TIMEOUT (10 * HZ)
and recompiled the module, which seems to have fixed the problem for me (the stream is running fine now for already 30 minutes or so).
kernel: [ 794.154484] bcm2835-codec bcm2835-codec: bcm2835_codec_stop_streaming: Timeout waiting for buffers to be returned - 12 outstanding
kernel: [ 794.154602] ------------[ cut here ]------------
kernel: [ 794.154633] WARNING: CPU: 1 PID: 3249 at drivers/media/common/videobuf2/videobuf2-core.c:1945 __vb2_queue_cancel+0x1e0/0x258 [videobuf2_common]
kernel: [ 794.154639] Modules linked in: veth binfmt_misc macvlan nft_masq nft_chain_nat bridge dm_mod ebtable_filter ebtables ip6table_raw ip6table_mangle ip6table_nat ip6table_filter ip6_tables iptable_raw iptable_mangle iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 iptable_filter nf_tables nfnetlink fuse cmac bnep hci_uart btbcm bluetooth ecdh_generic ecc 8021q garp stp llc sg uas snd_usb_audio snd_hwdep snd_usbmidi_lib snd_rawmidi uvcvideo snd_seq_device btrfs blake2b_generic xor xor_neon zstd_compress vc4 cec brcmfmac drm_kms_helper brcmutil sha256_generic drm raid6_pq cfg80211 drm_panel_orientation_quirks snd_soc_core rfkill snd_compress snd_pcm_dmaengine syscopyarea sysfillrect sysimgblt fb_sys_fops backlight raspberrypi_hwmon i2c_bcm2835 bcm2835_codec(C) bcm2835_v4l2(C) bcm2835_isp(C) v4l2_mem2mem bcm2835_mmal_vchiq(C) videobuf2_dma_contig videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 snd_bcm2835(C) videobuf2_common snd_pcm snd_timer videodev snd mc vc_sm_cma(C)
kernel: [ 794.155074] uio_pdrv_genirq uio fixed squashfs ip_tables x_tables ipv6
kernel: [ 794.155118] CPU: 1 PID: 3249 Comm: webrtc-sendrecv Tainted: G C 5.10.17-v7+ #1403
kernel: [ 794.155121] Hardware name: BCM2835
kernel: [ 794.155125] Backtrace:
kernel: [ 794.155141] [<809e477c>] (dump_backtrace) from [<809e4b0c>] (show_stack+0x20/0x24)
kernel: [ 794.155148] r7:ffffffff r6:00000000 r5:60010013 r4:80ee5d54
kernel: [ 794.155156] [<809e4aec>] (show_stack) from [<809e8cb8>] (dump_stack+0xcc/0xf8)
kernel: [ 794.155165] [<809e8bec>] (dump_stack) from [<8011ed1c>] (__warn+0xfc/0x114)
kernel: [ 794.155174] r10:7f1b28dc r9:00000009 r8:7f2636b4 r7:00000799 r6:00000009 r5:7f2636b4
kernel: [ 794.155179] r4:7f268f90 r3:80e05050
kernel: [ 794.155187] [<8011ec20>] (__warn) from [<809e5158>] (warn_slowpath_fmt+0x70/0xd8)
kernel: [ 794.155193] r7:00000799 r6:7f268f90 r5:80e05008 r4:00000000
kernel: [ 794.155214] [<809e50ec>] (warn_slowpath_fmt) from [<7f2636b4>] (__vb2_queue_cancel+0x1e0/0x258 [videobuf2_common])
kernel: [ 794.155221] r9:7f11c098 r8:814523d0 r7:00000001 r6:b78bcc14 r5:b78bcc14 r4:b78bcc14
kernel: [ 794.155250] [<7f2634d4>] (__vb2_queue_cancel [videobuf2_common]) from [<7f2646b4>] (vb2_core_streamoff+0x28/0xbc [videobuf2_common])
kernel: [ 794.155257] r10:7f1b28dc r9:7f11c098 r8:814523d0 r7:00000001 r6:00000009 r5:b78bcc14
kernel: [ 794.155261] r4:b78bcc14 r3:00000009
kernel: [ 794.155288] [<7f26468c>] (vb2_core_streamoff [videobuf2_common]) from [<7f29c0e4>] (vb2_streamoff+0x24/0x64 [videobuf2_v4l2])
kernel: [ 794.155292] r5:b78bcc14 r4:b78bcc00
kernel: [ 794.155320] [<7f29c0c0>] (vb2_streamoff [videobuf2_v4l2]) from [<7f180f08>] (v4l2_m2m_streamoff+0x40/0x10c [v4l2_mem2mem])
kernel: [ 794.155344] [<7f180ec8>] (v4l2_m2m_streamoff [v4l2_mem2mem]) from [<7f180ff4>] (v4l2_m2m_ioctl_streamoff+0x20/0x24 [v4l2_mem2mem])
kernel: [ 794.155351] r10:7f1b28dc r9:7f11c098 r8:814523d0 r7:00000001 r6:80e05008 r5:40045613
kernel: [ 794.155355] r4:7f180fd4
kernel: [ 794.155434] [<7f180fd4>] (v4l2_m2m_ioctl_streamoff [v4l2_mem2mem]) from [<7f11c0c4>] (v4l_streamoff+0x2c/0x30 [videodev])
kernel: [ 794.155533] [<7f11c098>] (v4l_streamoff [videodev]) from [<7f121114>] (__video_do_ioctl+0x234/0x460 [videodev])
kernel: [ 794.155538] r5:40045613 r4:814520a0
kernel: [ 794.155638] [<7f120ee0>] (__video_do_ioctl [videodev]) from [<7f121b28>] (video_usercopy+0x128/0x5ac [videodev])
kernel: [ 794.155646] r10:b7b1de3c r9:72c3ad20 r8:00000000 r7:b9a0d6c0 r6:80e05008 r5:40045613
kernel: [ 794.155649] r4:40045613
kernel: [ 794.155749] [<7f121a00>] (video_usercopy [videodev]) from [<7f121fcc>] (video_ioctl2+0x20/0x24 [videodev])
kernel: [ 794.155757] r10:00000047 r9:b7b1c000 r8:00000000 r7:b9a0d6c0 r6:b9a0d6c1 r5:80e05008
kernel: [ 794.155760] r4:7f121fac
kernel: [ 794.155859] [<7f121fac>] (video_ioctl2 [videodev]) from [<7f11a1f4>] (v4l2_ioctl+0x4c/0x60 [videodev])
kernel: [ 794.155916] [<7f11a1a8>] (v4l2_ioctl [videodev]) from [<803475ec>] (sys_ioctl+0x1d4/0x8ec)
kernel: [ 794.155921] r5:80e05008 r4:40045613
kernel: [ 794.155930] [<80347418>] (sys_ioctl) from [<801001e4>] (__sys_trace_return+0x0/0x1c)
kernel: [ 794.155935] Exception stack(0xb7b1dfa8 to 0xb7b1dff0)
kernel: [ 794.155941] dfa0: 6f9e1000 70e3d438 00000047 40045613 72c3ad20 76c0b411
kernel: [ 794.155948] dfc0: 6f9e1000 70e3d438 6f9e183c 00000036 70ffe000 70ffee58 72c0e4b0 6e731014
kernel: [ 794.155953] dfe0: 6f9e1480 7ed9bf9c 6f9b194b 76c0b418
kernel: [ 794.155960] r10:00000036 r9:b7b1c000 r8:80100204 r7:00000036 r6:6f9e183c r5:70e3d438
kernel: [ 794.155964] r4:6f9e1000
kernel: [ 794.155969] ---[ end trace 93c2d8325a631e16 ]---
kernel: [ 794.155978] videobuf2_common: driver bug: stop_streaming operation is leaving buf fb744add in active state
kernel: [ 794.155988] videobuf2_common: driver bug: stop_streaming operation is leaving buf 810493db in active state
kernel: [ 794.155996] videobuf2_common: driver bug: stop_streaming operation is leaving buf 5f8cb022 in active state
kernel: [ 794.156004] videobuf2_common: driver bug: stop_streaming operation is leaving buf ca0d8bbd in active state
kernel: [ 794.156012] videobuf2_common: driver bug: stop_streaming operation is leaving buf a32c044c in active state
kernel: [ 794.156020] videobuf2_common: driver bug: stop_streaming operation is leaving buf 64aed29c in active state
kernel: [ 794.156028] videobuf2_common: driver bug: stop_streaming operation is leaving buf 877bdd42 in active state
kernel: [ 794.156036] videobuf2_common: driver bug: stop_streaming operation is leaving buf 137bffa4 in active state
kernel: [ 794.156044] videobuf2_common: driver bug: stop_streaming operation is leaving buf aa21a2c6 in active state
kernel: [ 794.156054] videobuf2_common: driver bug: stop_streaming operation is leaving buf f96bb012 in active state
kernel: [ 794.156062] videobuf2_common: driver bug: stop_streaming operation is leaving buf 818ded15 in active state
kernel: [ 794.156070] videobuf2_common: driver bug: stop_streaming operation is leaving buf 556f1a8e in active state
No change with seeking from kodi. But also no objections. |
kernel: overlays: Update display GPIO declarations kernel: Update hy28b-overlay.dts See: raspberrypi/linux#3880 kernel: net: bcmgenet: Reset RBUF on first open See: raspberrypi/linux#3850 kernel: ASoC: cs42xx8: Only define cs42xx8_of_match once See: raspberrypi/linux#3873 kernel: bcm2835-codec fixes See: raspberrypi/linux#3877 kernel: usb/dwc2: Set correct state on gadget disconnect kernel: USB: gadget: f_hid: avoid crashes and log spam See: raspberrypi/linux#3870 firmware: arm_loader: enable simple_fb iff there is a display See: raspberrypi/linux#3878 firmware: arm_loader: Mark V3D early boost as for the ARM See: #1469
kernel: overlays: Update display GPIO declarations kernel: Update hy28b-overlay.dts See: raspberrypi/linux#3880 kernel: net: bcmgenet: Reset RBUF on first open See: raspberrypi/linux#3850 kernel: ASoC: cs42xx8: Only define cs42xx8_of_match once See: raspberrypi/linux#3873 kernel: bcm2835-codec fixes See: raspberrypi/linux#3877 kernel: usb/dwc2: Set correct state on gadget disconnect kernel: USB: gadget: f_hid: avoid crashes and log spam See: raspberrypi/linux#3870 firmware: arm_loader: enable simple_fb iff there is a display See: raspberrypi/linux#3878 firmware: arm_loader: Mark V3D early boost as for the ARM See: raspberrypi/firmware#1469
No description provided.