6 6
JMCC

RK3328 Media Script (Rock64, Renegade)

Recommended Posts

Thanks Jeff!

 

I'm going to experiment with encoding settings and see if I can get smooth playback to work but right now gst-play etc aren't working - I'm getting some error about ion allocator not being found and something about not being able to prepare a gst_openal_sink device. This might've happened because I installed totem but reinstalling the media scripts base and gstreamer stuff hasn't fixed it so looks like I'll have to reinstall armbian.

 

Have you been able to get videos playing in proper full screen mode with gstreamer or do you still have the window title bar showing and/or desktop panel showing?

 

 

Share this post


Link to post
Share on other sites

I was able to get full screen video by:

1) playing a video of the same size, or larger than my monitor (the 4k image autoscales nicely to my 1080 monitor, without any work on my part)

2) hiding the top panel   .  In LXDE, right-click on the panel, go to Panel- Panel Preferences.  On the Display tab,  change the "Automatically hide the panel" to Intelligently or Always.

3) hiding the title of the playback window. title   In LXDE, under Applications - Settings - Window Manager Tweaks.  On the Accessibility tab, enable "Hide title of windows when maximized"

 

It will be different on different desktops.  I had to google for a bit to find these hidden settings for LXDE, which I am only using to try to be consistent with the media script.

 

Note that I am trying to create a standalone video player, so I'm willing to modify my desktop settings for my final application.

I turn all of this back off when I am programming.

I have no idea how one would do this on an application by application basis. 

Share this post


Link to post
Share on other sites

Totem and Kaffeine, maybe there are others, are both gstreamer-backed media players that should allow for fullscreen playback using the rockchip gstreamer plugin without resorting to the workarounds you mentioned but they may need to be built against the rockchip libraries / packaged especially instead of installing the versions in the regular Ubuntu arm64 repo.

 

Thanks for sharing your workarounds though!

Share this post


Link to post
Share on other sites

I agree that there must be some way to override the desktop manager, since other programs do that. 

But, this is way beyond my skillset.

I saw some postings about using GTK to manage a Gstreamer application inside a GTK window. But it was more work than I wanted to tackle, and I found my workaround.

Share this post


Link to post
Share on other sites
17 hours ago, danboid said:

You recommend fullscreen playback for videos but it seems that both gst-launch-1.0 and gst-play-1.0 don't support proper fullscreen playback so we need to get something like totem working. I just tried running totem with the armsoc driver and this scripts gstreamer packages and when I try to start totem I get the error:

 

libGL error: unable to load driver: rockchip_dri.so

 

I have tried running totem prefixing it like so:

 

LD_LIBRARY_PATH=/opt/libmali-gbm:$LD_LIBRARY_PATH totem

 

but that didn't help, nor did creating a symbolic link from rockchip_dri.so to libmali.so

libGL error happens because application require OpenGL that Mali don't have. It have nothing to do with gbm. To fix it you need to do 

LD_LIBRARY_PATH=/opt/gl4es <application>

Share this post


Link to post
Share on other sites

I've been experimenting with handbrake and various h264/h265 video settings today but I've not yet found settings that have produced smooth playback without green lines. Might you have a link to that video or could you possibly upload it somewhere so that I could try the exact same video so I know if its my videos / encoder settings at fault or my hardware, please Jeff?

 

Handbrake isn't ideal anyway as it doesn't really support hardware encoding under Linux. ffmpeg has much better support for hardware encoding. quicksync would seem to be the way to go for Intel users wanting to do lots of / fast h264 encoding.

Share this post


Link to post
Share on other sites

 Fixed it!

 

I have my 4K clips playing fine with gstreamer (gst-play-1.0) under armbian now!

 

Pretty much all my 4K vids are 29/30 fps but armbian/xfce defaults to setting my display to 60Hz. After changing the display settings to 4K @ 30Hz using the XFCE display settings tool, 4K vids (h264 and h265) play smoothly with no horizontal green lines.

 

I'm relieved it was something simple and I don't have to re-encode everything! As Jeff said, there is no need to pass the --videosink argument, gst-play-1.0 then the filename is enough so maybe that could be changed in the README?

Share this post


Link to post
Share on other sites

I have had to change my CPU governor from ondemand to powersave (by editing /etc/default/cpufrequtils) to increase the stability when playing 4K videos but I don't think that is enough to watch a full movie yet as I'm still experiencing crashes or reboots after 20m or so of use.

Share this post


Link to post
Share on other sites
On 1/27/2019 at 6:01 AM, danboid said:

Have you been able to get videos playing in proper full screen mode with gstreamer

It should be enough with double clicking on the video to make it fullscreen. Is that failing too?

Share this post


Link to post
Share on other sites
6 hours ago, JMCC said:

It should be enough with double clicking on the video to make it fullscreen. Is that failing too?

 

Double-clicking within the gst-play window does not make it full screen. I found a post by a gstreamer developer saying that its included command line players don't support full screen without resorting to the workarounds Jeff uses. To utililise fullscreen, you would need to use totem.

 

Am I right in saying mpv-gbm can decode 4K videos fine but can only output (up to) 1080? That has been my experience on Rock64, but maybe 4K display output from mpv works on the Renegade?

 

I'm not having any more luck with armbian gstreamer's playback of 4K videos than Libreelec. I have now set the cpufreq gov to conservative and limited the CPU to 408 Mhz but I still struggle to watch 10/15 minutes of 4K video before it reboots. I could well have a faulty board if it is still doing this at 408 Mhz with a heatsink attached, which probably invalidated my warranty, if I still had one.

 

Jeff: Have you managed to play 4K video for longer than 15 / 20 minutes on your rock64 without it crashing, freezing or rebooting mid vid?

Share this post


Link to post
Share on other sites
5 hours ago, danboid said:

Double-clicking within the gst-play window does not make it full screen. I found a post by a gstreamer developer saying that its included command line players don't support full screen without resorting to the workarounds Jeff uses. To utililise fullscreen, you would need to use totem.

The  Gstreamer player included in the script will go fullscreen when double-click on the video, or when you press the "Fullscreen" button.

Share this post


Link to post
Share on other sites
4 hours ago, JMCC said:

The  Gstreamer player included in the script will go fullscreen when double-click on the video, or when you press the "Fullscreen" button.

 

Which player?

 

Have you not tested 4K playback to a 4K display with mpv? If it doesn't work, it should be noted in the README as currently it states all three video players can play 4K video but that isn't true of mpv/rock64.

Share this post


Link to post
Share on other sites
17 hours ago, danboid said:

Which player?

Please read the documentation. There it says:

Quote

To play a video in a X session, use the launcher "Rockchip Gst Player".

 

17 hours ago, danboid said:

Have you not tested 4K playback to a 4K display with mpv?

If you read some posts above, you'll see posts confirming that it works for them. There are also others stating that they have problems. This is what this thread is meant for, to test the media implementation and debug it.

 

So if you are having problems with MPV, you are invited to post here details, logs, etc., so we can try to find the cause of the problem.

Share this post


Link to post
Share on other sites

Ah yes! I was so convinced I would have to use the terminal to get a video to play correctly I didn't even think to look at what was under the Multimedia menu! As you say, Rockchip GST Player does enable fullscreen 4K playback.

 

I'm interested to hear what results people will have with this. I can only play 4K h264 videos for about 10/15 minutes on my 4GB Rock 64 before it reboots itself and thats with a heatsink attached to the CPU and under clocked to 408 Mhz max CPU speed. Are the Renegade boards or any of these Android TV devices using the same chipset more reliable for 4K video playback with gstreamer?

 

Another flaw with the r64 is that USB3 (SSD) drives don't seem to be reliable without external power, bus power does not seem to be quite sufficient for reliable operation. I wonder if the renegade is any better in that respect?

Share this post


Link to post
Share on other sites
38 minutes ago, danboid said:

I wonder if the renegade is any better in that respect?

