recliq
Posts: 38
Joined: Wed Jun 13, 2012 4:56 pm

Re: SDL 1.2 with dispmanx backend

Thu Feb 21, 2013 11:15 am

Sounds like the libs were moved again (haven't checked since I don't have access to my pi right now and haven't updated since a couple of days now...). Did you reboot after upgrade yet or have you tried running ldconfig? If that doesn't help you can check the (not working) binaries for missing libs like this:

Code: Select all

ldd <binary>
You should get a list of all needed shared libraries on the left and the path to the libraries on your system on the right (or a message about missing library).
Then find the library in your systen (usually under /lib, /usr/lib or /opt/vc/lib) and check if the path to the library is configured in in one of the files under /etc/ld.so.conf.d/.

kalehrl
Posts: 350
Joined: Tue Jul 24, 2012 10:49 am

Re: SDL 1.2 with dispmanx backend

Thu Feb 21, 2013 3:04 pm

I think I got it sorted out now.
I rebooted after all those updates and it didn't work.
Then I recompiled dispmanx and now all seems to be fine.

welshy
Posts: 1667
Joined: Mon Oct 29, 2012 2:07 pm

Re: SDL 1.2 with dispmanx backend

Fri Mar 08, 2013 11:05 pm

I am currently building another revision of "pcengine". I have it working fine with the dispmanx backend (Which is a big improvement), BUT, cannot get it to compile INCLUDING it (It selects the Standard SDL1.2-dev on Configure). Is there a simple method to achive this? Any other package I have installed seems to automatically be included when I compile?
"The list of things I have heard now contains everything!"

kalehrl
Posts: 350
Joined: Tue Jul 24, 2012 10:49 am

Re: SDL 1.2 with dispmanx backend

Sat Mar 09, 2013 10:01 am

I think you cannot include it in the compiled binary.
Dispmanx needs to be present on the host system running the binary.
I compiled dispmanx without sudo make install in order not to replace the system SDL.
When I want to run something using dispmanx, I just run:

Code: Select all

export LD_LIBRARY_PATH="/home/pi/RetroPie-Setup/SDL12-kms-dispmanx/build/.libs"
followed by whatever app that I want.

welshy
Posts: 1667
Joined: Mon Oct 29, 2012 2:07 pm

Re: SDL 1.2 with dispmanx backend

Sat Mar 09, 2013 10:37 am

pudding has compiled it in the MAME4ALL Binary so it can be done
"The list of things I have heard now contains everything!"

kalehrl
Posts: 350
Joined: Tue Jul 24, 2012 10:49 am

Re: SDL 1.2 with dispmanx backend

Sat Mar 09, 2013 11:01 am

Looking at mame4all makefile, it was compiled with -lGLESv2 -lEGL:

Code: Select all

LIBS = -lm -lpthread -lSDL -L$(SDKSTAGE)/opt/vc/lib -lGLESv2 -lEGL
-lGLESv2 -lEGL also enable fullscreen in the same way as with quake3 and emulators based on retroarch.

aaa801
Posts: 428
Joined: Mon Jun 04, 2012 9:06 pm
Location: Berkshire

Re: SDL 1.2 with dispmanx backend

Wed Mar 20, 2013 12:09 am

i compiled dgen with this, blazing fast but no sound =/, is that a issue with this or not

sgtslaughter
Posts: 7
Joined: Fri Apr 12, 2013 3:07 pm

Re: SDL 1.2 with dispmanx backend

Fri Apr 12, 2013 5:54 pm

I installed this to get SNES9X fullscreen and it worked great, but I had the Chameleon image and it appears to have broken the launcher... I have a feeling it has affected the package python-pygame. Anyone else have this issue? Unfortunately I don't get an error message so it is difficulty to diagnose.

Anyone run across this yet?

sgtslaughter
Posts: 7
Joined: Fri Apr 12, 2013 3:07 pm

Re: SDL 1.2 with dispmanx backend

Sat Apr 13, 2013 3:39 pm

So I fixed my issue.... by completely rebuilding. Tried using make uninstall, then install the standard libsdl and nothing worked after that. Oh well no biggy.

I really like what kalehrl had mentioned about not doing a make install and just using the environment variable LD_LIBRARY_PATH to use it when needed.

This works, although, the launcher in Chameleon "pygame" requires the standard libSDL.
I've tried to force the python script to set the environment variable but read that it would be too late. I also tried to get the python script to run a shell script which had the export command also did not work. And finally I tried compiling the library inside the snes9x emulator, but don't think I was doing anything right there. I tried using -Wl,-rpath,/path/to/SDL/ and it just gave me compile errors.

Anyone know a better way of doing it or am I SoL?

ajoburg
Posts: 12
Joined: Thu Feb 14, 2013 1:16 am

Re: SDL 1.2 with dispmanx backend

Thu Jul 11, 2013 12:29 am

Thanks for the great contribution @Vanfanel. Do you or others know how to create a transparent window/surface in dispmanx? I'm working on a slideshow app and using this with Pygame to create overlays on top of omxplayer. It all works well and layers correctly, but I can't seem to make a transparent canvas without making my objects transparent as well.

My goal is a transparent canvas the size of my screen above omxplayer that I can draw on. I suspect there must be a method other than using the alpha settings in vc_dispmanx_element_add to do this? I've also looked at vc_dispmanx_display_set_background, but this seems to only take RGB and not an alpha.

Vanfanel
Posts: 433
Joined: Sat Aug 18, 2012 5:58 pm

Re: SDL 1.2 with dispmanx backend

Thu Jul 11, 2013 10:24 am

@ajoburg: I'm not making any Rpi programming these days as I'm studying maths for other projects, so I can't help you much as I've forgotten about dispmanx by now. I will go back to Rpi/Dispmanx/GL_ES once I know all maths I need to know "on paper", something I'm about to complete.
Maybe some other dispmanx experts can help you! pudding, pate and other programmers round circles about my poor dispmanx understanding :)

