Jump to content

RK3328 Media Script (Rock64, Renegade)


JMCC

Recommended Posts

On 5/17/2019 at 7:39 PM, thatchunkylad1989 said:

What am I doing wrong?

 

 

By "updated everything" do you mean ran the media script?  Are you running the 4.4 kernel?  Please see posting guidelines and add requisite information.

Link to comment
Share on other sites

On 5/19/2019 at 11:11 PM, TonyMac32 said:

 

By "updated everything" do you mean ran the media script?  Are you running the 4.4 kernel?  Please see posting guidelines and add requisite information.

 

I'm using the 5.75 image which comes with the 4.4 kernel, updated everything with "apt update -y && apt upgrade -y && apt dist-upgrade -y" and I installed system, chromium and mpv. mpv works fine.. however; chromium states:

 

Flash Stage3D: Software only. Hardware acceleration disable

 

And others too. it's slow and can't load youtube videos at 480p.... what next?

 

EDIT: Yes, I ran the script and installed system, mpv and chromium. chromium under "chrome://gpu" states that it IS software only and not HW accelerated.....

Link to comment
Share on other sites

13 minutes ago, kapqa said:

Hello , is this script also compatible with the new Build Armbian Debian Buster that is available for download_

 

Thjanx


Probably not, but you are welcome to find out.

Link to comment
Share on other sites

Hi.

The Armbian site for Rock64 has the Buster release.   https://www.armbian.com/rock64/#kernels-archive

The release notification includes: "Video and 3D acceleration addon" with a hyperlink to this forum topic.

 

Does that mean that I only have to apt-get install gstreamer1.0, apps, tools and utilities to get my gst program to run?

Or do I need to dissect he media script to figure out what to install?

 

 

Link to comment
Share on other sites

I did a test build using Armbian Buster on my Rock64

TLDR: It failed

 

Hardware: Rock64 4 GB

OS downloaded from: https://www.armbian.com/rock64/#kernels-archive:     Armbian_5.91_Rock64_Debian_buster_default_4.4.184_desktop.7z

Media script: downloaded from this thread, dated Jan 13, 2019

 

I imaged the SD card, booted, setup a user and password, and connected to wifi.  That's it.
I then ran the media script, using the first 4 options (system, dev, mpv, gstreamer) and the Armsoc version.
The script seemed to run OK, but ended in a message that said there were errors during installation. 
I've attached the install.log.  There are no FAIL, ERROR or WARN messages.  The only issue I found was this sequence:

  • Could not open file /var/lib/apt/lists/apt.armbian.com_dists_buster_main_binary-armhf_Packages.lz4 - open (2: No such file or directory)
  • E: Could not open file /var/lib/apt/lists/apt.armbian.com_dists_buster_main_binary-arm64_Packages.lz4 - open (2: No such file or directory)
  • E: Could not open file /var/lib/apt/lists/security.debian.org_dists_buster_updates_main_binary-armhf_Packages.lz4 - open (2: No such file or directory)
  • E: Could not open file /var/lib/apt/lists/security.debian.org_dists_buster_updates_main_binary-arm64_Packages.lz4 - open (2: No such file or directory)

I then rebooted and it failed to boot, showing :

      [FAILED] Failed to start Light Display Manager

Per the bootstrap.log, I ran "systemctl status lightdm.service" (the output is also attached)

I'm not sure what the error messages mean, or what "Unit plymouth-quit.service not found" implies. 

So, obviously something in the media script did something to mess up the desktop.  Perhaps an old Bionic library incompatible with Buster?

So, I was eager to try the new build to see if it got rid of some stability problems I'm having with my gst based player.

But it looks like I'm going to have to go back to my Bionic build, unless someone has any idea on how to repair the Light Display Manager and get me booted.

 

Thanks,

-Jeff

 

 

sysctl_log.txt install.log

Link to comment
Share on other sites

Topic: Stability of gst based player using RK3328 Media Script

 

My earlier post today regarding Buster made me recall that I have a stability problem with my gst video player, and maybe one of you can help.

 

My gst-based video application plays one video file that is actually a concatenation of 4 other videos of the same format. A GPIO input selects which of the 4 videos to be played, and the program loops that video until a different selection is made.
The seek command in the concatenated video is much faster than loading a new video each time.

This is largely based on the examples in the gstreamer/gst-docs files at Github.

 

It all worked, but the program occasionally freezes, anywhere from 20 to 700 minutes into a test.

 

