MPV on MiSTer?

Kernel, Main, Utilities & Applications, Miscellaneous Devices.
User avatar
OneEightZero
Posts: 10
Joined: Sun May 24, 2020 10:14 pm

MPV on MiSTer?

Unread post by OneEightZero »

Before getting the MiSTer, my primary source of emulation was using RetroPie on the RPi3 with my PVM. I was able to do this using Pi2SCART with a SCART to RGB cable. This gave good quality RGB output and decent latency. But the biggest benefit was using MPV to play VHS rips and old school TV broadcasts using MPV. Using it along with sshfs would allow an inverse share to be setup on the RPi and from that directory run video from SSH.

It's tricky because the Linux that's being used with the MiSTer is seemingly missing tools to get MPV and sshfs installed: apt, make, dpkg, git, etcera. I'm curious to get it running, not just for the ability, but also to see if the Linux that's on the MiSTer can handle it. If so, it would make a pretty good way for everyone to play video on a CRT.

With those tools, it was pretty easy to setup. Not so much without them. I'm looking for guidance/collaboration; is this something that can be done? If so, where should I start? Attack installing the programs directly? Get it apt/git running? It's daunting because I'm not sure where to start. I don't have a lot of experience installing without a package manager, and I'm not sure if it's going to be possible without those tools.

MPV - https://mpv.io / https://github.com/mpv-player/mpv
SSHFS - https://github.com/libfuse/sshfs
RetroPie - https://retropie.org.uk/
Pi2SCART - http://pi2jamma.info/pi2scart
User avatar
OneEightZero
Posts: 10
Joined: Sun May 24, 2020 10:14 pm

Re: MPV on MiSTer?

Unread post by OneEightZero »

Poking at it.

KHCchgY.png
KHCchgY.png (165.41 KiB) Viewed 9954 times
rhester72
Top Contributor
Posts: 1326
Joined: Thu Jun 11, 2020 2:31 am
Has thanked: 15 times
Been thanked: 213 times

Re: MPV on MiSTer?

Unread post by rhester72 »

I can't imagine this'll work out too well, tbh - it uses shaders, which...well, to be honest, I'm not sure how in hell you'd pull that off in Verilog or VHDL in an API-sane way. MPV very clearly expects a host OS, and I don't think you're likely to get anywhere on the FPGA side. The ARM side of MiSTer is just too slow for this.
User avatar
OneEightZero
Posts: 10
Joined: Sun May 24, 2020 10:14 pm

Re: MPV on MiSTer?

Unread post by OneEightZero »

That's what I was curious about, if the ARM side could handle it. Is the ARM side as powerful as the RPi3?
rhester72
Top Contributor
Posts: 1326
Joined: Thu Jun 11, 2020 2:31 am
Has thanked: 15 times
Been thanked: 213 times

Re: MPV on MiSTer?

Unread post by rhester72 »

OneEightZero wrote: Sun Aug 09, 2020 1:44 am That's what I was curious about, if the ARM side could handle it. Is the ARM side as powerful as the RPi3?
The Cortex V is paired with a dual-core Cortex-A9, an ARM v7a processor at 925MHz with no dedicated GPU. The RPi 3 is a quad-core Cortex-A53, an ARM v8a processor at 1.2GHz with a Broadcom Videocore IV GPU.

They aren't anywhere near being the same class.
ARCADEAGES
Posts: 63
Joined: Sun May 24, 2020 11:58 pm
Location: Toronto
Has thanked: 109 times
Been thanked: 10 times
Contact:

Re: MPV on MiSTer?

Unread post by ARCADEAGES »

I know this is not the same solution, but it does solve the "play old videos on CRT" problem.

Could be possible to use an iPad (USB C) --> To HDMI --> to RCA conversion chain.

It's not RGB, but it's cheap. Not sure about any latency, but as it's not interactive, that's a moot point. It does make possible to play any files and streams via an iPad or other similar device without a lot of fuss.

Makes me wonder if it's possible to create a VCR or Laser Disc core for MiSTer...
User avatar
OneEightZero
Posts: 10
Joined: Sun May 24, 2020 10:14 pm

Re: MPV on MiSTer?

Unread post by OneEightZero »

ARCADEAGES - What I want to avoid is using a second device. I want to see how far the Mister can go. It would be easy to just setup the RPi again, but having that capability on the Mister would be one less thing to have laying about.

rhester72 - How does the Mister output video using the Linux GUi Sorgelig released? I'm curious how that's pulled off without a GPU.
rhester72
Top Contributor
Posts: 1326
Joined: Thu Jun 11, 2020 2:31 am
Has thanked: 15 times
Been thanked: 213 times

Re: MPV on MiSTer?

Unread post by rhester72 »

Simple direct framebuffer output.
User avatar
boogermann
Posts: 2
Joined: Wed Jun 03, 2020 9:43 am
Has thanked: 1 time

Re: MPV on MiSTer?

Unread post by boogermann »

OneEightZero wrote: ↑08 Aug 2020, 20:44
That's what I was curious about, if the ARM side could handle it. Is the ARM side as powerful as the RPi3?
It never cease to amaze me how you can always find people that simply claim that something doesn't work or can't be done without trying or even provide any reasonable logical evidence one why it wouldn't.

MiSTer can use FFPlay and handle videos even with newer codecs like x264 at 720p without a hitch. 1080p will get some dropped frames. Although playable widescreen videos get a little blocky when scaling down to a CRT but 4:3 content scale well. I haven't optimized the swscaler nor the yuv converter yet. Both can be accelerated by NEON, but I just didn't had time to work on it.

So you might ask, what is NEON again?
NEON is an advanced SIMD architecture for ARM processors. Effective use of NEON through assembly, intrinsic functions, or automatic vectorization by the compiler can lead to tremendous performance gains for multimedia applications.

Neon technology is intended to improve the multimedia user experience by accelerating audio and video encoding and decoding, user interface, 2D/3D graphics or gaming. It can also accelerate signal processing algorithms and functions to speed up applications such as audio and video processing, voice and facial recognition, computer vision and deep learning.
So basically you can turn the VFPU into a 2D graphic card.

Here's is an example of a sprite test running at 640x480@32-bits
Screen is at 8 bits per pixel
Screen is in system memory
Sprite is in system memory
Sprite blit uses RLE acceleration
722.31 frames per second
https://youtu.be/Zf3VwgHmOWo

Here's a 720p video playing on CRT
https://youtu.be/uj6Cs-SOe8c

and a 640x480 video
https://www.youtube.com/watch?v=1KZ2BBNL-jg
by ARCADEAGES » 09 Aug 2020, 20:49
Makes me wonder if it's possible to create a VCR or Laser Disc core for MiSTer...
Possible, yes. Willing of people to implement, more difficult. ElectronAsh was looking into it on how to bridge the FPGA and the HPS into a Hybrid Core. I actually play tested the MPEG2 file from the Dragon's Lair Laserdisc :)
https://www.youtube.com/watch?v=_diVSzNRauc
User avatar
OneEightZero
Posts: 10
Joined: Sun May 24, 2020 10:14 pm

Re: MPV on MiSTer?

Unread post by OneEightZero »

boogermann wrote: Wed Sep 02, 2020 9:03 am
OneEightZero wrote: ↑08 Aug 2020, 20:44
That's what I was curious about, if the ARM side could handle it. Is the ARM side as powerful as the RPi3?
It never cease to amaze me how you can always find people that simply claim that something doesn't work or can't be done without trying or even provide any reasonable logical evidence one why it wouldn't.

MiSTer can use FFPlay and handle videos even with newer codecs like x264 at 720p without a hitch. 1080p will get some dropped frames. Although playable widescreen videos get a little blocky when scaling down to a CRT but 4:3 content scale well. I haven't optimized the swscaler nor the yuv converter yet. Both can be accelerated by NEON, but I just didn't had time to work on it.

So you might ask, what is NEON again?
NEON is an advanced SIMD architecture for ARM processors. Effective use of NEON through assembly, intrinsic functions, or automatic vectorization by the compiler can lead to tremendous performance gains for multimedia applications.

Neon technology is intended to improve the multimedia user experience by accelerating audio and video encoding and decoding, user interface, 2D/3D graphics or gaming. It can also accelerate signal processing algorithms and functions to speed up applications such as audio and video processing, voice and facial recognition, computer vision and deep learning.
So basically you can turn the VFPU into a 2D graphic card.

Here's is an example of a sprite test running at 640x480@32-bits
Screen is at 8 bits per pixel
Screen is in system memory
Sprite is in system memory
Sprite blit uses RLE acceleration
722.31 frames per second
https://youtu.be/Zf3VwgHmOWo

Here's a 720p video playing on CRT
https://youtu.be/uj6Cs-SOe8c

and a 640x480 video
https://www.youtube.com/watch?v=1KZ2BBNL-jg
by ARCADEAGES » 09 Aug 2020, 20:49
Makes me wonder if it's possible to create a VCR or Laser Disc core for MiSTer...
Possible, yes. Willing of people to implement, more difficult. ElectronAsh was looking into it on how to bridge the FPGA and the HPS into a Hybrid Core. I actually play tested the MPEG2 file from the Dragon's Lair Laserdisc :)
https://www.youtube.com/watch?v=_diVSzNRauc
I am immensely interested in this. If you ever need a tester to make a more permanent core/implementation, let me know.

I think this would be valuable for the community, especially for 480p or less video playback on CRT.
mrtomato
Posts: 43
Joined: Tue Jun 23, 2020 3:47 pm
Has thanked: 1 time

Re: MPV on MiSTer?

Unread post by mrtomato »

Maybe will be possible to port some audio players like Moode od Volumio is could be great addition to Mister.
ashvinau
Posts: 1
Joined: Mon Sep 14, 2020 2:49 pm

Re: MPV on MiSTer?

Unread post by ashvinau »

I wonder if it would be possible to use the HPS like an API instead of the main cpu. Have a raspberry pi 4 or whatever sending draw calls to the de-10 via gigabit ethernet? It seems like the theoretical throughput is similar to standard pci.
User avatar
OneEightZero
Posts: 10
Joined: Sun May 24, 2020 10:14 pm

Re: MPV on MiSTer?

Unread post by OneEightZero »

I wonder if this could be possible now with GroovyMAME. Could a MPV video stream be dumped directly into GroovyMAME?

AngelicLiver
Top Contributor
Posts: 434
Joined: Fri May 29, 2020 8:50 am
Has thanked: 86 times
Been thanked: 120 times

Re: MPV on MiSTer?

Unread post by AngelicLiver »

You can display whatever you want from the desktop via MiSTerCast.

Bas
Top Contributor
Posts: 623
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

Re: MPV on MiSTer?

Unread post by Bas »

This thread is the first time I heard of MPV, but I've been twiddling bits on the Linux end of MiSTer for a while now. Cross-compiling is often easier to arrange, even emulating an armv7 machine using QEMU on an x86 PC, than it is to turn a functioning MiSTer into a developer workstation. The OS simply isn't made to support that and it shows.

User avatar
OneEightZero
Posts: 10
Joined: Sun May 24, 2020 10:14 pm

Re: MPV on MiSTer?

Unread post by OneEightZero »

AngelicLiver wrote: Fri Mar 08, 2024 5:01 pm

You can display whatever you want from the desktop via MiSTerCast.

My hope is if MPV could be utilized more directly with GroovyMAME, it will be a more elegant, less resource intensive solution than MiSTerCAST.

It would pipe the video more directly into the MiSTer. :)

Post Reply