All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Griffin <peter.griffin@linaro.org>
Cc: marcandre.lureau@redhat.com, stratos-dev@op-lists.linaro.org,
	qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [PATCH 1/8] vhost-user-video: Add a README.md with cheat sheet of commands
Date: Tue, 11 Jan 2022 14:48:27 +0000	[thread overview]
Message-ID: <875yqqcocq.fsf@linaro.org> (raw)
In-Reply-To: <20211209145601.331477-2-peter.griffin@linaro.org>


Peter Griffin <peter.griffin@linaro.org> writes:

> Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
> ---
>  tools/vhost-user-video/README.md | 98 ++++++++++++++++++++++++++++++++
>  1 file changed, 98 insertions(+)
>  create mode 100644 tools/vhost-user-video/README.md
>
> diff --git a/tools/vhost-user-video/README.md b/tools/vhost-user-video/README.md
> new file mode 100644
> index 0000000000..c55e0a7b68
> --- /dev/null
> +++ b/tools/vhost-user-video/README.md

I think as we want this to be visible to the user we should put it in:

  docs/system/devices/vhost-user-video.rst

with the appropriate update to device-emulation.rst to include it.

> @@ -0,0 +1,98 @@
> +# Overview vhost-user-video
> +
> +This vmm translates from virtio-video v3 protocol and writes
> +to a v4l2 mem2mem stateful decoder/encoder device [1]. v3 was
> +chosen as that is what the virtio-video Linux frontend driver
> +currently implements.
> +
> +The primary goal so far is to enable development of virtio-video
> +frontend driver using purely open source software. Using vicodec
> +v4l2 stateful decoder on the host for testing then allows a pure
> +virtual environment for development and testing.
> +
> +Currently the vmm only supports v4l2 stateful devices, and the
> +intention is it will be used with Arm SoCs that implement stateful
> +decode/encode devices such as Qcom Venus, RPi, MediaTek etc.
> +
> +A Qemu + vicodec setup for virtio-video should also allow for
> +CI systems like kernelci, lkft to test the virtio-video interface
> +easily.
> +
> +Currently support for VAAPI or decoding via libavcodec or similar
> +libraries is not implemented, but this could be added in the future.
> +
> +Some example commands are provided below on how to run the daemon
> +and achieve a video decode using vicodec and a link to some test
> +content.
> +
> +[1] https://www.kernel.org/doc/html/latest/userspace-api/media/
> +    v4l/dev-decoder.html
> +
> +[2] https://lwn.net/Articles/760650/
> +
> +# Guest Linux kernel modules
> +CONFIG_MEDIA_SUPPORT=y
> +CONFIG_MEDIA_TEST_SUPPORT=y
> +CONFIG_V4L_TEST_DRIVERS=y
> +CONFIG_VIRTIO_VIDEO=y
> +CONFIG_GDB_SCRIPTS=y

Is GDB_SCRIPTS really needed here?

> +CONFIG_DRM_VIRTIO_GPU=y
> +
> +# Host kernel modules
> +CONFIG_MEDIA_SUPPORT=y
> +CONFIG_MEDIA_TEST_SUPPORT=y
> +CONFIG_V4L_TEST_DRIVERS=y
> +CONFIG_VIDEO_VICODEC=y

this last one isn't set on the default Debian kernel so it might be
worth mentioning that.

> +
> +# Run vhost-user-video daemon with vicodec
> +# (video3 typically is the stateful video)
> +vhost-user-video --socket-path=/tmp/video.sock --v4l2-device=/dev/video3
> +
> +# Qemu command for virtio-video device
> +
> +-device vhost-user-video-pci,chardev=video,id=video
> +-chardev socket,path=/tmp//video.sock,id=video
> +
> +# Example v4l2-ctl decode command
> +wget https://people.linaro.org/~peter.griffin/jelly_640_480-420P.fwht
> +
> +v4l2-ctl -d0 -x width=640,height=480 -v width=640,height=480,pixelformat=YU12
> +--stream-mmap --stream-out-mmap --stream-from jelly_640_480-420P.fwht
> +--stream-to out-jelly-640-480.YU12
> +
> +# Play the raw decoded video with ffplay or mplayer
> +ffplay -loglevel warning -v info -f rawvideo -pixel_format  yuv420p
> +  -video_size "640x480" ./out-jelly-640-480.YU12
> +
> +mplayer -demuxer rawvideo -rawvideo
> +  format=i420:w=640:h=480:fps=25 out-jelly-640-480.YU12
> +
> +# Enable v4l2 debug in virtio-video frontend driver
> +echo 0x1f > /sys/class/video4linux/video0/dev_debug
> +
> +# Enable v4l2 debug in vicodec backend driver
> +echo 0x1f > /sys/class/video4linux/video3/dev_debug
> +

