Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3283045pxk; Mon, 28 Sep 2020 13:10:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeVCWayhORD4AHIRa5fW/SbgEKdfIKACPiG4yrCk0deHjS4EcR17TceBLjSFEhbBXYTF+n X-Received: by 2002:a17:907:2456:: with SMTP id yw22mr411884ejb.337.1601323804527; Mon, 28 Sep 2020 13:10:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601323804; cv=none; d=google.com; s=arc-20160816; b=X601nJ6tARzVVqoIMj4Qa1D0qrLfWCST2sT9NBIEWYTM+4UeBvGTIig0Q20Nglgbu8 ZN+SKvBUdBVmVMFxnp2fvOgrDEAhg/K72arLUTxKi9fXl6Qvv5cdK4g7Cs5EVXn5YUq8 rUFU+Ix94gFxd0EEl7e+0gL5Ll/AIe0HLnrFFW+mcD+Mg5ttf5nA6a0rinf0awWlU4Lx edE+P7CB3ZZP+vADfv0qdKBP5/7B2kPFQimx5o1pT5Or9zsR0AOQXAufCDdtbQclIFQZ Ni3JKR6wCH6oEyjhh4Z6XuUtOwu/MssdoxvdKQ6pX1nsgiF1aamQEMy+hPFI4AqnkAh2 esDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=l3/RthoWOUwuzTyUqMkIutkczyzvaZtdBdBX3vl2kfw=; b=g+AfgoSp0nQawhatR63OytbaJbV2WGLO2zywywDwA201lnNXbPnrawpQx6N4hbW/p5 9/VBxc/YfUP7R//p89t5lOsc3OMdGRl3F1z2HrdsYQJuANoxflFqgTElKBRkKQ02hl7c ohKtUojBjFPzVHRdsXg6ETwcWRYEJM8oxDZBDYkwzTPTSOl+8HT+K5f6/LOOLJ7zz7+w LZduQ+KqgDnirMK2iVNThmrPunAg7DVK7dF3+HTnAz3k2VPUkuxEVn8WBgqYODnp1KNb X2v3S61/D7BMTaH2TI3A+38CaAxDVir8sHs2ZrStNMJUzJvyXa+pzd6EkeIOmTjLqd7G oL9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@vanguardiasur-com-ar.20150623.gappssmtp.com header.s=20150623 header.b=igdhPiI8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v21si1310375ejg.656.2020.09.28.13.09.41; Mon, 28 Sep 2020 13:10:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@vanguardiasur-com-ar.20150623.gappssmtp.com header.s=20150623 header.b=igdhPiI8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726748AbgI1UGh (ORCPT + 99 others); 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-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 >