I ran with GST_DEBUG=2 (WARN), and I found a bunch of warnings and errors, including

  • many warning and error messages at startup
    • (some of these may be audio related – I did not have speakers hooked up)
  • frequent frame drops  - <mppvideodec0> can't process this frame
  • timestamp issues  - <mppvideodec0> decreasing timestamp
  • But, I was never able to see a specific error associated with the program lockup

My first guess was that there was a data streaming problem somewhere, so I forced a CPU speed increase from 408 MHz to 1200MHz. No difference.

So, I did a clean build using the latest Bionic (to make sure that it was not a random package that I installed that was the problem) and still see the errors.
This occurs with several different videos, from 640x480 up to 4k, and using both h264 and h265 encoding.

 

Configuration:

Rock64, 4GB board

OS: Latest Bionic, downloaded from: www.armbian.com/rock64/

Armbian_5.90_Rock64_Ubuntu_bionic_default_4.4.182_desktop.img
       (see my other post about my attempt to move to Buster)
VIdeo: Big Bunny 1080p, 30fps, h264 from http://bbb3d.renderfarming.net/download.html

 

I installed the Media Script, downloaded from this thread, dated Jan 13, 2019

I installed

  • gstreamer1.0-tools
  • gstreamer1.0-plugins-base-apps
  • libgstreamer1.0-dev
  • X11VNC
  •  

I stripped the program down to get rid of everything I could (removing config files, keyboard watch, GPIO watch, debug statements, etc) and made a simple player that just loops after 30 seconds.

 

The code is attached, as is the log file based on a GST_DEBUG=2 setting.

 

Anyone have any thoughts? I’d love some advice, or a pointer to a person or group that I could get in contact with.

 

Thanks!

-Jeff

 

simple_player_log_bunny_20190720.log simple_player.c

Link to comment
Share on other sites

Here's one more post, looking for advice.   

             Subject: delay/stutter in gst/gstreamer c code application

 

When the video starts playing in my C-coded gst video player program, there is a noticeable delay, or stutter of the first frames. 
(See my previous post for a description of the environment and code)

The delay/stutter is visible, but is too short for me to measure (1/10 to 1/4 second).

This also occurs when using a seek to loop back to 0.

 

I suspect there is a finite amount of time needed to uncompress/deinterleave the video data before it can be displayed.

It doesnt seem to be a file access problem, since I've tried running out of a ram disk to eliminate SD card read time, but it did not help.

 

Is this normal for gst/gstreamer?

Is there any way to reduce this delay with different gst/gstreamer parameters in the c-code?

I can work around this if I have to, but it would be nice to have a clean video start.

 

Thanks,

-Jeff

Link to comment
Share on other sites

Hello. Sorry, I've been out for a while.

On 7/21/2019 at 3:06 AM, Jeff R said:

Is this normal for gst/gstreamer?

Is there any way to reduce this delay with different gst/gstreamer parameters in the c-code?

I can work around this if I have to, but it would be nice to have a clean video start.

Have you tried to play the videos with the Gstreamer GUI player? (the launcher labeled as "Rockchip Gst Player") And with MPV-GBM? Please try, and see if you experience the same video delay.

 

Link to comment
Share on other sites

On 7/23/2019 at 4:37 PM, JMCC said:

Have you tried to play the videos with the Gstreamer GUI player? (the launcher labeled as "Rockchip Gst Player") And with MPV-GBM? Please try, and see if you experience the same video delay.

 

That was a great suggestion. 

 

I launched several 4k, 1080p and 640x480 videos in the Rockchip Gst Player, and yes, I see the same behavior in all of them (now that I am looking closely for it)
The first frame is displayed statically for ~1/4 sec for the 4k video, and then the video plays smoothly.
   Interestingly enough, the 640x480 delay is noticeably shorter, but I still see it.
I see the same thing when running MPV-GBM. 

I see the same thing when playing a file on a ramdisk.

And, I just launched VLC on my Windows i7, set it up to loop, and i see the startup delay there, too.


Based on this test, I'm assuming this is just something inherent in setting up video playback streams.
And unless someone has any additional ideas, there is nothing in gstreamer or the Rock64 media kit that I can set to reduce it.

 

So, I'll have to work around it by making sure that the first second of the video is static.

 

Thanks for the suggestion.

-Jeff
 

Link to comment
Share on other sites

Update on stability issues.
Sadly, I never discovered a way to make my gstreamer player stop crashing.  As I noted in my July 20 2019 post, I created a very stripped down player that loops, but it continued to lock up between 20 and 700 minutes.

Happily, I decided to try out the Kodi/LibreELEC player, and spent a couple days porting my looping/GPIO-triggered player to be a Kodi python addon.

