[{"id":283,"web_url":"https://patchwork.libcamera.org/comment/283/","msgid":"<5063006.bLE978ScEP@avalon>","date":"2019-01-11T13:46:23","subject":"Re: [libcamera-devel] [PATCH] utils: ipu3: Use variables for\n\t'yavta' and 'media-ctl'","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Friday, 11 January 2019 15:08:57 EET Jacopo Mondi wrote:\n> Use variables defined at the beginning of ipu3 helper scripts to call\n> yavta and media-ctl. This makes easier override them if a locally\n> compiled version should be used in place of the system-wide installed\n> ones.\n\nI had this in the first version of the scripts, but then decided it was \ncleaner to select the yavta and media-ctl binaries through PATH instead of \nhacking the script. Would that work for you ?\n\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  utils/ipu3/ipu3-capture.sh | 9 ++++++---\n>  utils/ipu3/ipu3-process.sh | 8 +++++---\n>  2 files changed, 11 insertions(+), 6 deletions(-)\n> \n> diff --git a/utils/ipu3/ipu3-capture.sh b/utils/ipu3/ipu3-capture.sh\n> index ba6147b..9d83cd4 100755\n> --- a/utils/ipu3/ipu3-capture.sh\n> +++ b/utils/ipu3/ipu3-capture.sh\n> @@ -13,6 +13,9 @@\n>  # - raw2pnm (from nvt https://github.com/intel/nvt.git)\n>  # - yavta (from git://git.ideasonboard.org/yavta.git)\n> \n> +MEDIACTL=$(which media-ctl)\n> +YAVTA=$(which yavta)\n> +\n>  # Locate the sensor entity\n>  find_sensor() {\n>  \tlocal bus\n> @@ -113,8 +116,8 @@ capture_frames() {\n>  \t\tfile_op=\"--file=/tmp/frame-#.bin\"\n>  \tfi\n> \n> -\tyavta -c$frame_count -n5 -I -f $ipu3_format -s $sensor_size $file_op \\\n> -\t\t$($mediactl -e \"$ipu3_capture\")\n> +\t${YAVTA} -c$frame_count -n5 -I -f $ipu3_format -s $sensor_size $file_op \\\n> +\t\t   $($mediactl -e \"$ipu3_capture\")\n>  }\n> \n>  # Convert captured files to ppm\n> @@ -173,7 +176,7 @@ sensor_name=$1\n> \n>  sensor=$(find_sensor $sensor_name) || exit\n>  mdev=$(find_media_device) || exit\n> -mediactl=\"media-ctl -d $mdev\"\n> +mediactl=\"${MEDIACTL} -d $mdev\"\n> \n>  parse_pipeline $sensor\n>  configure_pipeline\n> diff --git a/utils/ipu3/ipu3-process.sh b/utils/ipu3/ipu3-process.sh\n> index bb4abbe..ccdeb27 100755\n> --- a/utils/ipu3/ipu3-process.sh\n> +++ b/utils/ipu3/ipu3-process.sh\n> @@ -13,6 +13,8 @@\n>  # - raw2pnm (from nvt https://github.com/intel/nvt.git)\n>  # - yavta (from git://git.ideasonboard.org/yavta.git)\n> \n> +MEDIACTL=$(which media-ctl)\n> +YAVTA=$(which yavta)\n>  imgu_entity=\"ipu3-imgu 0\"\n> \n>  # Locate the media device\n> @@ -20,7 +22,7 @@ find_media_device() {\n>  \tlocal mdev\n> \n>  \tfor mdev in /dev/media* ; do\n> -\t\tmedia-ctl -d $mdev -p | grep -q \"^driver[ \\t]*ipu3-imgu$\" && break\n> +\t\t$MEDIACTL -d $mdev -p | grep -q \"^driver[ \\t]*ipu3-imgu$\" && break\n>  \t\tmdev=\n>  \tdone\n> \n> @@ -62,7 +64,7 @@ configure_pipeline() {\n>  process_frames() {\n>  \tconfigure_pipeline\n> \n> -\tlocal yavta=\"yavta -n $nbufs -c$frame_count\"\n> +\tlocal yavta=\"${YAVTA} -n $nbufs -c$frame_count\"\n> \n>  \t# Save the main and viewfinder outputs to disk, capture and drop 3A\n>  \t# statistics. Sleep 500ms between each execution of yavta to keep the\n> @@ -189,7 +191,7 @@ out_size=${out_size:-$in_size}\n>  vf_size=${vf_size:-$in_size}\n> \n>  mdev=$(find_media_device) || exit\n> -mediactl=\"media-ctl -d $mdev\"\n> +mediactl=\"${MEDIACTL} -d $mdev\"\n>  echo \"Using device $mdev\"\n> \n>  output_dir=\"/tmp\"\n> --\n> 2.20.1\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B0CB660B31\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 11 Jan 2019 14:45:17 +0100 (CET)","from avalon.localnet (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 08D9253E;\n\tFri, 11 Jan 2019 14:45:12 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1547214313;\n\tbh=N0Z11n6S8o9oMwxRohz72E4Dnc96PpUPBk2WgZuj7lQ=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=PzrXfqZny/crwfBDehNTRtWxWi5D1WrMuknCW4f9T9+3DGJhD+uVqYGoVdhHnl3M0\n\tKWLMLD9liYJhfIqZcY8H7WiZ6YwbHawXdmQ8zEkFlKY/uMW+niiP0ukoUgGEyROWej\n\tV4hjSSl/kCUQwY/CBLSfzRALjENeEVp3+3nHFkKY=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 11 Jan 2019 15:46:23 +0200","Message-ID":"<5063006.bLE978ScEP@avalon>","Organization":"Ideas on Board Oy","In-Reply-To":"<20190111130857.17946-1-jacopo@jmondi.org>","References":"<20190111130857.17946-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"7Bit","Content-Type":"text/plain; charset=\"us-ascii\"","Subject":"Re: [libcamera-devel] [PATCH] utils: ipu3: Use variables for\n\t'yavta' and 'media-ctl'","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Fri, 11 Jan 2019 13:45:17 -0000"}},{"id":284,"web_url":"https://patchwork.libcamera.org/comment/284/","msgid":"<20190111135328.vm3vqqxagstgcycn@uno.localdomain>","date":"2019-01-11T13:53:28","subject":"Re: [libcamera-devel] [PATCH] utils: ipu3: Use variables for\n\t'yavta' and 'media-ctl'","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent,\n\nOn Fri, Jan 11, 2019 at 03:46:23PM +0200, Laurent Pinchart wrote:\n> Hi Jacopo,\n>\n> Thank you for the patch.\n>\n> On Friday, 11 January 2019 15:08:57 EET Jacopo Mondi wrote:\n> > Use variables defined at the beginning of ipu3 helper scripts to call\n> > yavta and media-ctl. This makes easier override them if a locally\n> > compiled version should be used in place of the system-wide installed\n> > ones.\n>\n> I had this in the first version of the scripts, but then decided it was\n> cleaner to select the yavta and media-ctl binaries through PATH instead of\n> hacking the script. Would that work for you ?\n>\n\nSure. Please ignore this patch then.\n\nThanks\n  j\n\n> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > ---\n> >  utils/ipu3/ipu3-capture.sh | 9 ++++++---\n> >  utils/ipu3/ipu3-process.sh | 8 +++++---\n> >  2 files changed, 11 insertions(+), 6 deletions(-)\n> >\n> > diff --git a/utils/ipu3/ipu3-capture.sh b/utils/ipu3/ipu3-capture.sh\n> > index ba6147b..9d83cd4 100755\n> > --- a/utils/ipu3/ipu3-capture.sh\n> > +++ b/utils/ipu3/ipu3-capture.sh\n> > @@ -13,6 +13,9 @@\n> >  # - raw2pnm (from nvt https://github.com/intel/nvt.git)\n> >  # - yavta (from git://git.ideasonboard.org/yavta.git)\n> >\n> > +MEDIACTL=$(which media-ctl)\n> > +YAVTA=$(which yavta)\n> > +\n> >  # Locate the sensor entity\n> >  find_sensor() {\n> >  \tlocal bus\n> > @@ -113,8 +116,8 @@ capture_frames() {\n> >  \t\tfile_op=\"--file=/tmp/frame-#.bin\"\n> >  \tfi\n> >\n> > -\tyavta -c$frame_count -n5 -I -f $ipu3_format -s $sensor_size $file_op \\\n> > -\t\t$($mediactl -e \"$ipu3_capture\")\n> > +\t${YAVTA} -c$frame_count -n5 -I -f $ipu3_format -s $sensor_size $file_op \\\n> > +\t\t   $($mediactl -e \"$ipu3_capture\")\n> >  }\n> >\n> >  # Convert captured files to ppm\n> > @@ -173,7 +176,7 @@ sensor_name=$1\n> >\n> >  sensor=$(find_sensor $sensor_name) || exit\n> >  mdev=$(find_media_device) || exit\n> > -mediactl=\"media-ctl -d $mdev\"\n> > +mediactl=\"${MEDIACTL} -d $mdev\"\n> >\n> >  parse_pipeline $sensor\n> >  configure_pipeline\n> > diff --git a/utils/ipu3/ipu3-process.sh b/utils/ipu3/ipu3-process.sh\n> > index bb4abbe..ccdeb27 100755\n> > --- a/utils/ipu3/ipu3-process.sh\n> > +++ b/utils/ipu3/ipu3-process.sh\n> > @@ -13,6 +13,8 @@\n> >  # - raw2pnm (from nvt https://github.com/intel/nvt.git)\n> >  # - yavta (from git://git.ideasonboard.org/yavta.git)\n> >\n> > +MEDIACTL=$(which media-ctl)\n> > +YAVTA=$(which yavta)\n> >  imgu_entity=\"ipu3-imgu 0\"\n> >\n> >  # Locate the media device\n> > @@ -20,7 +22,7 @@ find_media_device() {\n> >  \tlocal mdev\n> >\n> >  \tfor mdev in /dev/media* ; do\n> > -\t\tmedia-ctl -d $mdev -p | grep -q \"^driver[ \\t]*ipu3-imgu$\" && break\n> > +\t\t$MEDIACTL -d $mdev -p | grep -q \"^driver[ \\t]*ipu3-imgu$\" && break\n> >  \t\tmdev=\n> >  \tdone\n> >\n> > @@ -62,7 +64,7 @@ configure_pipeline() {\n> >  process_frames() {\n> >  \tconfigure_pipeline\n> >\n> > -\tlocal yavta=\"yavta -n $nbufs -c$frame_count\"\n> > +\tlocal yavta=\"${YAVTA} -n $nbufs -c$frame_count\"\n> >\n> >  \t# Save the main and viewfinder outputs to disk, capture and drop 3A\n> >  \t# statistics. Sleep 500ms between each execution of yavta to keep the\n> > @@ -189,7 +191,7 @@ out_size=${out_size:-$in_size}\n> >  vf_size=${vf_size:-$in_size}\n> >\n> >  mdev=$(find_media_device) || exit\n> > -mediactl=\"media-ctl -d $mdev\"\n> > +mediactl=\"${MEDIACTL} -d $mdev\"\n> >  echo \"Using device $mdev\"\n> >\n> >  output_dir=\"/tmp\"\n> > --\n> > 2.20.1\n> >\n> > _______________________________________________\n> > libcamera-devel mailing list\n> > libcamera-devel@lists.libcamera.org\n> > https://lists.libcamera.org/listinfo/libcamera-devel\n>\n>\n> --\n> Regards,\n>\n> Laurent Pinchart\n>\n>\n>","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net\n\t[217.70.183.200])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1083C60B31\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 11 Jan 2019 14:53:21 +0100 (CET)","from uno.localdomain (2-224-242-101.ip172.fastwebnet.it\n\t[2.224.242.101]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 8565E2000C;\n\tFri, 11 Jan 2019 13:53:20 +0000 (UTC)"],"X-Originating-IP":"2.224.242.101","Date":"Fri, 11 Jan 2019 14:53:28 +0100","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190111135328.vm3vqqxagstgcycn@uno.localdomain>","References":"<20190111130857.17946-1-jacopo@jmondi.org>\n\t<5063006.bLE978ScEP@avalon>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"3i36bnzoouyisurs\"","Content-Disposition":"inline","In-Reply-To":"<5063006.bLE978ScEP@avalon>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH] utils: ipu3: Use variables for\n\t'yavta' and 'media-ctl'","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Fri, 11 Jan 2019 13:53:21 -0000"}}]