bcm2835-codec: SOURCE_CHANGE queued after last_buffer_dequeued, decoder stops without error
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 32/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- c
調査の方向性
Start from handle_fmt_changed() in the bcm2835-codec driver: it sets vq->last_buffer_dequeued before queue_res_chg_event(), so a v4l2_m2m_poll landing between the two writes reports EPOLLIN without EPOLLPRI and the decoder exits via GST_V4L2_FLOW_LAST_BUFFER. The proposed fix reorders the event before the flag and adds wake_up(&vq->done_wq); validate it against v4l2_m2m_poll and gst_v4l2_object_poll. Done means no silent stop across many looped starts on bcm2835 hardware with debug=1. Note the reporter is already testing this and will open a PR, so coordinate before starting.
索引モデルが issue の本文から書いたものです。
説明
Pi 4 Model B Rev 1.5 4 GB, kernel 6.18.39-v8 (raspberrypi/linux 8307cc8d), GStreamer 1.26.11, playbin3 → v4l2h264dec → glimagesink under sway. H.264 High 4.1 1920x1080 25 fps + AAC, MP4 over HTTPS.
Our player loops a fixed playlist: the same images and the same two MP4 files, hundreds of times a day. At each start of the H.264 decoder, the firmware reports Format changed to 1920x1088 with an unchanged format (Format was 1920x1088). Most starts play fine. 1 start in 40 to 300 stops and never resumes: no bus error, the pipeline never prerolls, the screen stays on the last frame until a restart. The file and the firmware event stay the same, so we looked for a timing race. We see the freeze on 6 display units and reproduce it on a test unit with a different screen.
Sequence (bcm2835_codec debug=1, GST_DEBUG v4l2*:5):
- capture STREAMON (
bcm2835_codec_start_streaming: type: 9) - 18 to 28 ms later,
handle_fmt_changed: Format changed to 1920x1088and, in the same ms,gst_v4l2_video_dec_loop: Leaving output thread: custom-success - no
Sending EOS event; the decoder loop never dequeues the SOURCE_CHANGE event - on one more start, a flush dequeued the event 1 s later and playback recovered: 2 hits in 86 starts
Cause
handle_fmt_changed()setsvq->last_buffer_dequeued = true, then callsqueue_res_chg_event().v4l2_m2m_pollreports EPOLLIN from the flag underdone_lock, and EPOLLPRI from the event underfh_lock. A poll between the two writes returns EPOLLIN without EPOLLPRI.gst_v4l2_object_pollchecks POLLPRI first. Without it, the pool calls DQBUF, gets EPIPE and returnsGST_V4L2_FLOW_LAST_BUFFER.v4l2videodecthen leaves its output thread and posts no error.- During start-up, each returned input buffer wakes the capture poller, every millisecond or so, which keeps the window busy.
Proposed fix: queue the event first, then set the flag and wake the capture queue pollers.
+ /* A poll that sees the LAST state must also see the event */
+ queue_res_chg_event(ctx);
+
vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
- if (vq->streaming)
+ if (vq->streaming) {
vq->last_buffer_dequeued = true;
-
- queue_res_chg_event(ctx);
+ wake_up(&vq->done_wq);
+ }
We're testing it now and will open a PR once it holds.
Related: #5059 shows the same start-up Format changed with an unchanged format. It's the same trigger and a different bug; neither fix covers the other.
- 主要言語
- C
- スター
- 13.2k
- フォーク
- 5.5k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 20
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
raspberrypi/linux のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
raspberrypi/linux#7415 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
rp1-cfe doesn't forward V4L2_EVENT_SOURCE_CHANGE event from csi-2 sensor driver to userspace appオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
raspberrypi/linux#7399 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
raspberrypi/linux#7357 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
raspberrypi/linux#7054 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 34/100
raspberrypi/linux#7679 ·
メンテナーはふだん 1 日以内に返信
raspberrypi/linux の issue をすべて見る
似ている issue
-
good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
tmewett/BrogueCE#929 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug game: iwd2 system: GUI
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
category:port-update
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
メンテナーはふだん 2 日以内に返信