After a couple 8+ hour runs, I have not seen the crashing issues I saw with gstreamer.


I'm not sure if the stability is from the stripped-down LibreELEC OS, or because Kodi is using OpenGL (or is gstreamer also using the OpenGL interface?)

But, at least I know have a stable Rock64 4k player.

Link to comment
Share on other sites

On 9/21/2019 at 2:41 PM, SteveSmith said:

Is there any way to get Youtube to stream smoothly at 1080p with this script or any other way?

If not through the browser is there a way to use a different app to play a youtube link smoothly at 1080p?

Yes, you can play YouTube smoothly even at 4K, with mpv:

 

 sudo apt install youtube-dl

mpv-gbm https://youtube.com/...

Link to comment
Share on other sites

Hi all, and thanks for this great install script!

 

I've been using a Raspberry Pi 3 as my main video player for a while and I recently switched to a Rock64.

 

After installing the required dependencies with the media script and using mpv-gbm for playback, I noticed that the video playback was choppy and mpv would drop frames, even for "small" (i.e. non-4k) videos.

 

I tracked down the problem to the display mode not being set right by mpv: whatever the video format, my display would be set to 3840x2160p60 (as seen from /var/log/kern.log). After manually setting the right display mode, the video playback is perfectly smooth and there are no more frame drops. For example:

mpv-gbm --drm-mode=25 bbb_sunflower_1080p_30fps_normal.mp4
mpv-gbm --drm-mode=19 bbb_sunflower_1080p_60fps_normal.mp4

You can get a list of the DRM display modes with:

cat /sys/class/drm/card0-HDMI-A-1/modes | nl -v 0

As a side note, I have not been able to play 2160p content at more than 15 fps and trying to play 2160p60 content even resulted in a corrupt display (green bands and pieces of picture jumping around).

 

Thanks again!

Edited by pokazef
not relevant anymore
Link to comment
Share on other sites

using the MediaScript for Rock64 and just installing "system" "mpv" "gstreamer" with "ARMSOC"

 

seems not leading to a functional mpv-gbm ?

 

mpv-gbm i-still-believe-trailer-1_h1080p.mov 
Playing: i-still-believe-trailer-1_h1080p.mov
 (+) Video --vid=1 (*) (h264 1920x816 23.976fps)
 (+) Audio --aid=1 --alang=eng (*) (aac 2ch 44100Hz)
[vo/gpu] VT_GETMODE failed: Inappropriate ioctl for device
[vo/gpu/opengl] Failed to set up VT switcher. Terminal switching will be unavailable.
[vo/gpu/opengl] Failed to initialize EGL.
[vo/gpu] Failed to setup EGL.
[vo/gpu] Failed initializing any suitable GPU context!
Error opening/initializing the selected video_out (--vo) device.
Video: no video

 

Link to comment
Share on other sites

Thank you JMCC,

 

this helped to launch finally kodi-gbm-wrapper,

 

however, i am not able to change the sound output in the kodi settings from hdmi to nothing else (setting output is greyed out).

 

plus, if i stop kodi-gbm-wrapper, and return into desktop, there is no soundcard shown at all.

Link to comment
Share on other sites

Well, this Kodi is just an old beta version. It is not intended for real use, just as a demonstration that Rockchip's GBM and RKMPP are working in our kernels. If you want to use Kodi seriously, I recommend you try LibreElec.

Link to comment
Share on other sites

Hey, 

 

Does anyone try this recently? On Armbian 20.02?

It will make system crash during boot after the script is complete. No matter it's Arm SOC or Glamour selected.

 

And I have hard time collecting useful log. 

Any idea?

Link to comment
Share on other sites

Hi. Ii tried this on the Renegade Armbian 20.02, and no crash. It is also true that acceleration does not work, due to a permissions issue. We'll try to have it fixed for the upcoming next release. In the meantime, you can fix it by doing the following:

sudo nano /etc/udev/rules.d/50-mali.rules


(change "mali0" for "mali" and save the file)

 

Link to comment
Share on other sites

Hi,JMCC, 

 

That's amazingly fast reply. But there is kernel panic or something and kernel dump here on my rock64. (ROCK64_V2.0)

Can anyone reproduce this? I'm afraid that I have a faulty device.

 

Thank you, anyway.

Link to comment
Share on other sites

No idea what it could be. We would need logs to debug the problem.  Have you tried using a UART adapter, to get the logs? And also, you can try another SD card, that could be the problem. For last, you can also try mainline, and post the results in this thread:

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines