V4L2 M2M decoders on mainline: need testers !

Moderators: mdrjr, odroid

V4L2 M2M decoders on mainline: need testers !

Unread postby Ely » Fri Apr 13, 2018 2:10 pm

Hello everyone,

I'm currently developing a V4L2 M2M mainline driver for the video decoders found within AMLogic SoCs.

I currently have MPEG 1,2,4, H.263, H.264 decoding working on S905X.
I also tested on S805 (odroid-c1), it works but there are limitations.

However I don't have a S905 board, such as an odroid-c2, so I'm coming here looking for guinea pigs to try it out :-) .


To test, you will need either a very recent FFmpeg (> 3.4), or GStreamer.

Examples pipelines:

  • FFmpeg (dump raw NV12 frames to a file)
    Code: Select all
    ffmpeg -c:v h264_v4l2m2m -i input.mkv -f rawvideo output_nv12

  • GStreamer 1.12 (display frames to KMS, please kill x11 beforehand)
    Code: Select all
    gst-launch-1.0 filesrc location=input.mkv ! matroskademux ! h264parse ! v4l2video0dec ! videoconvert n-threads=4 ! kmssink driver-name=meson force-modesetting=true connector-id=29 sync=false

  • GStreamer 1.14 (display frames to KMS, please kill x11 beforehand)
    Code: Select all
    gst-launch-1.0 filesrc location=input.mkv ! matroskademux ! h264parse ! v4l2h264dec ! videoconvert n-threads=4 ! kmssink driver-name=meson force-modesetting=true connector-id=29 sync=false

For GStreamer pipelines, make sure you install all kind of plugins (gstreamer1.0-plugins-good, gstreamer1.0-plugins-bad, gstreamer1.0-plugins-ugly, gstreamer1.0-libav ..) beforehand. Also, don't use matroskademux for something else than mkv. I think it's qtdemux for mp4.

I obviously haven't tested those commands on a C2 so I'm hoping all the parameters are correct..

4K H.264 (3840x2160) should work, but please note that the speed will be slow. Since DRM doesn't support overlay planes / NV12 as of yet, the frames need to be color converted and scaled before being sent to KMS. And because the buffers are in cache-less coherent memory, it's very slow.

Don't try HEVC! It's advertised by the driver but does not work, and you'll end up freezing your board.

Please report here for any kind of problem.. crashes, freezes, bad picture, etc etc. Preferably with a dmesg or what was in your uart before the error :).

Thank you !

Ely
Last edited by Ely on Wed Apr 18, 2018 10:58 pm, edited 1 time in total.
Ely
 
Posts: 19
Joined: Sat Jan 31, 2015 9:27 pm
languages_spoken: english

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby moon.linux » Sun Apr 15, 2018 12:56 am

@Ely Great will give this a try...
moon.linux
 
Posts: 1107
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby odroid » Sun Apr 15, 2018 12:25 pm

Great news!
I couldn't expect the VPU driver implementation appears with V4L2 interfaces on Kernel 4.17. :o

@moon.linux,
Since H.264 VPU in S905 can support up to 30fps at 4K resolution while H.265 decoder can handle up to 60fps.
So, consider the limitation when when you try the FFMPEG/FFPLAY test.
User avatar
odroid
Site Admin
 
Posts: 28257
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby Ely » Sun Apr 15, 2018 1:56 pm

@moon.linux Thanks !
@odroid Well it's far from being mainlined (targeting 4.19), but it's coming along nicely. Also H.265 is not currently supported so this format won't work :P .
Ely
 
Posts: 19
Joined: Sat Jan 31, 2015 9:27 pm
languages_spoken: english

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby rooted » Mon Apr 16, 2018 4:07 am

Need to get a C2 to the OP ;)
User avatar
rooted
 
Posts: 5164
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby moon.linux » Thu Apr 19, 2018 3:35 pm

@Ely

First I tried to copy the per-compiled image and it failed to boot up.
Code: Select all
[ 2334.620841] reboot: Restarting system
INFO:    PSCI Affinity Map:
INFO:      AffInst: Level 0, MPID 0x0, State ON
INFO:      AffInst: Level 0, MPID 0x1, State ON
INFO:      AffInst: Level 0, MPID 0x2, State ON
INFO:      AffInst: Level 0, MPID 0x3, State ON
bl31 reb¦GXBB:BL1:08dafd:0a8993;FEAT:EDFC318C;POC:3;RCY:0;EMMC:800;NAND:81;SD:0;                                                                     READ:0;CHK:0;
TE: 322758
no sdio debug board detected

BL2 Built : 11:44:26, Nov 25 2015.
gxb gfb13a3b-c2 - jcao@wonton

Board ID = 8
set vcck to 1100 mv
set vddee to 1050 mv
CPU clk: 1536MHz
DDR channel setting: DDR0 Rank0+1 same
DDR0: 2048MB(auto) @ 912MHz(2T)-13
DataBus test pass!
AddrBus test pass!
Load fip header from SD, src: 0x0000c200, des: 0x01400000, size: 0x000000b0
Load bl30 from SD, src: 0x00010200, des: 0x01000000, size: 0x00009ef0
Sending bl30........................................OK.
Run bl30...
Load bl301 from SD, src: 0x0001c200, des: 0x01000000, size: 0x000018c0
Wait bl30...Done
Sending bl301.......OK.
Run bl301...
from SD, src: 0x00020200, des: 0x10100000, size: 0x00011130


