mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bryan O'Donoghue <bod@kernel.org>
To: emcp@enser.io, Vikash Garodia <vikash.garodia@oss.qualcomm.com>,
	Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil@kernel.org>,
	Stanimir Varbanov <stanimir.varbanov@linaro.org>,
	linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] media: venus: vdec: Resume CAPTURE restarted during a seek
Date: Sun, 22 Nov 2026 23:09:36 +0000	[thread overview]
Message-ID: <bfe911bd-6642-44a7-8100-84ad6d23db04@kernel.org> (raw)
In-Reply-To: <20261122-b4-venus-eos-seek-v1-2-2e38912c7cf9@enser.io>

On 22/11/2026 05:13, EMCP333 via B4 Relay wrote:
> From: EMCP333 <emcp@enser.io>
> 
> GStreamer's V4L2 decoder handles a flushing seek by calling STREAMOFF on
> both queues, then STREAMON on CAPTURE, then STREAMON on OUTPUT when the
> first buffer of the new segment arrives. On a OnePlus 6T (SDM845) the
> seek never completes: the decoder takes two OUTPUT buffers, produces
> nothing, and the pipeline times out waiting for preroll.
> 
> The driver loses CAPTURE in that order:
> 
>    STREAMOFF OUTPUT   vdec_stop_output()    DECODING -> SEEK, flush
>    STREAMOFF CAPTURE  vdec_stop_capture()   SEEK: buffers cancelled
>    STREAMON  CAPTURE  vdec_start_capture()  streamon_out is 0: return 0,
>                                             streamon_cap stays 0
>    STREAMON  OUTPUT   vdec_start_output()   SEEK -> DECODING, but capture
>                                             buffers are queued only if
>                                             streamon_cap is set
> 
> so the buffers CAPTURE was restarted with stay in the m2m queue and the
> firmware has nothing to decode into. A seek that restarts only OUTPUT,
> as ffmpeg and mpv do, is not affected.
> 
> Remember a CAPTURE restart that happens while OUTPUT is stopped in the
> SEEK state, hold the capture buffers queued meanwhile, and hand them to
> the firmware together with the DPB buffers when OUTPUT restarts. Clear
> the flag whenever CAPTURE is stopped again.
> 
> Tested on a OnePlus 6T with this change on the postmarketOS sdm845
> kernel (6.18): three flushing seeks through GStreamer's v4l2h264dec, to
> 5, 2 and 8 s of a 10 s clip, each preroll in 0.04-0.07 s with the first
> frame at the exact target timestamp, and playback then runs to
> end-of-stream.
> 
> The code and this changelog were prepared with the help of an AI coding
> assistant. The submitter has reviewed both and takes responsibility for
> them.
> 
> Fixes: beac82904a87 ("media: venus: make decoder compliant with stateful codec API")
> Signed-off-by: EMCP333 <emcp@enser.io>
This also looks similar to : 
https://patchwork.linuxtv.org/project/linux-media/patch/20260928-venus-vdec-eos-v1-2-6e9eb3ce9849@ixit.cz/

Please pick up on David's patches, give Tested-by: as appropriate and 
propose any additional fixes on top.

---
bod

      reply	other threads:[~2026-11-22 23:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22  5:13 [PATCH 0/2] media: venus: Fix end-of-stream and seeks on SDM845 EMCP333 via B4 Relay
2026-11-22  5:13 ` [PATCH 1/2] media: venus: Signal end-of-stream with a mapped buffer EMCP333 via B4 Relay
2026-11-22 22:56   ` Bryan O'Donoghue
2026-11-22  5:13 ` [PATCH 2/2] media: venus: vdec: Resume CAPTURE restarted during a seek EMCP333 via B4 Relay
2026-11-22 23:09   ` Bryan O'Donoghue [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bfe911bd-6642-44a7-8100-84ad6d23db04@kernel.org \
    --to=bod@kernel.org \
    --cc=dikshita.agarwal@oss.qualcomm.com \
    --cc=emcp@enser.io \
    --cc=hverkuil@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=stanimir.varbanov@linaro.org \
    --cc=vikash.garodia@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®