Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3512421pxv; Sun, 4 Jul 2021 22:05:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDKc0ndF86LMgWLRw86iBl6jInrQcTw0Cl8cJidSuM1ma4QRJjMNDLvmFNv73PaY93W7Dr X-Received: by 2002:a02:9706:: with SMTP id x6mr10813881jai.125.1625461550567; Sun, 04 Jul 2021 22:05:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625461550; cv=none; d=google.com; s=arc-20160816; b=qZy5G3ayZEOCQE2o81v+pyXQaxxfKpiUCQo2yxWmFuLS0HOsoUOVUMIN/ragXlCFv+ 517pSgiikchOqz5Amapp9k/ocwCmkZvaKyv3fvUlIHUUEE8Dl8jE1sEr0qSHwcW47d+6 siCdwTJ0BBd80ePwga0G3JYlxse8pv1bF96LicOysQeL1naCW7njJ/ViXIS5CLTT7YWs sHlh4whCMimA/pI0AxU1sCk5P2v+Jr4NtugVABSF/3nib/BvPjPL0bTIfpwQhHhhycKN 9XkSSrAa3HDWQtmSN4QRGxo8Dqb6FbfN/FEP7eHV8v6BGYhWxiQ0Uqdd2buhTiAgiHPD Q9nw== 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=nzm0nWj/aTYJHOKXonLiG7z2GGnZubrdTmRQ0xRi/ZI=; b=UnZGvpFbw1TmSLlDSzCKLyrnkN6VVLv77YOzVhox+I0g/LVcy7Aeyaio431AxiEXp9 E0/1EXjGfkuiKqDWkAOm/hznPYDcugJVeB/3+Ly7nAMze08dmRDgoXB4cLQv/7sJuw5A xpfM6V2Emqu8Tteow7wZsJcCK1vAR1aHWHkPn2V1WP3CBLep+gYrUTdevRSYpBCL10eH BD7AzWoe68Zj4OiAX3EpC5Jpy9w0rO1zZTn6OwW0ag2ZVLZTQW/ZDOh3UbL1tn5PPo3M a5t93s8jVhiURx24geVFLyFd8nL56lhxhb7jn6Vp0y3da9wTh4/4P7FFUNJINaT1x91e tTIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=A7xlaSnd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z6si13854652ilz.73.2021.07.04.22.05.39; Sun, 04 Jul 2021 22:05:50 -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=@chromium.org header.s=google header.b=A7xlaSnd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229725AbhGEFH0 (ORCPT + 99 others); Mon, 5 Jul 2021 01:07:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229599AbhGEFH0 (ORCPT ); Mon, 5 Jul 2021 01:07:26 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8D24C061574 for ; Sun, 4 Jul 2021 22:04:49 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id p24so22951408ljj.1 for ; Sun, 04 Jul 2021 22:04:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nzm0nWj/aTYJHOKXonLiG7z2GGnZubrdTmRQ0xRi/ZI=; b=A7xlaSndZwByNH1ngHi12Wy4wDajC6l1MlhCftDjaKo5zes9hg+ZZImW9ll3V2hBiX Y+iX+Fq9yigCH+771Lca7wXR92k0ABqkWePAkW9suWUo0E2GTeeqMYOeX9v5NysFKOnq nAJp8E0T7iCgoGRwvXnArWptJ45g9Uibv9rCo= 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=nzm0nWj/aTYJHOKXonLiG7z2GGnZubrdTmRQ0xRi/ZI=; b=T7GSz9T+YZfYDBjX9i9nZhJPLu8bFyS1J4/UX21xOc3IePmkLhz1G8ug+C52ZMfEN7 /KdpyLHIeqm1JAcX2XNNY5BuFbl1J4O4Rm8THjI/rUzJ43rrUdx4LBbYosWiaBg9HnzP JJZ3vKMXjWO0dFaeso0VKm+85N1He41XqtnvmMi+jDxafvla9JGJidlG3j09mm9ZR+Qp 40sVsTZiz1pbz8JVeOm5feyAQn/YaJ/rjkMHopR6VCLGxEj4XxLSbyjlMslHeeqT/oTg pqCDcd5LrPTVvjny0x3rss7dI9lI2QaWod+Q5vRlqvcvqZvEbtKAVwd+fNnLBHSULQGA LQRQ== X-Gm-Message-State: AOAM531m5pYdGBq0jjuYK9QX8AB+bCAp510xEwLyp7UE0jUN10cuh7aY Jv8iREvxT46i8qIcaQG246F8onfdC4gDQA== X-Received: by 2002:a2e:9e04:: with SMTP id e4mr9557609ljk.431.1625461487911; Sun, 04 Jul 2021 22:04:47 -0700 (PDT) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com. [209.85.167.45]) by smtp.gmail.com with ESMTPSA id d5sm970730lfs.1.2021.07.04.22.04.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 04 Jul 2021 22:04:47 -0700 (PDT) Received: by mail-lf1-f45.google.com with SMTP id bq39so17564222lfb.12 for ; Sun, 04 Jul 2021 22:04:47 -0700 (PDT) X-Received: by 2002:a19:5e16:: with SMTP id s22mr9437459lfb.614.1625461486444; Sun, 04 Jul 2021 22:04:46 -0700 (PDT) MIME-Version: 1.0 References: <20210519143011.1175546-1-acourbot@chromium.org> <20210519143011.1175546-6-acourbot@chromium.org> <9b37044d-f909-9169-3d22-fa6c5f788822@collabora.com> In-Reply-To: <9b37044d-f909-9169-3d22-fa6c5f788822@collabora.com> From: Alexandre Courbot Date: Mon, 5 Jul 2021 14:04:35 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 05/14] media: mtk-vcodec: venc: support START and STOP commands To: Dafna Hirschfeld , Yunfei Dong Cc: Tiffany Lin , Andrew-CT Chen , Hans Verkuil , Mauro Carvalho Chehab , Linux Media Mailing List , LKML , "moderated list:ARM/Mediatek SoC support" , Hsin-Yi Wang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dafna, sorry for (again) taking so long to come back to this! >_< On Fri, May 28, 2021 at 4:03 PM Dafna Hirschfeld wrote: > > Hi, > > I applied this patchset and tested the stateful encoder on debian with the command: > > [gst-master] root@debian:~/gst-build# gst-launch-1.0 filesrc location=images/jelly-800-640.YU12 ! rawvideoparse width=800 height=640 format=i420 ! videoconvert ! v4l2h264enc ! h264parse ! mp4mux ! filesink location=jelly-800-640.mp4 > > I get: > > Setting pipeline[ 79.703879] [MTK_V4L2] level=0 fops_vcodec_open(),190: encoder capability 10000000 > to PAUSED ... > Pipeline is PREROLLING ... > Redistribute latency... > [ 80.621076] mtk-iommu 10205000.iommu: Partial TLB flush timed out, falling back to full flush > [ 80.631232] mtk-iommu 10205000.iommu: Partial TLB flush timed out, falling back to full flush > [ 80.640878] mtk-iommu 10205000.iommu: Partial TLB flush timed out, falling back to full flush > [ 80.650766] mtk-iommu 10205000.iommu: Partial TLB flush timed out, falling back to full flush > [ 80.660430] mtk-iommu 10205000.iommu: Partial TLB flush timed out, falling back to full flush > [ 80.670194] mtk-iommu 10205000.iommu: Partial TLB flush timed out, falling back to full flush > [ 80.680967] mtk-iommu 10205000.iommu: Partial TLB flush timed out, falling back to full flush > [ 80.691376] mtk-iommu 10205000.iommu: Partial TLB flush timed out, falling back to full flush > [ 80.701718] mtk-iommu 10205000.iommu: Partial TLB flush timed out, falling back to full flush > [ 80.712106] mtk-iommu 10205000.iommu: Partial TLB flush timed out, falling back to full flush > [ 80.722272] [MTK_V4L2] level=0 mtk_venc_set_param(),371: fmt 0x3, P/L 0/0, w/h 800/640, buf 800/640, fps/bps 25/4000000, gop 0, i_period 0 > Pipeline is PREROLLED ... > Setting pipeline to PLAYING ... > New clock: GstSystemClock > [ 81.918747] [MTK_V4L2][ERROR] mtk_vcodec_wait_for_done_ctx:32: [3] ctx->type=1, cmd=1, wait_event_interruptible_timeout time=1000ms out 0 0! > [ 81.931392] [MTK_VCODEC][ERROR][3]: h264_encode_frame() irq_status=0 failed > [ 81.938470] [MTK_V4L2][ERROR] mtk_venc_worker:1219: venc_if_encode failed=-5 > [ 82.974746] [MTK_V4L2][ERROR] mtk_vcodec_wait_for_done_ctx:32: [3] ctx->type=1, cmd=1, wait_event_interruptible_timeout time=1000ms out 0 0! > [ 82.987392] [MTK_VCODEC][ERROR][3]: h264_encode_frame() irq_status=0 failed > [ 82.994471] [MTK_V4L2][ERROR] mtk_venc_worker:1219: venc_if_encode failed=-5 > [ 104.163977] cros-ec-dev cros-ec-dev.2.auto: Some logs may have been dropped... > 0:00:00.4 / 99:99:99. > 0:00:00.4 / 99:99:99. > 0:00:00.4 / 99:99:99. > 0:00:00.4 / 99:99:99. > 0:00:00.4 / 99:99:99. > 0:00:00.4 / 99:99:99. > 0:00:00.4 / 99:99:99. > 0:00:00.4 / 99:99:99. > 0:00:00.4 / 99:99:99. > 0:00:00.4 / 99:99:99. > ^Chandling interrupt. > > And then the streaming hangs. The same error happens without this patchset, but without > this patchset the statful encoder does not support V4L2_ENC_CMD_STOP/START needed by the spec. > I am not sure what cause the error and wether those mtk-iommu erros has to do with that. The issue > could also come from the mtk-vpu used by the encoder. > Do you have any idea where this can come from? Mmm, this looks like the firmware is unhappy about something and hangs. I wonder if the IOMMU messages above could not be linked to that, I remember seeing similar problems when the buffers were not properly synced on the device side. I'll try and see if I can deploy gstreamer on the old MT8173 Chromebook I am using to see if I have more success here, but no guarantee I can test in the same conditions as you unfortunately. :/ The MTK folks are the most qualified to look into this issue though. Yunfei, do you have any idea about why this is happening?