--- UART initialized after reboot ---
[Reset cause: unknown]
[Image: unknown, amlogic_v1.1.3046-00db630-dirty 2016-08-31 09:24:14 tao.zeng@dr                                                                     oid04]
bl30: check_permit, count is 1
bl30: check_permit: ok!
chipid: ef Load bl33 from SD, src: 0x00034200, des: 0x01000000, size: 0x000769f0
be ad de d f0 ad ba ef be ad de not ES chip
[0.437652 Inits done]
secure task start!
high task start!
low task start!
NOTICE:  BL3-1: v1.0(debug):4d2e34d
NOTICE:  BL3-1: Built : 17:08:35, Oct 29 2015
INFO:    BL3-1: Initializing runtime services
INFO:    BL3-1: Preparing for EL3 exit to normal world
INFO:    BL3-1: Next image address = 0x1000000
INFO:    BL3-1: Next image spsr = 0x3c9


U-Boot 2015.01-00014-g2e4380b-dirty (Jan 16 2018 - 02:09:02)

DRAM:  2 GiB
Relocation Offset is: 76f2f000
-------------------------------------------------
* Welcome to Hardkernel's ODROID-C2
-------------------------------------------------
CPU : AMLogic S905
S/N : HKC213254DFDA0AD
MAC : 00:1e:06:33:ed:2d
BID : HKC2211612
-------------------------------------------------
register usb cfg[1][0] = 0000000077f95010
register usb cfg[0][1] = 0000000077f95030
vpu detect type: 5
vpu clk_level = 7
set vpu clk: 666667000Hz, readback: 666660000Hz(0x300)
MMC:   aml_priv->desc_buf = 0x0000000073f27d30
aml_priv->desc_buf = 0x0000000073f29ec0
SDIO Port B: 0, SDIO Port C: 1
ret = 1 .[mmc_init] mmc init success
In:    serial
Out:   serial
Err:   serial
----------------------------------
MMC Size : 32 GB
----------------------------------
reading boot-logo.bmp.gz
** Unable to read file boot-logo.bmp.gz **
reading boot-logo.bmp
** Unable to read file boot-logo.bmp **
movi: the partiton 'logo' is reading...

MMC read: dev # 0, block # 61024, count 2048 ... 2048 blocks read: OK
hpd_state=1
[CANVAS]addr=0x3f800000 width=3840, height=1440

set hdmitx VIC = 16
hdmitx phy setting done
set hdmitx VIC = 16
hdmitx phy setting done
Error: Bad gzipped data
There is no valid bmp file at the given address
Net:   Meson_Ethernet
Hit [Enter] key twice to stop autoboot:  0
reading boot.ini
3347 bytes read in 6 ms (543.9 KiB/s)
cfgload: applying boot.ini...
cfgload: setenv bootrootfs "boot=/dev/mmcblk1p1 disk=/dev/mmcblk1p2 root=/dev/mm                                                                     cblk1p2"
cfgload: setenv console "console=tty0 console=ttyAML0,115200n8"
cfgload: setenv odroid   "no_console_suspend consoleblank=0 loglevel=8 debug ro                                                                      rootwait fsck.repair=yes net.ifnames=0"
cfgload: setenv maxcpus "4"
cfgload: setenv max_freq "1536"  # 1.536GHz
cfgload: setenv kernel  "fatload mmc 0:1 0x1080000 Image"
cfgload: setenv dtb     "fatload mmc 0:1 0x1000000 meson-gxbb-odroidc2.dtb"
cfgload: setenv bootseq "bootm 0x1080000 - 0x1000000"
cfgload: setenv bootcmd "${kernel}; ${dtb}; ${bootseq}"
cfgload: setenv bootargs "${console} ${bootrootfs} ${odroid} ${libreelec}"
cfgload: run bootcmd
reading Image
15581696 bytes read in 701 ms (21.2 MiB/s)
reading meson-gxbb-odroidc2.dtb
23416 bytes read in 7 ms (3.2 MiB/s)
ee_gate_off ...
Wrong Image Format for bootm command
ERROR: can't get kernel image!
ee_gate_on ...
reading boot-logo.bmp.gz
** Unable to read file boot-logo.bmp.gz **
reading boot-logo.bmp
** Unable to read file boot-logo.bmp **
movi: the partiton 'logo' is reading...

MMC read: dev # 0, block # 61024, count 2048 ... 2048 blocks read: OK
hpd_state=1
set hdmitx VIC = 16
hdmitx phy setting done
set hdmitx VIC = 16
hdmitx phy setting done
Error: Bad gzipped data
There is no valid bmp file at the given address
movi: the partiton 'dtb' is reading...

MMC read: dev # 0, block # 1504, count 128 ... 128 blocks read: OK
movi: the partiton 'boot' is reading...

