-
Posts
424 -
Joined
-
Last visited
Reputation Activity
-
-
gounthar reacted to amirul in 8Gb RAM in a TV Box
https://my.banggood.com/H96-MAX-RK3566-SDRAM-8GB-DDR3-64GB-eMMC-ROM-Android-11_0-8K-UHD-TV-Box-bluetooth-4_0-5G-Wifi-1000M-LAN-H_265-VP9-4K-Decoder-Voice-Control-OTT-Box-p-1820334.html?cur_warehouse=CN&ID=47184&rmmds=search
This might get me back to tinkering with TV boxes again.
-
gounthar reacted to ubobrov in Understanding Hardware-Accelerated Video Decoding
This is a bit incorrect. libvdpau-sunxi is using for decoding only.
The Cedrus legacy driver has been supported to run on mainline kernel as KLM.
-
gounthar reacted to jernej in Understanding Hardware-Accelerated Video Decoding
Good summary, let me clear some things.
Having proper uAPI by no means makes libva-v4l2-request obsolete. If this lib is updated to latest uAPI, it still could serve as intermediate layer for all apps that don't support new interface but they support VA-API.
Before you talked about libva-v4l2-request, which implements VA-API, so I wouldn't say it's irrelevant to ARM HW accel. libvdpau-sunxi implements VDPAU, but that works only on BSP kernels and it is not relevant for mainline.
Further clarification: Kodi 19.0 (released recently) is highly recommended for all this - it doesn't require any out of tree patch for video decoding (LE uses patch for HW deinterlacing). Additionally, with version 19.0, there is single binary for all 3 windowing systems (gbm, X11, wayland). Depends on build options. Not sure if this version is available on Armbian but PPA exists, so I guess it should not be hard to test.
H264, MPEG2 and VP8 should be good in mainline, although api can still change until codec is promoted to uAPI. HEVC still needs out-of-tree patches for any serious work.
Maybe you can update your text, so we have current state overview in single post.
-
gounthar reacted to P.P.A. in Understanding Hardware-Accelerated Video Decoding
I've taken peeks at threads related to hardware decoding (of H.264 and HEVC, mainly) on Allwinner and Rockchip platforms on and off, sometimes dabbled in trying and failing to implement solutions recommended there. Being a complete amateur, I find the topic very opaque and confusing, with various different components that need to interface with each other, be patched in sync, and sometimes change drastically between kernel versions, etc. Today I sat down and read up on these subjects, scouring wikis, documentation, this forum, and assorted other sources to try and understand how this works. In this post I will attempt to compile what I've learned on the different software components involved, their relationships, their current status, and solutions to the problem. I hope people more knowledgeable will correct me when I get something wrong or cite outdated information. Stuff which I am highly uncertain of I will print in italics.
(This post is going to focus on mainline implementations of Cedrus/Allwinner, I haven't looked into Hantro/Rkvdec/Rockchip specifics yet. I will speak only of H.264 and H.265/HEVC; I don't understand the high/low stuff and didn't pay attention to other codecs.)
Components:
Basics: Video codecs like H.264, H.265/HEVC, MPEG-2, etc. are standardised methods which serve to more efficiently encode and decode videos, reducing their filesize. Software en-/decoding is very CPU-intensive. Modern GPUS and ARM SoCs therefore contain specialised hardware (VPUs) to delegate these tasks to. Working hardware decoding is particularly important for underpowered ARM CPUs.
Drivers: Topmost in the stack are the VPU drivers. These are Sunxi-Cedrus/Cedrus V4L2 M2M and Cedar [Is this the legacy one?] on Allwinner; Hantro and Rkvdec on Rockchip. These are all still in development, but Cedrus already fully supports H.264, and partially supports HEVC, and is already usable in the mainline kernel.
APIs: In order for anything (userspace APIs, libraries) to make use of the VPU drivers, you need backends/APIs. For Cedrus, there is the unmaintained libva-v4l2-request backend which implements VA-API, the legacy VDPAU implementation libvdpau-sunxi, and as of kernel version 5.11, H.264 has been merged into the uAPI headers. Different applications may make recourse to one or another of these APIs.
Libraries: FFmpeg and GStreamer. provide libraries and APIs of their own to other applications but can (importantly!) also output directly to the framebuffer. FFmpeg must be patched to access either libva-v4l2-request or the Cedrus driver headers. GStreamer directly accesses kernel headers since 1.18 (works on 5.9, not on 5.10; 1.20 will support 5.11.)
Media players: mpv and depends on FFmpeg for hardware acceleration (and must be patched together with it). VLC can be set to access libva-v4l2-request directly. Kodi 19.0+ supports hardware acceleration out of the box without any out-of-tree patches.
Display server: An additional complication is drawing the output of any of the above on screen. Most successful implementations I've seen bypass X11 and either output directly to the framebuffer or force a plane/display layer on top of any X windows. Wayland apparently makes this easier by allowing applications to use their own DRM planes, but this hasn't been explored much yet. Kodi 19.0 works with all three windowing systems (X, Wayland, and gbm).
Codec status:
Taken from the LibreElec thread (which reflects LibreElec's status and is ahead of what works elsewhere, but outlines hardware limitations):
Approaches:
Many people have managed to make it work on their machines using different approaches. Note that some of these solutions are one or two years old, and kernel developments since may have changed the situation. Ordered from newer to older:
LibreElec – kernel + ffmpeg + Kodi: LibreElec is a Just-Enough-OS with the sole purpose of running Kodi, a media player. It's at the bleeding edge and usually implements codecs and features well before mainline or other distros. It achieves this by heavily patching everything up and down the stack, from the Linux kernel over FFmpeg to Kodi itself. These patches could all be applied to an Armbian build, but there are a lot of them, they're poorly documented, and you'd need to dig into their github to understand what they all do. LibreElec runs Kodi directly without a desktop. kodi-gbm is a package that can be installed on Armbian and functions similarly.
Key contributors to the project are @jernej and @Kwiboo, who sometimes post about their work here (and have been very helpful with questions, thank you). @balbes150 includes some of LibreElec's patches in his Armbian-TV builds, but I don't know which.
Kodi 19.0:
LibreElec patches + mpv:
@megous – Kernel 5.11 + GStreamer: This implementation, done here on a PinePhone (A64), patches the 5.9 kernel and uses a recent version of GStreamer (1.18 and up), whose output is rendered directly to a DRM plane via kmssink. (No X or Wayland.)
GStreamer 1.18 works with the 5.9 kernel. It does not work with 5.10, because of numerous changes to the kernel headers in this version. In 5.11 the H.264 headers were moved into the uAPI; the master branch of GStreamer reflects this, but there haven't been any releases with these patches yet. It'll probably be in repositories with GStreamer 1.20; until then you can build it from source.
@Sash0k – patched libva-v4l2-request + VLC: This updates bootlin's libva-v4l2-request and follows the Sunxi wiki's instructions for enabling VLC to make use of it. It works on the desktop. This only works for H.264 and breaks HEVC. When I tried to replicate this approach on a recent Armbian build, I discovered that the h264.c files in the kernel (that libva-v4l2-request draws on) have changed considerably between 5.8 and 5.10, and I lack the understanding to reconcile libva-v4l2-request with them.
@ubobrov – old kernel + libcedrus + libvdpau-sunxi + ffmpeg + mpv: This approach, which supports encoding decoding of H.264 uses the libvdpau-sunxi API and ports the legacy driver to mainline as a loadable kernel module and if I understand it correctly, ubobrov ported a legacy feature to mainline. In the post quoted below the kernel is 4.20, but the same method has been successfully applied to 5.7.8 by another user. It requires that the board's device tree be patched, as documented in ubobrov's github repository.
The summary seems to be that none of the current implementations on Allwinner boards really play nice with X or desktop sessions, and it's best to output directly to the framebuffer. Kwiboo has forked FFmpeg and mpv to make good use of new and unstable kernel features/hardware acceleration which will take a while to make their way upstream. The recent 5.11 move of stateless H.264 out of staging and into the uAPI should facilitate further developments.
I intend to try some of these things in the nearer future. Thanks to everyone who works on mainlining all of this VPU stuff, and to users here who contribute solutions and readily & patiently answer questions (Jernej especially). I hope I didn't post any falsehoods out of ignorance, and welcome any corrections.
Other related threads here:
https://forum.armbian.com/topic/11551-4kp30-video-on-orange-pi-lite-and-mainline-hardware-acceleration/
https://forum.armbian.com/topic/16804-orange-pi-pc-h3-armbian-focal-5104-sunxi-av-tv-out-cvbs-enable/page/2/
https://forum.armbian.com/topic/11184-hardware-graphicvideo-acceleration-in-h3-mainline/
https://forum.armbian.com/topic/13622-mainline-vpu/
-
gounthar reacted to balbes150 in Allwinner H6
On the TX6, I removed the bottom cover of the case and use this model upside down (so that the radiator looks up and has a good run for air movement). I do not know what kind of idiot designs TV boxes in China, they put the board in the case with the radiator down, this is complete idiocy. Apparently, these "engineers" did not go to school and do not know the laws of physics at all - hot air always moves up (if there is no fan). Therefore, with passive cooling (without forced air supply from the fan), it is necessary to place the radiator so that the air passes to it as best as possible and the heated air freely goes up.
-
gounthar reacted to balbes150 in Allwinner H6
New Image 20210123 for H6, kernel 5.10.9
https://yadi.sk/d/0a41swJcEAZ0SQ?w=1
https://mega.nz/folder/j9QSDQSQ#6WpasOlbZYIInfw6yo4phQ/folder/K9BRjSaZ
-
gounthar reacted to NicoD in Board Bring Up Station P1 rk3399, M1 rk3328
Reboot doesn't seem to be working. It either shuts down, or stays on without doing anything.
Otherwise it all looks ok. I do have a problem with kazam when the media script is installed. I've had that too on M4V2 with media script in Buster, so it's not the image.
I'm filming everything to make the video. I'll not use Android to write the image, I'll link to the video of @gounthar instead. He clearly has more Android knowledge, and way more patience.
-
gounthar reacted to tparys in Creating an Armbian Docker image for armhf (Orange Pi Zero)
Armbian is little more than a stock Debian/Ubuntu installation with the aim of providing recent kernel, bootloaders, and some quality of life userspace customizations.
None of those seem needed for a docker image. Maybe start with the upstream image of whichever version you're using for your Orange Pi?
If you do need certain things from Armbian, you can always copy the apt configuration from /etc/apt/sources.list or sources.list.d into your Dockerfile and go from there.
-
gounthar reacted to MathiasRenner in Docker on armbian!
Hello everyone!
Is there anyone who tried to run Docker on armbian?
Ok, let's start from the beginning: I am from the Hypriot Team (we made Docker available on ARM) and recently saw some guys successfully playing with Docker on armbian. Meanwhile, we know, that our Docker runs at least on the Cubietrack and Lamobo R1/BananaPi R1 on top of armbian!
This is awesome because, you know, IoT is coming, and Docker on ARM helps get a grip on many challenges induced by IoT. However, we were only able to support Docker on Raspberry Pis so far... Imagine if Docker would run on more than just a few ARM boards! Armbian seems an awesome platform to extend the family of Docker compatible boards.
So, I wonder if there is anyone who tried to run Docker on armbian?
If you are now curious about this topic and wanna get started, please see this blog post of how to install Docker on ARM within no time: http://blog.hypriot.com/post/family_arm_hardware_for_docker_more_children/
Looking forward to get in touch with you guys!
-
gounthar got a reaction from NicoD in Board Bring Up Station P1 rk3399, M1 rk3328
I did it. Somehow.
-
gounthar got a reaction from balbes150 in Board Bring Up Station P1 rk3399, M1 rk3328
I did it. Somehow.
-
gounthar reacted to balbes150 in Board Bring Up Station P1 rk3399, M1 rk3328
@NicoD Can you shoot a video on how to download and burn an Armbian image to an SD card using only a regular Android on P1 ? I. e. I am interested in a video how to run Armbian with only P1. This instruction allows any user, without any additional devices (PC, laptop, etc.) to get a working Armbian on any supported device.
-
gounthar reacted to Igor in Guide: How to use Touchscreen + LCD on H3 devices
For start, you might need to install kernel headers.
armbian-config -> software -> install headers
Then try again. Regarding display connection or if the method is proper - no idea.
-
gounthar reacted to Igor in Fosdem 2021
Are you mainly going to participate live, listen later to recordings or not at all? Any topics that are related, close to single board computer world to recommend?
I am still working on my "shopping list", but this is some initial draft from https://fosdem.org/2021/schedule/
QA
About the joy and tears of testing Embedded Devices
https://fosdem.org/2021/schedule/event/testing_embedded_devices/
Interactive debugging inside CI systems
https://fosdem.org/2021/schedule/event/debugging_inside_ci/
QAOps - The Latest Trend in QA & Software Delivery
https://fosdem.org/2021/schedule/event/qaops/
Software Composition devroom
Overview Software Bill of Materials (SBOM)
https://fosdem.org/2021/schedule/event/sca_overview/
Legal
Protecting against proprietary re-licensing with a community contract
https://fosdem.org/2021/schedule/event/qtproprietaryrelicensing/
CI
ARM your continuous integration system with fruits! by @gounthar
https://fosdem.org/2021/schedule/event/arm_your_continuous_integration_system_with_fruits/
Community
Mental health and free software
https://fosdem.org/2021/schedule/event/community_devroom_mental_health_free_software/
And one fine Belgian beer for each day of the conference also just arrived
-
gounthar reacted to jernej in 4kp30 video on Orange Pi Lite and mainline hardware acceleration
I regularly delete my branches because all work is eventually merged to https://github.com/LibreELEC/LibreELEC.tv (you quoted quiet old post).
But as @Werner said, H616 is not exactly the same as H6 regarding display stuff so it needs quiet a lot of work. Cedrus will be probably easy, but that comes after display stack.
-
gounthar got a reaction from balbes150 in Board Bring Up Station P1 rk3399, M1 rk3328
I tried with an application Pi SDCard image writer, or something like that, but it does not allow to download images, and proposes only images for the Raspberry.
I then found another application that would burn whatever image you give it, but... it needs a rooted device.
I tried lots of one-click root application (bad idea), but none of them worked.
I then switched to recovery mode, and tried to install TWRP (specific to RK3399 TV boxes), but it fails with an error 21.
Even the opengapps fails the same way.
I tried it with adb sideload, but it fails the same way.
Would someone have a link to a working TWRP for this box, or to a way to root it properly?
As @balbes150 asked, the goal would be to write a tutorial for people wanting to switch from Android to Armbian in the case they have just this computer available, and nothing else.
Thanks.
-
gounthar reacted to NicoD in Board Bring Up Station P1 rk3399, M1 rk3328
That's a good idea. I'll see what tool is best used in Android to burn the image. I've never used android for it, but since people with P1/M1 certainly have Android it is a great idea.
I've got a video planned where I show a full installation of Armbian Buster Legacy. I can start it in Android. I'll make the video when my NVMe hat arrives. Thanks for the idea. I wouldn't have thought about it.
p.s. I've got a Mecool KM6 with S905X4 to review Android 10 on it. I don't suppose there will be Armbian for this? Just asking so I don't say anything wrong.
I like the box, but I can't get used to Android. For watching video it's ok, but for productivity tasks it is bad.
-
-
-
gounthar reacted to Winguo in Board Bring Up Station P1 rk3399, M1 rk3328
Hey guys!
It's the last day to join the M1 giveaway.
https://www.stationpc.com/thread-126-1-1.html
Good luck to you all.
-
gounthar reacted to martinayotte in Orange Pi Zero: internal RTC
The PCF8523 chip is a good one since it can trigger an alarm interrupt ...
-
gounthar reacted to Arjan van Vught in Orange Pi Zero: internal RTC
https://www.adafruit.com/product/3295 -> The PCF8523 is simple and inexpensive but not a high precision device. It may lose or gain up to 2 seconds a day.
-
gounthar reacted to rubenvb in Mainline VPU
It seems I may have found the "issue" in my failed trials post-May 2020 on my NanoPi M4 (rk3399)..
I discovered today (finally) that Kodi's internal ffmpeg isn't being configured with "--enable-libudev --enable-v4l2-request" resulting in missing hwaccels and obviously, no functional hardware acceleration. How this worked before in my build of May 2020 is a mystery (maybe ffmpeg from then auto-enabled these options by chance?).
I first tried to use the FFMPEG_EXTRA_FLAGS variable set on the commandline when invoking cmake, but since it is passed to the ffmpeg cmake script unquoted (see the commit adding it here: https://github.com/xbmc/xbmc/commit/cdbc12608b947d4afefc5bba48dc82e1f3514e52#diff-efa915ad129932095ae6f2a6d75e0d261386dd442b44338b4f6c705e25f1658eR241), only the first item ends up in ffmpeg_conf (due to CMake language rules I believe: https://gitlab.kitware.com/cmake/cmake/-/issues/17113#note_294727).
I have now added the arguments manually and confirmed they make it to ffmpeg, and am currently running a linuxtv-rkvdec-work-in-progress from @Kwiboo's linux-rockchip repository, rebased onto a clean v5.10.4.
Failing to notice this is kind of silly of me, and I'm sorry if I wasted anyone's time with my build configuration issues.
H264 decoding works great again (with DRMPRIME/DirectToPlane rendering enabled in the Kodi settings).
I do notice that the limited HEVC content that I have, which worked before (kernel 5.8-rc1 and Kodi/ffmpeg from May 2020), now shows a black screen.
Additionally, I tried merging in the changes from @Kwiboo's v5.10.1-drm-rockchip branch, and that gives me an option for a 4k resolution, but when playing back a 1080p H264 file, it appears only the top-left corner of the video output, including the black band around the 1920x800 movie, is shown full screen.
Playing back a 4k Big Buck Bunny MP4 file gives me "no signal" on my TV (it seems the actual 4k resolution is one of those @Kwiboo mentioned in the linked IRC conversation.
Is there a better branch to merge in from instead?
Is there any useful information I can provide to help this get fixed?
I hope the kernel v4l2 request uapi can move from staging soon (5.11?) so that the ffmpeg changes can be pulled in there.
As always: keep up the good work, I, along with many others, really appreciate what you're doing for these chips!
-
gounthar reacted to piter75 in Board Bring Up Station P1 rk3399, M1 rk3328
Ultimately we should have a single kernel source for all rockchip64 devices ;p
At this point neither rockchip64 nor rk3399 is really fit for that. They do not support rk3308 as a simple example. It should probably be some more or less stable cut from Rockchip's master.
Until recently I was actually more inclined to move devices from rockchip64 to rk3399 and make it a base for switching to Rockchip's master whether it would be 4.4 or 4.19 (FriendlyElec is already using 4.19 for R4S).
On the other hand boards are now divided ~50/50 between those kernels so we can move Station P1 to rockchip64 if it fits there better.
We will worry about switching to some form of Rockchip's master later - most probably not earlier than with first rk3568 boards...
As stated above I see no harm in that.