and cut here...

The rest can probably be dropped from user facing documentation as long
as we record it somewhere ourselves (is it in the cards?).

> +# optee-build system qemu virtio-video command
> +make QEMU_VIRTFS_ENABLE=y QEMU_USERNET_ENABLE=y CFG_TA_ASLR=n
> +    QEMU_VHOSTUSER_MEM=y QEMU_VIRTVIDEO_ENABLE=y SSH_PORT_FW=y run-only
> +
> +Current status
> +* Tested with v4l2-ctl from v4l2-utils and vicodec stateful decoder driver
> +* v4l2-compliance - reports
> +Total: 43, Succeeded: 37, Failed: 6, Warnings: 0
> +
> +Known Issues
> +* 6 v4l2-compliance failures remaining
> +* v4l2-ctl 0fps misleading output
> +* v4l2-ctl sometimes reports - 0 != <somenumber>
> +* Encoder not tested yet
> +
> +TODOs
> +* Test with a "real" stateful decoder & codec
> +  (e.g. Qcom Venus or RPi).
> +* Test more v4l2 userspaces in the guest
> +
> +Future potential features
> +* Emulation using libavcodec or similar library
> +* Support for VAAPI, OpenMax or v4l2 stateless devices


-- 
Alex Bennée


  reply	other threads:[~2022-01-11 14:59 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09 14:55 [PATCH 0/8] virtio: Add vhost-user based Video decode Peter Griffin
2021-12-09 14:55 ` [PATCH 1/8] vhost-user-video: Add a README.md with cheat sheet of commands Peter Griffin
2022-01-11 14:48   ` Alex Bennée [this message]
2022-02-03 10:13     ` Peter Griffin
2021-12-09 14:55 ` [PATCH 2/8] MAINTAINERS: Add virtio-video section Peter Griffin
2022-01-11 14:57   ` Alex Bennée
2021-12-09 14:55 ` [PATCH 3/8] vhost-user-video: boiler plate code for vhost-user-video device Peter Griffin
2022-01-11 14:58   ` Alex Bennée
2022-02-03 11:14     ` Peter Griffin
2021-12-09 14:55 ` [PATCH 4/8] vhost-user-video: add meson subdir build logic Peter Griffin
2022-01-11 16:03   ` Alex Bennée
2022-02-03 11:31     ` Peter Griffin
2021-12-09 14:55 ` [PATCH 5/8] standard-headers: Add virtio_video.h Peter Griffin
2021-12-10 10:57   ` Michael S. Tsirkin
2021-12-10 13:09     ` Peter Griffin
2021-12-12  9:37       ` Michael S. Tsirkin
2021-12-10 11:02   ` Michael S. Tsirkin
2021-12-10 11:25   ` Peter Maydell
2021-12-10 13:23     ` Peter Griffin
2021-12-09 14:55 ` [PATCH 6/8] virtio_video: Add Fast Walsh-Hadamard Transform format Peter Griffin
2021-12-10 10:58   ` Michael S. Tsirkin
2021-12-10 12:45     ` Peter Griffin
2021-12-09 14:56 ` [PATCH 7/8] hw/display: add vhost-user-video-pci Peter Griffin
2022-01-11 16:11   ` Alex Bennée
2021-12-09 14:56 ` [PATCH 8/8] tools/vhost-user-video: Add initial vhost-user-video vmm Peter Griffin
2022-01-11 16:38   ` Alex Bennée
2022-01-11 15:38 ` [PATCH 0/8] virtio: Add vhost-user based Video decode Michael S. Tsirkin
2022-02-03 12:10   ` Peter Griffin
2022-02-03 13:27     ` Michael S. Tsirkin
2022-01-11 16:24 ` Alex Bennée
2022-02-03 11:43   ` Peter Griffin

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=875yqqcocq.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@redhat.com \
    --cc=peter.griffin@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stratos-dev@op-lists.linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.