MMC read: dev # 0, block # 1632, count 32768 ... 32768 blocks read: OK
Bad Linux ARM64 Image magic!
odroidc2#


Then I tried to compile the linux tree by enable CONFIG_VIDEO_AML_MESON_VDEC=m and succefully booted into new compiled linux.
Code: Select all
[    6.889112] libphy: stmmac: probed
[    7.129018] meson_pwrc_vdec_power_on
[    7.129024] meson_pwrc_vdec_setup_clk
[    7.129505] Requesting IRQ 32
[    7.129702] meson_pwrc_vdec_power_off
[    7.762147] vdec_open
[    7.762166] vdec_querycap
[    7.762305] vdec_close
[    8.080933] meson-drm d0100000.vpu: Queued 2 outputs on vpu
[    8.108954] meson-drm d0100000.vpu: Failed to create d0100000.vpu debugfs directory
[    8.108979] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    8.108981] [drm] No driver support for vblank timestamp query.
[    8.109042] meson-drm d0100000.vpu: CVBS Output connector not available
[    8.137391] meson-dw-hdmi c883a000.hdmi-tx: Detected HDMI TX controller v2.01a with HDCP (meson_dw_hdmi_phy)
[    8.137813] meson-dw-hdmi c883a000.hdmi-tx: registered DesignWare HDMI I2C bus driver
[    8.138958] meson-drm d0100000.vpu: bound c883a000.hdmi-tx (ops meson_dw_hdmi_ops [meson_dw_hdmi])
[    8.426270] Console: switching to colour frame buffer device 240x67
[    8.463220] meson-drm d0100000.vpu: fb0:  frame buffer device
[    8.493815] [drm] Initialized meson 1.0.0 20161109 for d0100000.vpu on minor 0
[    8.794884] FAT-fs (mmcblk1p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[    9.298810] systemd-journald[1447]: Successfully sent stream file descriptor to service manager.
[    9.344148] systemd-journald[1447]: Successfully sent stream file descriptor to service manager.
[    9.357110] systemd-journald[1447]: Successfully sent stream file descriptor to service manager.
[    9.373549] systemd-journald[1447]: Successfully sent stream file descriptor to service manager.
[    9.392786] new mount options do not match the existing superblock, will be ignored
[    9.404479] systemd-journald[1447]: Successfully sent stream file descriptor to service manager.
[    9.421010] systemd-journald[1447]: Successfully sent stream file descriptor to service manager.
[    9.432965] systemd-journald[1447]: Successfully sent stream file descriptor to service manager.
[    9.446087] systemd-journald[1447]: Successfully sent stream file descriptor to service manager.
[    9.663661] RTL8211F Gigabit Ethernet stmmac-0:00: attached PHY driver [RTL8211F Gigabit Ethernet] (mii_bus:phy_addr=stmmac-0:00, irq=37)
[    9.673345] meson8b-dwmac c9410000.ethernet eth0: PTP not supported by HW
[    9.673627] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    9.793194] systemd-journald[1447]: Successfully sent stream file descriptor to service manager.
[    9.804934] systemd-journald[1447]: Successfully sent stream file descriptor to service manager.


But when I use the command it failed to evoke
Code: Select all
odroid@odroid64:~$ gst-launch-1.0 filesrc location=elephant.mkv ! matroskademux ! h264parse ! v4l2h264dec ! videoconvert n-threads=4 ! kmssink driver-name=meson force-modesetting=true connector-id=29 sync=false
WARNING: erroneous pipeline: no element "v4l2h264dec"
odroid@odroid64:~$ gst-launch-1.0 filesrc location=elephant.mkv ! matroskademux ! h264parse ! videoconvert n-threads=4 ! kmssink driver-name=meson force-modesetting=true connector-id=29 sync=false
WARNING: erroneous pipeline: no property "n-threads" in element "videoconvert0"
odroid@odroid64:~$ gst-launch-1.0 filesrc location=elephant.mkv ! matroskademux ! h264parse ! kmssink driver-name=meson force-modesetting=true connector-id=29 sync=false
WARNING: erroneous pipeline: no element "kmssink"


please let me know If I missed some thing...thanks
moon.linux
 
Posts: 1107
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby Ely » Thu Apr 19, 2018 4:01 pm

Thanks for trying moon.linux!

Did you copy the vdec module to the rootfs ? You can also compile with CONFIG_VIDEO_AML_MESON_VDEC=y so that it's builtin. You should get a /dev/video0 node if the decoder probe was successful. Also make sure that you updated the DTB!

The name of the v4l2 element is not the same depending on GStreamer version. Make sure to use the 1.12 or 1.14 commands that I provided depending on your version.

Also, can you provide a dmesg log ?

edit: oh, and if you compiled from tree, make sure you used the branch "4.17/amlogic-v4l2-m2m", and you'll have to put the firmware in /lib/firmware/meson/gxl. And rename vh264_mc to gxtvbb_vh264_mc.
Ely
 
Posts: 19
Joined: Sat Jan 31, 2015 9:27 pm
languages_spoken: english

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby moon.linux » Thu Apr 19, 2018 4:25 pm

@Ely
As suggested by you I copied the firmware file in /lib/firmware/meson/gxbb/
Code: Select all
root@odroid64:/usr/src/testing# ls -l /lib/firmware/meson/gxbb/
total 84
-rw-r--r-- 1 root root 16384 Apr 18 23:40 h263_mc
-rw-r--r-- 1 root root 36864 Apr 18 23:40 vh264_mc
-rw-r--r-- 1 root root 16384 Apr 18 23:40 vmpeg12_mc
-rw-r--r-- 1 root root 16384 Apr 18 23:40 vmpeg4_mc_5
root@odroid64:/usr/src/testing#

Yes I have compile using following branch
Code: Select all
root@odroid64:/usr/src/linux-elyotna# git b
* 4.17/amlogic-v4l2-m2m
root@odroid64:/usr/src/linux-elyotna#


CONFIG_VIDEO_AML_MESON_VDEC=y I will give this a try.

Here is the g stream package installed at my end.
Code: Select all
root@odroid64:~# dpkg -l | grep gstreamer
ii  gir1.2-gstreamer-1.0                        1.8.3-1~ubuntu0.1                            arm64        GObject introspection data for the GStreamer library
ii  gstreamer1.0-alsa:arm64                     1.8.3-1ubuntu0.2                             arm64        GStreamer plugin for ALSA
ii  gstreamer1.0-clutter-3.0                    3.0.18-1                                     arm64        Clutter PLugin for GStreamer 1.0
ii  gstreamer1.0-libav:arm64                    1.8.3-1ubuntu0.2                             arm64        libav plugin for GStreamer
ii  gstreamer1.0-nice:arm64                     0.1.13-0ubuntu2                              arm64        ICE library (GStreamer plugin)
ii  gstreamer1.0-plugins-bad:arm64              1.8.3-1ubuntu0.2                             arm64        GStreamer plugins from the "bad" set
ii  gstreamer1.0-plugins-bad-faad:arm64         1.8.3-1ubuntu0.2                             arm64        GStreamer faad plugin from the "bad" set
ii  gstreamer1.0-plugins-bad-videoparsers:arm64 1.8.3-1ubuntu0.2                             arm64        GStreamer videoparsers plugin from the "bad" set
ii  gstreamer1.0-plugins-base:arm64             1.8.3-1ubuntu0.2                             arm64        GStreamer plugins from the "base" set
ii  gstreamer1.0-plugins-good:arm64             1.8.3-1ubuntu0.4                             arm64        GStreamer plugins from the "good" set
ii  gstreamer1.0-plugins-ugly:arm64             1.8.3-1ubuntu0.1                             arm64        GStreamer plugins from the "ugly" set
ii  gstreamer1.0-plugins-ugly-amr:arm64         1.8.3-1ubuntu0.1                             arm64        GStreamer plugins from the "ugly" set
ii  gstreamer1.0-pulseaudio:arm64               1.8.3-1ubuntu0.4                             arm64        GStreamer plugin for PulseAudio
ii  gstreamer1.0-tools                          1.8.3-1~ubuntu0.1                            arm64        Tools for use with GStreamer
ii  gstreamer1.0-x:arm64                        1.8.3-1ubuntu0.2                             arm64        GStreamer plugins for X11 and Pango
ii  libgstreamer-plugins-bad1.0-0:arm64         1.8.3-1ubuntu0.2                             arm64        GStreamer development files for libraries from the "bad" set
ii  libgstreamer-plugins-base1.0-0:arm64        1.8.3-1ubuntu0.2                             arm64        GStreamer libraries from the "base" set
ii  libgstreamer-plugins-good1.0-0:arm64        1.8.3-1ubuntu0.4                             arm64        GStreamer development files for libraries from the "good" set
ii  libgstreamer1.0-0:arm64                     1.8.3-1~ubuntu0.1                            arm64        Core GStreamer libraries and elements
ii  libreoffice-avmedia-backend-gstreamer       1:5.1.6~rc2-0ubuntu1~xenial3                 arm64        GStreamer backend for LibreOffice


gst-launch-1.0 --version
Code: Select all
root@odroid64:~# gst-launch-1.0 --version
gst-launch-1.0 version 1.8.3
GStreamer 1.8.3
https://launchpad.net/distros/ubuntu/+source/gstreamer1.0


How can upgrade gstreamer to 1.12 or 1.14 is their any PPA for latest version upstream.

Thanks.
Attachments
odroidc2-m2m-dmesg.txt
odroid c2 dmeg
(32.71 KiB) Downloaded 49 times
moon.linux
 
Posts: 1107
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby moon.linux » Thu Apr 19, 2018 4:35 pm

I tried gstreamer PPA https://launchpad.net/~ddalex/+archive/ubuntu/gstreamer