ajoburg
Posts: 12
Joined: Thu Feb 14, 2013 1:16 am

Re: SDL 1.2 with dispmanx backend

Thu Jul 11, 2013 3:39 pm

Thanks @vanfanel and hopefully you'll come back to RPi programming some time soon.

Ojzcroc
Posts: 1
Joined: Fri Jul 19, 2013 11:21 am

Re: SDL 1.2 with dispmanx backend

Fri Jul 19, 2013 11:36 am

I downloaded the directory off of github and ran MAC_ConfigureDISPMANX.sh, and it worked fine. however, when i said "make && sudo make install", it straight away said:

Warning. configure.in is out of date
#(cd . && sh autogen.sh && sh configure)

It then continued to run, so I thought there was no problem, but it then came up with another error:

fatal error: vchost_config.h: No such file or directory
compilation terminated.
make: *** [build/SDL_fbevents.lo] Error 1

I tried going back to the previous error and typing "cd . && sh autogen.sh && sh configure", but it said:

Generating build information using autoconf
This may take a while ...
Couldn't find autoconf, aborting

I use a raspberry pi model b running raspbian.
Sorry if this is a stupid question, but I can't figure out what's failing.

ajoburg
Posts: 12
Joined: Thu Feb 14, 2013 1:16 am

Re: SDL 1.2 with dispmanx backend

Fri Jul 19, 2013 3:47 pm

A file has moved in the Raspbian distribution and is not reflected in this code. Run again as follows and it should work:

Code: Select all

export CFLAGS="-I/opt/vc/include/interface/vmcs_host/linux"
./MAC_ConfigureDISPMANX.sh
make
sudo make install

Vanfanel
Posts: 433
Joined: Sat Aug 18, 2012 5:58 pm

Re: SDL 1.2 with dispmanx backend

Mon Oct 28, 2013 3:24 am

After ganing a better understanding about SDL1.2.x's innner workings, I've just updated my SDL1.2.15 fork with dispmanx backend.
It's now more stable and works in a more logical way (no longer forcing incorrect flags, after assuming the apps shouldn't know about our double-buffering because we're simply offering a software video surface and then using dispmanx's resources for double buffering in a "transparent way").

