From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C132FC2D0A8 for ; Mon, 28 Sep 2020 20:06:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 587552078B for ; Mon, 28 Sep 2020 20:06:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=vanguardiasur-com-ar.20150623.gappssmtp.com header.i=@vanguardiasur-com-ar.20150623.gappssmtp.com header.b="igdhPiI8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726799AbgI1UGh (ORCPT ); Mon, 28 Sep 2020 16:06:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726325AbgI1UGg (ORCPT ); Mon, 28 Sep 2020 16:06:36 -0400 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92815C061755 for ; Mon, 28 Sep 2020 13:06:36 -0700 (PDT) Received: by mail-ed1-x544.google.com with SMTP id c8so3232454edv.5 for ; Mon, 28 Sep 2020 13:06:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vanguardiasur-com-ar.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=l3/RthoWOUwuzTyUqMkIutkczyzvaZtdBdBX3vl2kfw=; b=igdhPiI8ZUTi0qzKtluflwazu/79pMgWhtOpYJflLX7J3wteUplQRRSQYloDJ+bW/M R4pBThWClqAq755nEHri1H8DfGiKcvYa2Q0LrQuq1ajyHt/NEEkJq9GtlBce3quiVkQ9 TLhetOGldD3WyIqrfGXg7KoNdTSXLElpu2bT+hqwaTehSFB5wLEdEubI23LplSO4LeGe vDyBScBIam9awD3FvMKG3EeKF/rVPgknRLnOugV2BYOt+1BSo4v5DnghWyV9KyANG7Ox MIKl68F8gC1vhgDnuN6HZFZ0SHuwRuNwOZ/DMOafHvDBcutY8A58V5UAPiToJCYgiLjT Q1+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=l3/RthoWOUwuzTyUqMkIutkczyzvaZtdBdBX3vl2kfw=; b=ASyLQQazgcmhBo45PQf9ZC032ITb9sRDdt0wmlOpLNgNMKa7qTk5HRkerCdJ+24GB8 1CoOG7gae6KBovPXnKDorrWnx/B9ict+1qgYZdrWeso6TTKU/MJDFYzlcYmuArCcYDxb GUzrJT7A9fZej5wDbfF6yb0uyrUy8oBUvyFCkxjI1FKDe96Jc2HTfFN8kChpN7ZnYlX2 +6eF1+s3TcZzlzNOhTTmSwgmx4X3adh0g/CvBX4Cb+H0nveENGYbVVzPFp9v5MDKNKjz chQ8AGQCiwSebbz0OBJPlYSo520AC8m/uW4njggzGjXtML47AhTG295pXKdffWZiZ2n2 0IkA== X-Gm-Message-State: AOAM532O7JHwD8haNpcrCUEnykvS1AOQBDzQ35kfx2HYMsDRhcgkWIM8 ie6V7+T2Mi46vRYvbAgZ05kMjI9ywnmWeaDRhg5wSA== X-Google-Smtp-Source: ABdhPJzkd8lOyD117kZmTAJd38Vp62XqajHUVqn2ZnHvEp5iveEQG9dxwKfDUY7OAmwthEgQguzSjt5wjgFa96SGTNc= X-Received: by 2002:a05:6402:2c3:: with SMTP id b3mr3718802edx.213.1601323595273; Mon, 28 Sep 2020 13:06:35 -0700 (PDT) MIME-Version: 1.0 References: <3b140eaf883b4666985c0be0db8d53e8@skidata.com> <9444c9375f58436b9e6a0fa3a4088e17@skidata.com> In-Reply-To: From: Ezequiel Garcia Date: Mon, 28 Sep 2020 17:06:24 -0300 Message-ID: Subject: Re: [PATCH] media: coda: avoid starvation on well-compressed data To: Benjamin Bara - SKIDATA Cc: "p.zabel@pengutronix.de" , "mchehab@kernel.org" , "linux-media@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Richard Leitner - SKIDATA , "l.stach@pengutronix.de" , Chris Healy , Nicolas Dufresne Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Benjamin, On Fri, 18 Sep 2020 at 05:35, Benjamin Bara - SKIDATA wrote: > > Hi all, > > there are still cases where the decoder starves. > Also, the failure log at the bottom contradicts with the 2x256 bytes assumption. > When I increase the threshold to 512 bytes, the respective video (and all my other tests) work. > > Is it possible that the limitation is 2x512 bytes or is there another "limitation", > beside the "two window" one, which is "accidentally fulfilled" with this approach? > > What do you think about the approach in the patch; is it possible to get it mainline? > Any help, feedback, hints or suggestions would be really appreciated! > > I will do some additional testing to see if the 2x512 threshold finally catches the problem. > When I'm done, I will provide a second version of the patch. > Thanks for the report. I'm seeing a similar behavior and have been doing some experiments with your patch, and trying different solutions as well. My colleague Nicolas pointed out to me that crafting a video with serie of black frames in QCIF resolution, would trigger the timeout: gst-launch-1.0 videotestsrc pattern=black num-buffers=300 ! video/x-raw,format=I420,width=176,height=120 ! avenc_mpeg2video ! mpegvideoparse ! mpegtsmux ! filesink location=black-qcif-10s.ts We are still doing some tests to see if we can come up with a proper solution. I will keep you posted. If you have some (public) bitstream that are known to timeout, and that you could share with me, that would be nice, so I could have a more complete set of samples. Thanks, Ezequiel > Many thanks & best regards > Benjamin > > *Failure Log:* > [ 108.108711] coda 2040000.vpu: 0: active metas: > [ 108.108716] coda 2040000.vpu: 0: - payload: 4240 > [ 108.108721] coda 2040000.vpu: 0: - payload: 900 > [ 108.108726] coda 2040000.vpu: 0: - payload: 170 > [ 108.108730] coda 2040000.vpu: 0: - payload: 403 > [ 108.108734] coda 2040000.vpu: 0: want to queue: payload: 405 > [ 109.057738] coda 2040000.vpu: CODA PIC_RUN timeout >