Code: Select all
root@odroid64:/usr/src/linux-elyotna# sudo add-apt-repository ppa:ddalex/gstreamer
 This PPA brings in updated version of GStreamer packages.
 More info: https://launchpad.net/~ddalex/+archive/ubuntu/gstreamer
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmpij5ks8pm/secring.gpg' created
gpg: keyring `/tmp/tmpij5ks8pm/pubring.gpg' created
gpg: requesting key 4BBC8F7F from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpij5ks8pm/trustdb.gpg: trustdb created
gpg: key 4BBC8F7F: public key "Launchpad PPA for ddalex" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK
root@odroid64:/usr/src/linux-elyotna# sudo apt-get update
Ign:1 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial InRelease
Hit:2 http://ports.ubuntu.com/ubuntu-ports xenial InRelease
Get:3 http://ports.ubuntu.com/ubuntu-ports xenial-updates InRelease [102 kB]
Hit:4 http://deb.odroid.in/c2 xenial InRelease
Hit:5 http://ppa.launchpad.net/saiarcot895/myppa/ubuntu xenial InRelease
Hit:6 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial InRelease
Get:7 http://ports.ubuntu.com/ubuntu-ports xenial-backports InRelease [102 kB]
Ign:8 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial Release
Ign:9 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main arm64 Packages
Ign:10 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main armhf Packages
Ign:11 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main all Packages
Ign:12 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main Translation-en
Get:13 http://ports.ubuntu.com/ubuntu-ports xenial-security InRelease [102 kB]
Ign:9 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main arm64 Packages
Ign:10 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main armhf Packages
Ign:11 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main all Packages
Ign:12 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main Translation-en
Get:14 http://ports.ubuntu.com/ubuntu-ports xenial-proposed InRelease [253 kB]
Ign:9 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main arm64 Packages
Ign:10 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main armhf Packages
Ign:11 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main all Packages
Ign:12 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main Translation-en
Ign:9 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main arm64 Packages
Ign:10 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main armhf Packages
Ign:11 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main all Packages
Ign:12 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main Translation-en
Ign:9 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main arm64 Packages
Ign:10 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main armhf Packages
Ign:11 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main all Packages
Ign:12 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main Translation-en
Err:9 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main arm64 Packages
  404  Not Found
Ign:10 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main armhf Packages
Ign:11 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main all Packages
Ign:12 http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial/main Translation-en
Fetched 560 kB in 7s (72.9 kB/s)
Reading package lists... Done
W: The repository 'http://ppa.launchpad.net/ddalex/gstreamer/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/ddalex/gstreamer/ubuntu/dists/xenial/main/binary-arm64/Packages  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.

But no binary for arm64 ?
moon.linux
 
Posts: 1107
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby Ely » Thu Apr 19, 2018 7:39 pm

Ah, if you're running an old ubuntu it's not gonna be easy :/ . I'd go with an archlinux or something if I were you.

I received a C2 yersteday (Thanks HK!) and confirmed along with narmstrong that the video decoding works as well on S905, I'll try to whip up images that include everything necessary to test.
Ely
 
Posts: 19
Joined: Sat Jan 31, 2015 9:27 pm
languages_spoken: english

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby moon.linux » Thu Apr 19, 2018 9:04 pm

Thanks for your input, I have archlinux install at my end. :D
If their is some input to compile the kernel image for archlinux I would be happy to test this thing.
moon.linux
 
Posts: 1107
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby moon.linux » Fri Apr 20, 2018 1:08 am

@Ely
I have installed ArchLinux on odroidc2 micro sdcard, after few minutes of working it freezes, I need to reboot the device to start working again.
Any input on this one.

This is on archlinux
Code: Select all
[alarm@archlinuxc2 ~]$ uname -a
Linux archlinuxc2 4.16.2-1-ARCH #1 SMP Thu Apr 12 22:25:04 MDT 2018 aarch64 GNU/Linux
[alarm@archlinuxc2 ~]$

I usually get following kernel crash and then it freezes.

Code: Select all
[  758.671306] ------------[ cut here ]------------
[  758.671336] driver forgot to call drm_crtc_vblank_off()
[  758.675628] WARNING: CPU: 3 PID: 639 at drivers/gpu/drm/drm_atomic_helper.c:986 drm_atomic_helper_commit_modeset_disables+0x398/0x3f8 [drm_kms_helper]
[  758.688831] Modules linked in: fuse arc4 rc_cec dw_hdmi_cec rt2800usb rt2x00usb rt2800lib rt2x00lib mac80211 cfg80211 rfkill joydev meson_dw_hdmi dw_hdmi dwmac_generic cec meson_drm realtek drm_kms_helper dwmac_meson8b stmmac_platform drm stmmac drm_panel_orientation_quirks ptp pps_core syscopyarea meson_ir sysfillrect rc_core sysimgblt fb_sys_fops meson_gxbb_wdt nvmem_meson_efuse crypto_user
[  758.723334] CPU: 3 PID: 639 Comm: Xorg Not tainted 4.16.2-1-ARCH #1
[  758.729540] Hardware name: Hardkernel ODROID-C2 (DT)
[  758.734458] pstate: 00000005 (nzcv daif -PAN -UAO)
[  758.739256] pc : drm_atomic_helper_commit_modeset_disables+0x398/0x3f8 [drm_kms_helper]
[  758.747179] lr : drm_atomic_helper_commit_modeset_disables+0x398/0x3f8 [drm_kms_helper]
[  758.755070] sp : ffff00000d12bab0
[  758.758347] x29: ffff00000d12bab0 x28: 0000000000000030
[  758.763608] x27: 0000000000000000 x26: ffff80006d96e028
[  758.768870] x25: ffff000000f90a10 x24: ffff80004bddb800
[  758.774131] x23: ffff000000f10448 x22: ffff000000f0fe10
[  758.779392] x21: ffff80006d969800 x20: 0000000000000000
[  758.784653] x19: ffff80003e051e00 x18: 0000000000000010
[  758.789915] x17: 0000ffffbd9a7c38 x16: ffff0000082affe8
[  758.795176] x15: ffffffffffffffff x14: ffff0000896548cf
[  758.800437] x13: ffff0000096548dd x12: ffff000009432000
[  758.805699] x11: ffff000009409b38 x10: ffff00000878e6a8
[  758.810960] x9 : 00000000ffffffd0 x8 : 0000000000000006
[  758.816221] x7 : 7264206c6c616320 x6 : 0000000000000134
[  758.821482] x5 : 0000000000000000 x4 : 0000000000000000
[  758.826743] x3 : 0000000000000000 x2 : ffff80007ffc1eb8
[  758.832005] x1 : 0000800076bcd000 x0 : 000000000000002b
[  758.837267] Call trace:
[  758.839725]  drm_atomic_helper_commit_modeset_disables+0x398/0x3f8 [drm_kms_helper]
[  758.847314]  drm_atomic_helper_commit_tail+0x28/0x78 [drm_kms_helper]
[  758.853696]  commit_tail+0x7c/0x80 [drm_kms_helper]
[  758.858527]  drm_atomic_helper_commit+0xd8/0x168 [drm_kms_helper]
[  758.864648]  drm_atomic_commit+0x54/0x70 [drm]
[  758.869016]  drm_atomic_connector_commit_dpms+0x110/0x118 [drm]
[  758.874876]  drm_mode_obj_set_property_ioctl+0x194/0x2e8 [drm]
[  758.880654]  drm_mode_connector_property_set_ioctl+0x4c/0x60 [drm]
[  758.886776]  drm_ioctl_kernel+0x70/0xd8 [drm]
[  758.891088]  drm_ioctl+0x198/0x410 [drm]
[  758.894887]  do_vfs_ioctl+0xb0/0x848
[  758.898419]  SyS_ioctl+0x8c/0xa8
[  758.901612]  el0_svc_naked+0x30/0x34
[  758.905146] ---[ end trace bb872b0cab4fd6fb ]---

I feel this happens when the screensaver disable the monitor it goes to sleep.
moon.linux
 
Posts: 1107
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby Ely » Fri Apr 20, 2018 2:41 am

Yeah I get this backtrace as well, it's harmless on my side (does not cause freeze).

Are you running a graphical environment ? I'm not, all I have is the console login on screen until I run a gstreamer command.

I think that to update your kernel/dtb, all you have to do is replace /boot/Image and /boot/dtbs/meson64_odroidc2.dtb with your own.

Although, it's weird you have 4.16.2, those seem to be the old (3.14) namings.. In mainline the dtb for odroidc2 is called amlogic/meson-gxbb-odroidc2.dtb.

PS: for my current branch, you'll have to change firmware path. /lib/firmware/meson/gxbb/vh264_mc becomes /lib/firmware/meson/gxl/gxtvbb_vh264_mc. This will be cleaned up in the future..
Ely
 
Posts: 19
Joined: Sat Jan 31, 2015 9:27 pm
languages_spoken: english

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby moon.linux » Fri Apr 20, 2018 1:31 pm

After I cross compiled your your linux kernel on archlinux platfrom it failed to boot.

Code: Select all
ERprocess cCEC cfg:0x2f
WAKEUP GPIO cfg:0x00000000
set vddee to 0x0352mv
06f1930000000000GXBB:BL1:08dafd:0a8993;FEAT:EDFC318C;POC:3;RCY:0;EMMC:800;NAND:81;SD:0;READ:0;CHK:0;
TE: 381801
no sdio debug board detected

BL2 Built : 11:44:26, Nov 25 2015.
gxb gfb13a3b-c2 - jcao@wonton

Board ID = 8
set vcck to 1100 mv
set vddee to 1050 mv
CPU clk: 1536MHz
DDR channel setting: DDR0 Rank0+1 same
DDR0: 2048MB(auto) @ 912MHz(2T)-13
DataBus test pass!
AddrBus test pass!
Load fip header from SD, src: 0x0000c200, des: 0x01400000, size: 0x000000b0
Load bl30 from SD, src: 0x00010200, des: 0x01000000, size: 0x00009ef0
Sending bl30........................................OK.
Run bl30...
Load bl301 from SD, src: 0x0001c200, des: 0x01000000, size: 0x000018c0
Wait bl30...Done
Sending bl301.......OK.
Run bl301...
om SD, src: 0x00020200, des: 0x10100000, size: 0x00011130


--- UART initialized after reboot ---
[Reset cause: unknown]
[Image: unknown, amlogic_v1.1.3046-00db630-dirty 2016-08-31 09:24:14 tao.zeng@droid04]
bl30: check_permit, count is 1
bl30: check_permit: ok!
chipid: ef be ad deLoad bl33 from SD, src: 0x00034200, des: 0x01000000, size: 0x00055da0
 d f0 ad ba ef be ad de not ES chip
[0.497153 Inits done]
secure task start!
high task start!
low task start!
NOTICE:  BL3-1: v1.0(debug):4d2e34d
NOTICE:  BL3-1: Built : 17:08:35, Oct 29 2015
INFO:    BL3-1: Initializing runtime services
INFO:    BL3-1: Preparing for EL3 exit to normal world
INFO:    BL3-1: Next image address = 0x1000000
INFO:    BL3-1: Next image spsr = 0x3c9


U-Boot 2017.07-2 (Sep 03 2017 - 07:34:08 -0600) Arch Linux ARM

DRAM:  2 GiB
MMC:   mmc@72000: 0, mmc@74000: 1
Using default environment

In:    serial@4c0
Out:   serial@4c0
Err:   serial@4c0
Net:   eth0: ethernet@c9410000
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot/boot.scr
726 bytes read in 29 ms (24.4 KiB/s)
## Executing script at 1f000000
18063936 bytes read in 842 ms (20.5 MiB/s)
22745 bytes read in 50 ms (443.4 KiB/s)
5084347 bytes read in 265 ms (18.3 MiB/s)
Bad Linux ARM64 Image magic!
SCRIPT FAILED: continuing...
Card did not respond to voltage select!
mmc_init: -95, time 9
MMC Device 2 not found
no mmc device at slot 2
Speed: 1000, full duplex
BOOTP broadcast 1
BOOTP broadcast 2
DHCP client bound to address 10.0.0.140 (904 ms)
*** Warning: no boot file name; using '0A00008C.img'
Using ethernet@c9410000 device
TFTP from server 0.0.0.0; our IP address is 10.0.0.140; sending through gateway 10.0.0.1
Filename '0A00008C.img'.
Load address: 0x1000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/01-00-1e-06-33-37-7a
Speed: 1000, full duplex
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0A00008C
Speed: 1000, full duplex
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0A00008
Speed: 1000, full duplex
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0A0000
Speed: 1000, full duplex
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0A000
Speed: 1000, full duplex
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0A00
Speed: 1000, full duplex
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0A0
Speed: 1000, full duplex
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0A
Speed: 1000, full duplex
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0
Speed: 1000, full duplex
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-meson
Speed: 1000, full duplex
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm
Speed: 1000, full duplex
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default
Speed: 1000, full duplex
*** ERROR: `serverip' not set
Config file not found
Speed: 1000, full duplex
BOOTP broadcast 1
DHCP client bound to address 10.0.0.140 (237 ms)
Using ethernet@c9410000 device
TFTP from server 0.0.0.0; our IP address is 10.0.0.140; sending through gateway 10.0.0.1
Filename 'boot.scr.uimg'.
Load address: 0x1f000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Speed: 1000, full duplex
BOOTP broadcast 1
DHCP client bound to address 10.0.0.140 (170 ms)
Using ethernet@c9410000 device
TFTP from server 0.0.0.0; our IP address is 10.0.0.140; sending through gateway 10.0.0.1
Filename 'boot.scr.uimg'.
Load address: 0x1080000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
=>