It also keeps aspect ratio by default (most source ports you will probably run are old 4:3 games), but this feature can be disabled with the enviroment variable SDL_DISPMANX_IGNORE_RATIO=1
For example, run

Code: Select all

SDL_DISPMANX_IGNORE_RATIO=1 ./scummvm
to have the dispmanx SDL backend to scale the games to fullscreen size withour keeping the 4:3 ratio.

Default behavior is to respect aspect ratio and put a blank element behind to hide console. I'm open to better solutions.

8BPP modes aren't supported: I've implemented an 8BPP paletted mode to 32BPP XRGB888 mode conversion but it's disabled because it eats ~10% of the Raspberry Pi's CPU in 8BPP games and I hate that suboptimal solution: enable it at your own risk. I'm waiting for the Rpi kernel people to help me out with dispmanx's resource palette setting, but I hadn't luck yet.

NOTE: It will prevent tearing, it will scale your games to fullscreen using Rpi's hardware, BUT it's incompatible with an X11 enviroment. Otherwise, you can safely overwrite Raspbian's default and broken SDL1.2.15 libs with these.

NOTE2: SDL1.2.x is *not* the way to go on the Pi. SDL2 offers way better support and integration with the Raspberry Pi, and this is only provided as a temporal solution until most apps will finally migrate to SDL2 usage. Use *only* for apps wich won't compile against SDL2.

The repository is the same, at:

https://github.com/vanfanel/SDL12-kms-dispmanx

Vanfanel
Posts: 433
Joined: Sat Aug 18, 2012 5:58 pm

Re: SDL 1.2 with dispmanx backend

Wed Nov 13, 2013 6:31 pm

I've fixed 8bpp games with SDL1.2.x backend.
Games such as OpenJazz or Chocolate Doom work now in 8 bit paletted glory without slooow color conversions.
I have also fixed a VERY important memory leak when a program changes resolution once it has started.

PLEASE UPDATE if you're using this backend.

Thanks to popcornmix for his work and patient support on the bcm side of things! :)

fanoush
Posts: 490
Joined: Mon Feb 27, 2012 2:37 pm

Re: SDL 1.2 with dispmanx backend

Wed Nov 13, 2013 8:13 pm

Is it possible to compile in also X backend and select it at runtime instead of dispmanx when DISPLAY variable is defined? Then it can be used as complete replacement for default libSDL.

welshy
Posts: 1667
Joined: Mon Oct 29, 2012 2:07 pm

Re: SDL 1.2 with dispmanx backend

Wed Nov 13, 2013 8:21 pm

Vanfanel
You mention SDL2.0, is it available in the repo yet (I didn't see it in the Wheezy dependencies list at Debain.org) or do I have to compile from Source Code and how much of an improvement is it over 1.2? (say for AdvanceMAME).
"The list of things I have heard now contains everything!"

Vanfanel
Posts: 433
Joined: Sat Aug 18, 2012 5:58 pm

Re: SDL 1.2 with dispmanx backend

Thu Nov 14, 2013 10:44 am

@fanoush: I *believe* it should be possible to simply remove the "--disable-video-x11" parameter from MAC_ConfigureDISPMANX.sh, then run MAC_ConfigureDISPMANX.sh and then recompile, and you should get both DISPMANX and X11 backends.

Since I am personally against the piece of crap X11 server is, I will do everything I can to make it disappear at last (we will be using Wayland on the Pi soon), so I won't be testing this: I don't have any X11 related lib in my Raspbian. Nothing but jerkyness, laggy controls, high CPU usage and tearing will come from an X11 backend, but you're free to try, of course :)

@whelsy: apps must be "ported" to SDL2 to be able to build against this version. Most apps would build more or less fine among the SDL1.x versions, but SDL2 is pretty much incompatible without some fundamental changes.
So SDL2 won't offer anything for AdvMAME if there's no SDL2 AdvMAME.
If there was an SDL2 version, I imagine it would offer hardware scaled video output (it could render to a GLES surface I guess), and proper double-buffered graphics with vsync, but hardware emulation is done "outside SDL" so it would still be limited by Rpi's CPU.

Since there are many SDL1.2.x that won't be moving to SDL2 anytime soon (Scummvm, I'm looking at you! :) ), I did this hacky Rpi backend to get hardware-accelerated fullscreen scaling and double-buffered graphics in SDL1.2.x apps on the Pi. How can people use games with the default Raspbian SDL broken backends (X11 and FBCON, wich is a joke) and not notice slowwww CPU-driven scaling and ugly tearing, is beyond my comprehension.

Ah! You can get SDL2.0.1 sources and build yourself from http://www.libsdl.org/download-2.0.php, wich has specific Rpi support, but don't hold your breath for an official Wheezy precompiled package.
You can run many open source games on the Pi with it already.

welshy
Posts: 1667
Joined: Mon Oct 29, 2012 2:07 pm

Re: SDL 1.2 with dispmanx backend

Thu Nov 14, 2013 11:34 am

Vanfanel
'but SDL2 is pretty much incompatible without some fundamental changes.'
Bummer! So I guess that means every SDL program unless its been altered to be compatible against the new version?
"The list of things I have heard now contains everything!"

Vanfanel
Posts: 433
Joined: Sat Aug 18, 2012 5:58 pm

Re: SDL 1.2 with dispmanx backend

Thu Nov 14, 2013 11:52 am

welshy wrote:Vanfanel
'but SDL2 is pretty much incompatible without some fundamental changes.'
Bummer! So I guess that means every SDL program unless its been altered to be compatible against the new version?
Pretty much yes. There isn't a "SetVideoMode()" function anymore, for example. That made no sense on modern displays.

irori
Posts: 4
Joined: Fri Mar 15, 2013 12:56 pm
Location: Japan

Re: SDL 1.2 with dispmanx backend

Wed Dec 25, 2013 8:17 am

@Vanfanel:
I'm using this SDL1.2 for a retro PC emulator and it works really great, except that the mouse cursor is not shown. That's because SDL_DrawCursor() is commented out; uncommenting it fixed the problem.
I wonder why that function is commented out. Is there any chance you'll revive it?

Vanfanel
Posts: 433
Joined: Sat Aug 18, 2012 5:58 pm

Re: SDL 1.2 with dispmanx backend

Wed Dec 25, 2013 11:17 am

irori wrote:@Vanfanel:
I'm using this SDL1.2 for a retro PC emulator and it works really great, except that the mouse cursor is not shown. That's because SDL_DrawCursor() is commented out; uncommenting it fixed the problem.
I wonder why that function is commented out. Is there any chance you'll revive it?
I don't remember why it was commented out, really! But you can uncomment it without problem. I will make an update soon and leave it uncommented.
How does the PC98 emulator run?? Is it 100% at 60FPS???

irori
Posts: 4
Joined: Fri Mar 15, 2013 12:56 pm
Location: Japan

Re: SDL 1.2 with dispmanx backend

Thu Dec 26, 2013 1:35 am

Vanfanel wrote: I don't remember why it was commented out, really! But you can uncomment it without problem. I will make an update soon and leave it uncommented.
How does the PC98 emulator run?? Is it 100% at 60FPS???
Great, thanks!!

My emulator works at 30 fps steadily (CPU emulation is pretty heavy), which is a huge improvement from the X11-based version that was at <5 fps :)
I haven't tried yet, but using 8bpp mode might improve it further. NP2 has some 8bpp support but the SDL port needs some work to integrate it.

welshy
Posts: 1667
Joined: Mon Oct 29, 2012 2:07 pm

Re: SDL 1.2 with dispmanx backend

Thu Jan 09, 2014 2:23 pm

I have just compiled the new version from the Git (latest Raspbian release 2013-12-20). However, Mednafen now gives the following error on initialisation -

ERROR: MAC Dispmanx - the program is calling SDL.GetVideoInfo. That shouldn't happen.

Signal has been caught and dealt with : SIGSEGV


Then exits with a segmentation fault. Any ideas what the issue is?
"The list of things I have heard now contains everything!"

Return to “Gaming”