Doubtful, it is powered via USB instead of with a barrel jack.  Does your SSD have current requirements listed on it?  SBC's honestly don't even conform to USB 2.0 current capacity of 500mA, let alone USB 3.0's 900 mA.

Share this post


Link to post
Share on other sites

Checked 4K playback (full screen) on TV boxes. The main cause of the brakes and stop playback 4K  - overheating. If run a 4K video in MPV or Gstreamer, within the first few tens of seconds the temperature rises to a critical 70 (this is the first stage of regulator) and the video begins to slow down and does not play smoothly. When reach the next level of adjustment 80, the video simply stops working. I added a fan and the temperature immediately dropped when playing 4K to 45-55. And all the video began to work smoothly during the entire playback period. By the way. there was a reason for the green bars when working in 4K mode on MX10-incorrect parameters in DTB. Now assembled a new version of Armbian 5.73 with new DTB (memory optimization and increased frequency to 1500). I run the system on MX10 with TV 4K, MPV gstreamer KODI - everything works on a full screen without interference.

 

By the way, it is very convenient to run "armbianmonitor-m" through the UART console (or SSH console) and see the temperature in real time with any playback program.

Share this post


Link to post
Share on other sites

Using 5.75 image

 

Glamor: The tweaked X server that you included is just as snappy IF you turn compositing back ON in the windowing settings.

This is the opposite setting for armsoc. If you leave it disabled, the screens are horribly delayed when dragging.

I have just tested both and Glamor is as fast as Armsoc on my 4GB renegade when the compositing is enabled.

 

Chromium is still having issues playing anything 1080p from youtube (Just running chromium-streaming from GUI)

Trying to change settings in Chromium-streaming makes it crash (probably known, as you stated some web pages will be broken)

 

Audio out from the audio jack is still not working. HDMI audio works fine.

 

- Bottom USB2 sometimes doesn't work. Unplug / replug keyboard fixes this once the OS has finished loading.

 

Thank you for your efforts here. :-)

This device is almost usable because of this. Once browsing is fixed, I'tgoing to be my daily Linux box!

Edited by Shades_aus
Thanking the developer was missing

Share this post


Link to post
Share on other sites

JMCC: You'd asked for a follow-up, I have been using a 4GB Rock64 as a primary desktop machine for about six weeks now using Armbian + your script.

Thank you very much for the script, being able to use sites like YouTube etc with streaming video and have it work (in full screen) is very nice.

Chromium is horribly unstable for me, I find that it works well for the first while, but eventually locks up the box almost completely. I ran vmstat on a console to try and figure out what the issue is, I think it is because I have a microSD card for storage and that is basically not a long-term solution, I need an eMMC.

I was never able to get to get the Rock64 to talk properly to my 27" screen, I always experienced severe tearing and flickering -- I believe I will have fewer problems with a newer screen, so that is another solution I want to try, in the meantime I use a small screen with low resolution -- I will provide more feedback when I have a better storage device and screen, in the meantime I get by and the script helps a lot with getting this SBC to where I need it to be.

Share this post


Link to post
Share on other sites

Running Deluge also causes similar to behaviour to Chromium with half a dozen tabs open -- the machine locks up for a few minutes at a time, with maybe ten seconds of normal responsiveness between slow periods.  At the console with vmstat, I see large swaps right before the GUI becomes responsive again, so I believe it may be thrashing. It seems that any use of swap at all with a microSD card is very bad for performance. 

Share this post


Link to post
Share on other sites

Thanks for all the feedback, guys, it's really useful. Sorry I cannot give an immediate solution right now to all of that, I'm working in fixing more fundamental stuff for the Renegade (at device tree level), and then I plan to get back to this.

Share this post


Link to post
Share on other sites
6 minutes ago, pokkecon said:

any use of swap at all with a microSD card is very bad for performance

As a matter of fact, Armbian does not use SD card for swap by default, but instead uses zram (virtual swap partitions that are actually stored in compressed ram). You can double check it is working for you with the command "cat /proc/swaps" 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
6 6