could it be possible to share your steps to either build pacman kernel package or the linux kernel for arch linux.
moon.linux
 
Posts: 1107
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby Ely » Fri Apr 20, 2018 3:17 pm

I don't really understand why the Image gives you "Bad Linux ARM64 Image magic!". I checked both the archlinux Image and the one you get by cross compiling, and they both have the correct header magic.

Did you cross compile with "export ARCH=arm64" ?

PS: I don't use archlinuxarm, so I wouldn't know about the package, sorry. But replacing the Image should work, it's really weird.
Ely
 
Posts: 19
Joined: Sat Jan 31, 2015 9:27 pm
languages_spoken: english

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby moon.linux » Fri Apr 20, 2018 3:31 pm

Following are the instruction I follow to cross compile the kernel.

Code: Select all
export PATH=/opt/toolchains/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu/bin/:$PATH
export GCC_COLORS=auto

#make clean
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- odroidc2_defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- LOCALVERSION=-ARCHM -j4 dtbs Image
mkimage -A arm64 -O linux -T kernel -C none -a 0x1080000 -e 0x1080000 -n linux-next -d arch/arm64/boot/Image ../Image

mkdir -p media
sudo umount media

sudo mount /dev/mmcblk0p1 ./media
sudo cp -v ../Image arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dtb ./media/boot && sync && sudo umount ./media

sudo mount /dev/mmcblk0p1 ./media
sudo make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- LOCALVERSION=-ARCHM modules modules_install INSTALL_MOD_PATH=./media && sync && sudo umount ./media
moon.linux
 
Posts: 1107
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby Ely » Fri Apr 20, 2018 4:36 pm

Ohh, I don't think you need the call to mkimage, it's only for older u-boots. On this archlinuxarm, all you should have to do is replace /boot/Image with arch/arm64/boot/Image.

Also make sure that you either rename the dtb to the archlinux dtb name (/boot/dtbs/meson64_odroidc2.dtb), or that you edit /boot/boot.ini to reflect the dtb name change.
Ely
 
Posts: 19
Joined: Sat Jan 31, 2015 9:27 pm
languages_spoken: english

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby csucsu » Tue May 08, 2018 7:48 pm

Hi,

this is very good news!
Looking for venc also! :)

best regards, Gabor
csucsu
 
Posts: 24
Joined: Tue Jul 12, 2016 12:14 am
languages_spoken: english
ODROIDs: C2

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby miskol » Wed May 23, 2018 6:34 am

@Ely
Are you able to decode more then one video stream ? Is it somehow possible? :)
Are you able to provide decoded frames in dma-bufs(without copy) so I can use them as textures in opengl ?
miskol
 
Posts: 129
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby Ely » Mon May 28, 2018 4:58 am

miskol wrote:@Ely
Are you able to decode more then one video stream ? Is it somehow possible? :)
Are you able to provide decoded frames in dma-bufs(without copy) so I can use them as textures in opengl ?


1. Unfortunately no. AML drivers do support multi-instance but it's tricky, complex & dirty. So for now the mainline drivers are limited to single instance.
2. Yes, the buffers are exported via dmabuf. The endgoal is to have a copyless display pipeline using dmabuf V4L2 / DRM Prime.
Ely
 
Posts: 19
Joined: Sat Jan 31, 2015 9:27 pm
languages_spoken: english

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby miskol » Tue May 29, 2018 4:27 am

1. btw do you understand amlogic video api now? Do you have any documentation or you just investigate amlogic source codes? :)
miskol
 
Posts: 129
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby Ely » Tue May 29, 2018 10:53 am

miskol wrote:1. btw do you understand amlogic video api now? Do you have any documentation or you just investigate amlogic source codes? :)


The biggest part of my work is done through reading AML's kernel source code. Luckily I don't need to bother with userspace reversing shenanigans since the kernel code is enough to run the vdecs.
I actually don't understand amlogic video API that much, but I am starting to have a good understanding about how the hardware works. I have many codecs working including H.264, and HEVC is starting to look good (although far from done).

I do get a bit of help here and there though from private channels as well as public code, such as the endless mobile V4L2 glue.
Ely
 
Posts: 19
Joined: Sat Jan 31, 2015 9:27 pm
languages_spoken: english

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby rooted » Tue May 29, 2018 12:40 pm

It's nice to hear everything is going well, I'm glad odroid sent you a C2 also. I'm sure it makes testing much faster.
User avatar
rooted
 
Posts: 5164
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby Ely » Thu May 31, 2018 6:47 am

rooted wrote:It's nice to hear everything is going well, I'm glad odroid sent you a C2 also. I'm sure it makes testing much faster.


It allows me to test on S905, which is nice! My main dev board is a Libre Computer "Le Potato" (S905X). I also do some tests on a odroid-c1 I acquired a long time ago, but unfortunately S805 has some limitations when it comes to pixel formats (can't do regular NV12/NV21).
Ely
 
Posts: 19
Joined: Sat Jan 31, 2015 9:27 pm
languages_spoken: english

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby miskol » Fri Jul 13, 2018 5:29 am

Is it posible to use frame in dmabuf with mali drivers ?
I found that mali has some special format of texture for this purpose. So I am not sure if NV12/NV21 is that format.
And I am not sure if I want to run some pixel shader to do transformation as mali has really small L1/L2 cache :(
miskol
 
Posts: 129
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby Ely » Tue Jul 17, 2018 8:32 am

miskol wrote:Is it posible to use frame in dmabuf with mali drivers ?
I found that mali has some special format of texture for this purpose. So I am not sure if NV12/NV21 is that format.
And I am not sure if I want to run some pixel shader to do transformation as mali has really small L1/L2 cache :(


Yes, in fact I have already seen in action a bleeding edge version of kodi able to display frames with v4l2 + mali/dmabuf on S905. The work was mostly done by lrusak, a kodi/libreelec member.
Ely
 
Posts: 19
Joined: Sat Jan 31, 2015 9:27 pm
languages_spoken: english

Re: V4L2 M2M decoders on mainline: need testers !

Unread postby rooted » Tue Jul 17, 2018 8:46 am

Ely wrote:
miskol wrote:Is it posible to use frame in dmabuf with mali drivers ?
I found that mali has some special format of texture for this purpose. So I am not sure if NV12/NV21 is that format.
And I am not sure if I want to run some pixel shader to do transformation as mali has really small L1/L2 cache :(


Yes, in fact I have already seen in action a bleeding edge version of kodi able to display frames with v4l2 + mali/dmabuf on S905. The work was mostly done by lrusak, a kodi/libreelec member.
This is reassuring to know.
User avatar
rooted
 
Posts: 5164
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)


Return to Projects

Who is online

Users browsing this forum: No registered users and 0 guests