Glorer
Posts: 1
Joined: Sun Sep 30, 2012 4:13 pm

Cabrio front end - lets try to make it work

Sun Sep 30, 2012 6:51 pm

Hi there!

So i was planning on making my NES work again, and wanted to use the cabrio front-end on with RPi , but when looking at the requirements on the web page http://www.cabrio-fe.org/support/compile.html i found that the library libglut3-dev, doesn't exist on the repositories neither on raspbian ones not on debian (on debian there is a version for squeeze).

But there is another library called freeglut3-dev which was made to replace the old libglut3-dev, and there is a wheezy version for it on debian repos http://packages.debian.org/wheezy/freeglut3-dev, if you add the repo to raspberry, it install perfectly (architecture armhf), but if you compile it give you errors (it seems there is problems with functions calls), and i was wondering if we can make it work.

Im but an humble windows user, discovering the amazing RPi, so i have no idea of anything related to linux, yet ill like to make this work if possbile.


I will like to make cabrio work.

I say this because it seems a custom to recommend software that perform a similar function on many linux forums, instead of trying to make the one mentioned work (i know about emulationstation and retroarch), i mean, we are here to learn as well arent we?.
This is what happens if i try to make cabrio

Code: Select all

pi@raspberrypi ~/Desktop/cabrio/cabrio-0.8.2 $ make install

gcc -g -Wall -DDATA_DIR=\"/usr/local/share/cabrio\" -I./include -I/usr/include/libxml2 -o main.o -c main.c
gcc -g -Wall -DDATA_DIR=\"/usr/local/share/cabrio\" -I./include -I/usr/include/libxml2 -o ogl.o -c ogl.c
gcc -g -Wall -DDATA_DIR=\"/usr/local/share/cabrio\" -I./include -I/usr/include/libxml2 -o sdl_wrapper.o -c sdl_wrapper.c
gcc -g -Wall -DDATA_DIR=\"/usr/local/share/cabrio\" -I./include -I/usr/include/libxml2 -o config.o -c config.c
config.c: In function ‘config_new’:
config.c:2137:27: warning: variable ‘platform_catgeory’ set but not used [-Wunused-but-set-variable]
gcc -g -Wall -DDATA_DIR=\"/usr/local/share/cabrio\" -I./include -I/usr/include/libxml2 -o bg.o -c bg.c
gcc -g -Wall -DDATA_DIR=\"/usr/local/share/cabrio\" -I./include -I/usr/include/libxml2 -o menu.o -c menu.c
gcc -g -Wall -DDATA_DIR=\"/usr/local/share/cabrio\" -I./include -I/usr/include/libxml2 -o game_sel.o -c game_sel.c
gcc -g -Wall -DDATA_DIR=\"/usr/local/share/cabrio\" -I./include -I/usr/include/libxml2 -o game.o -c game.c
gcc -g -Wall -DDATA_DIR=\"/usr/local/share/cabrio\" -I./include -I/usr/include/libxml2 -o font.o -c font.c
gcc -g -Wall -DDATA_DIR=\"/usr/local/share/cabrio\" -I./include -I/usr/include/libxml2 -o hint.o -c hint.c
gcc -g -Wall -DDATA_DIR=\"/usr/local/share/cabrio\" -I./include -I/usr/include/libxml2 -o platform.o -c platform.c
gcc -g -Wall -DDATA_DIR=\"/usr/local/share/cabrio\" -I./include -I/usr/include/libxml2 -o submenu.o -c submenu.c
gcc -g -Wall -DDATA_DIR=\"/usr/local/share/cabrio\" -I./include -I/usr/include/libxml2 -o sound.o -c sound.c
gcc -g -Wall -DDATA_DIR=\"/usr/local/share/cabrio\" -I./include -I/usr/include/libxml2 -o event.o -c event.c
gcc -g -Wall -DDATA_DIR=\"/usr/local/share/cabrio\" -I./include -I/usr/include/libxml2 -o key.o -c key.c
gcc -g -Wall -DDATA_DIR=\"/usr/local/share/cabrio\" -I./include -I/usr/include/libxml2 -o control.o -c control.c
gcc -g -Wall -DDATA_DIR=\"/usr/local/share/cabrio\" -I./include -I/usr/include/libxml2 -o setup.o -c setup.c
gcc -g -Wall -DDATA_DIR=\"/usr/local/share/cabrio\" -I./include -I/usr/include/libxml2 -o sdl_ogl.o -c sdl_ogl.c
gcc -g -Wall -DDATA_DIR=\"/usr/local/share/cabrio\" -I./include -I/usr/include/libxml2 -o video.o -c video.c
video.c: In function ‘video_init’:
video.c:77:2: warning: ‘url_set_interrupt_cb’ is deprecated (declared at /usr/include/libavformat/avio.h:235) [-Wdeprecated-declarations]
video.c: In function ‘video_close’:
video.c:113:3: warning: ‘av_close_input_file’ is deprecated (declared at /usr/include/libavformat/avformat.h:1580) [-Wdeprecated-declarations]
video.c: In function ‘video_decode_video_frame’:
video.c:151:3: warning: implicit declaration of function ‘avcodec_decode_video’ [-Wimplicit-function-declaration]
video.c: In function ‘video_decode_audio_frame’:
video.c:180:4: warning: implicit declaration of function ‘avcodec_decode_audio2’ [-Wimplicit-function-declaration]
video.c: In function ‘video_open’:
video.c:309:2: warning: ‘av_open_input_file’ is deprecated (declared at /usr/include/libavformat/avformat.h:1368) [-Wdeprecated-declarations]
video.c:314:2: warning: ‘av_find_stream_info’ is deprecated (declared at /usr/include/libavformat/avformat.h:1412) [-Wdeprecated-declarations]
video.c:320:56: error: ‘CODEC_TYPE_VIDEO’ undeclared (first use in this function)
video.c:320:56: note: each undeclared identifier is reported only once for each function it appears in
video.c:324:61: error: ‘CODEC_TYPE_AUDIO’ undeclared (first use in this function)
video.c:341:2: warning: ‘avcodec_open’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:4035) [-Wdeprecated-declarations]
video.c:364:4: warning: ‘avcodec_open’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:4035) [-Wdeprecated-declarations]
video.c: In function ‘video_get_frame’:
video.c:453:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
make: *** [video.o] Error 1
For those that want to try, and like my don't have too much idea:
To add a repo to RPi, open a terminal and write:

Code: Select all

sudo nano /etc/apt/sources.list
put the repository direction , in the case or freegult3

Code: Select all

deb http://ftp.de.debian.org/debian wheezy main 
press
ctrl + o and enter to save
and ctrl + x to exit
To install all the requirements for cabrio follow the web page instructions but replace libglut3-dev with freeglut3-dev
Thx.

CodenameV
Posts: 29
Joined: Sat Aug 11, 2012 11:42 am

Re: Cabrio front end - lets try to make it work

Tue Oct 02, 2012 10:02 am

Hi all , I finally got Cabrio to compile in an emulated enviroment
my changes were

in video.c I changed
line 151 avcodec_decode_video to avcodec_decode_video2 and remove packet->data and packet->size and replace with just packet
line 180 avcodec_decode_audio to avcodec_decode_audio4 and remove ,audio_packet_size
line 319 CODEC_TYPE_VIDEO to AVMEDIA_TYPE_VIDEO
line 324 CODEC_TYPE_AUDIO to AVMEDIA_TYPE_AUDIO

as mentioned I cant really test it any further until I'm at home but this may help to move things along a little

levimadman
Posts: 12
Joined: Sat Oct 06, 2012 11:56 am

Re: Cabrio front end - lets try to make it work

Sat Oct 06, 2012 11:57 am

Just wanted to know if youre having any progress? or, what the current status of youre testing - this frontend look great!

FA-MAS
Posts: 14
Joined: Wed May 30, 2012 10:51 pm

Re: Cabrio front end - lets try to make it work

Mon Oct 08, 2012 3:46 pm

I got it to compile on the latest Raspbian image without having to modify anything or add any additional repositories to apt.

To get the pre-requesites, i ran:

Code: Select all

sudo apt-get install libsdl1.2-dev libsdl-image1.2-dev libsdl-gfx1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev freeglut3-dev libxml++2.6-dev ffmpeg libavcodec-dev libavformat-dev libswscale-dev
Then I used git to get the latest source:

Code: Select all

git clone https://github.com/SteveMaddison/cabrio.git
Then:

Code: Select all

make
make install
I attempted to run it and got an error:

Code: Select all

cabrio
Warning: Can't scan for additional config files in '/home/pi/.cabrio': No such file or directory
I/O warning : failed to load external entity "/home/pi/.cabrio/config.xml"
Warning: Error reading config file '/home/pi/.cabrio/config.xml'
Error: Unable to set video mode: Couldn't find matching GLX visual
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
Error: Unable to initialise sound: Couldn't open audio device: No such file or directory
Any ideas on that?

levimadman
Posts: 12
Joined: Sat Oct 06, 2012 11:56 am

Re: Cabrio front end - lets try to make it work

Mon Oct 08, 2012 5:49 pm

FA-MAS wrote:I got it to compile on the latest Raspbian image without having to modify anything or add any additional repositories to apt.

To get the pre-requesites, i ran:

Code: Select all

sudo apt-get install libsdl1.2-dev libsdl-image1.2-dev libsdl-gfx1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev freeglut3-dev libxml++2.6-dev ffmpeg libavcodec-dev libavformat-dev libswscale-dev
Then I used git to get the latest source:

Code: Select all

git clone https://github.com/SteveMaddison/cabrio.git
Then:

Code: Select all

make
make install
I attempted to run it and got an error:

Code: Select all

cabrio
Warning: Can't scan for additional config files in '/home/pi/.cabrio': No such file or directory
I/O warning : failed to load external entity "/home/pi/.cabrio/config.xml"
Warning: Error reading config file '/home/pi/.cabrio/config.xml'
Error: Unable to set video mode: Couldn't find matching GLX visual
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
Error: Unable to initialise sound: Couldn't open audio device: No such file or directory
Any ideas on that?

Nice - I'll compile it as you did and head right to it.

FA-MAS
Posts: 14
Joined: Wed May 30, 2012 10:51 pm

Re: Cabrio front end - lets try to make it work

Mon Oct 08, 2012 5:52 pm

Just wanted to make sure I was clear, it compiles. But it doesn't work.

levimadman
Posts: 12
Joined: Sat Oct 06, 2012 11:56 am

Re: Cabrio front end - lets try to make it work

Mon Oct 08, 2012 10:45 pm

Yes, crystal clear - I said I'll join the "execution effort"(doesn't sound quite right :D ).

levimadman
Posts: 12
Joined: Sat Oct 06, 2012 11:56 am

Re: Cabrio front end - lets try to make it work

Mon Oct 08, 2012 11:21 pm

Yes, crystal clear - I said I'll join the "execution effort"(doesn't sound quite right :D ).


OK - so thats my finding so far - created a config.xml file in home/pi/.cabrio(or ~./cabrio)
looking like this -

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<cabrio-config>
  <interface>
    <full-screen>true</full-screen>
    <screen>
      <width>1280</width>
      <height>720</height>
      <rotation>0</rotation>
      <flip-horizontal>0</flip-horizontal>
      <flip-vertical>0</flip-vertical>
    </screen>
    <graphics>
      <quality>high</quality>
      <max-image-width>512</max-image-width>
      <max-image-height>512</max-image-height>
    </graphics>
    <controls>
      <event>
        <name>up</name>
        <value>up</value>
        <device>
          <type>keyboard</type>
          <id>0</id>
        </device>
      </event>
      <event>
        <name>down</name>
        <value>down</value>
        <device>
          <type>keyboard</type>
          <id>0</id>
        </device>
      </event>
      <event>
        <name>left</name>
        <value>left</value>
        <device>
          <type>keyboard</type>
          <id>0</id>
        </device>
      </event>
      <event>
        <name>right</name>
        <value>right</value>
        <device>
          <type>keyboard</type>
          <id>0</id>
        </device>
      </event>
      <event>
        <name>select</name>
        <value>return</value>
        <device>
          <type>keyboard</type>
          <id>0</id>
        </device>
      </event>
      <event>

next - in sound.c
changed the following line 12:
from:

Code: Select all

if( Mix_OpenAudio( 22050, AUDIO_S16SYS, 4, AUDIO_CHUNK_SIZE ) == -1 ) {
to

Code: Select all

 if( Mix_OpenAudio( 22050, AUDIO_S16, 2, AUDIO_CHUNK_SIZE ) == -1 ) {

now when i start having a black screen - help will be appreciated. :D

FA-MAS
Posts: 14
Joined: Wed May 30, 2012 10:51 pm

Re: Cabrio front end - lets try to make it work

Tue Oct 09, 2012 1:24 am

I think we may need to have someone with the graphics knowledge look at lines 22-57 of sdl_wrapper.c

levimadman
Posts: 12
Joined: Sat Oct 06, 2012 11:56 am

Re: Cabrio front end - lets try to make it work

Tue Oct 09, 2012 10:38 pm

OK - changed 'mode' param - on SDL_SetVideoMode to go without OPENGL as it isnt supported in the pi.

further more - changed the resolution to cope with the pi, and now - reached to a point beyond my current knowledge and understanding.

I now think ogl.c file should be converted to be used as OPENGL ES - correct me if im wrong, the API is incorrect.

I'll be glad if someone with the correct knowledge and will - will take initiative and try to help! :D

FA-MAS
Posts: 14
Joined: Wed May 30, 2012 10:51 pm

Re: Cabrio front end - lets try to make it work

Wed Oct 10, 2012 6:24 pm

I'm curious. Barring someone looking at the code and porting it over, could we use a software opengl implementation like mesa?

If it runs, since it's just a front end, maybe the performance hit using software open gl wouldn't be as noticeable?

FA-MAS
Posts: 14
Joined: Wed May 30, 2012 10:51 pm

Re: Cabrio front end - lets try to make it work

Thu Oct 11, 2012 12:05 am

Well, I got something. But at this point I don't know what I did to get me this far. I don't think it was messing with mesa that did it.

I did install mesa-utils though so i could run glxinfo
I was getting no output from glxinfo

Could have been this

Code: Select all

sudo apt-get update
sudo apt-get install xserver-xorg-core
It's already installed, but it updated. I think that may have done it.
After the reboot I did glxinfo and got output
I have no idea what it means but I tried to launch cabrio

Image

FA-MAS
Posts: 14
Joined: Wed May 30, 2012 10:51 pm

Re: Cabrio front end - lets try to make it work

Thu Oct 11, 2012 3:57 am

Ok, I figured out what I did that allowed it to run.

On a clean raspbian image, I installed

mesa-utils
libgl1-mesa-dri

That's what enabled glxinfo to give me output.

Then I installed all the recommended packages for cabrio except for glut (lib or free)
I modified the sound.c file as earlier in the thread.

Then I did make
Then make install

I created a ~/.cabrio/config.xml

And it launches, but the animations are incredibly slow.

levimadman
Posts: 12
Joined: Sat Oct 06, 2012 11:56 am

Re: Cabrio front end - lets try to make it work

Thu Oct 11, 2012 10:54 pm

yeah.. it was pretty much expected of the software based opelgl in the pi - porting the ogl.c to OPENGL ES 2.0 is our best solution unfortunately - I guess.

miniarcade
Posts: 2
Joined: Thu Aug 14, 2014 3:29 pm

I found a workaround

Thu Aug 14, 2014 3:44 pm

Hey everybody,
I'm sorry about posting to such an old thread but I thought that I would let everyone know that it is possible to get cabrio running at full speed on the pi. you just have to install glshim (its not in the repos. you have to compile it from git) and make the appropriate symlinks to the libGL.so.1 file that it creates or set the LD_LIBRARY_PATH to it when you run cabrio.

We at miniarcademachine.com (its a work in progress) are now in the process of using this as the frontend for our upcoming systems.

you can also check out our kickstarter campaign at:
https://www.kickstarter.com/projects/10 ... de-machine


And if anyone runs into issues compiling glshim, just post here and ill be glad to assist

Nitrogen_Widget
Posts: 38
Joined: Tue Aug 28, 2012 5:52 pm

Re: Cabrio front end - lets try to make it work

Tue Aug 19, 2014 1:42 pm

So you have an image on the PI we can download to look at?

miniarcade
Posts: 2
Joined: Thu Aug 14, 2014 3:29 pm

Re: Cabrio front end - lets try to make it work

Tue Aug 26, 2014 3:56 am

here you go

http://miniarcademachine.com/wp-content ... -pi.img.7z


this image was made on the B+ but it should work on other versions.

If you try to run cabrio directly for the terminal then it will run extremely slow. But I put a script in /usr/bin/ called frontend that uses LD_LIBRARY_PATH to make it use the libraries created by glshim. so just open LXterminal and type frontend to see it working at fullspeed


Please keep in mind that this is a work in progress and I still have a lot of optimization in building the OS for the arcade achines that we plan to sell but its a start in the right direction none the less


anyways.......I hope this helps anyone that has been stuck on this issue for the past 2 or three years

User avatar
Jessie
Posts: 1754
Joined: Fri Nov 04, 2011 7:40 pm
Location: C/S CO USA

Re: Cabrio front end - lets try to make it work

Tue Aug 26, 2014 4:01 am

Thanks for providing the image I'm sure people will appreciate it.

Nitrogen_Widget
Posts: 38
Joined: Tue Aug 28, 2012 5:52 pm

Re: Cabrio front end - lets try to make it work

Sat Aug 30, 2014 3:04 pm

doesn't download fully for me.
is this running in X?
if so you might want to try going window managerless X to save some ram.

If I can get this to download i'll give it a try.

davlar
Posts: 1
Joined: Mon Apr 06, 2015 9:00 am

Re: Cabrio front end - lets try to make it work

Mon Apr 06, 2015 11:55 am

Thanks Miniarcade,
When I discovered Cabrio, I was directly thinking of a cross compilation on the RPi (next on an open handheld based on mips CPU, but it's an other projet...). Thanks for the built image ;)

I've just tested your provided image and it works on my RPi B modele. My cheap paddle is recognized under pisnes, but not yet with the Cabrio frontend.
All the configuration has to be done, so for people who want to try this image, you have to know this is just a fresh compiled cabrio on Pi, all the configration have to be done. nes and snes emulator are installed and works but not set under cabrio. The front end is working but it's totally empty (sections, images, emu configuration...). It's the seed you hve to make grown :) .

note: the analog video output is not activated by default so, try HDMI before thinking it does not work.

Thank a lot again, it rocks!

Maouu
Posts: 2
Joined: Sat Oct 03, 2015 3:41 pm

Re: Cabrio front end - lets try to make it work

Sat Oct 03, 2015 3:49 pm

Hello Everybody,

I'm looking for Front-end for my RPI 2 !! Cabrio is the most beautifull FE actually (except Retropie, but for my project is not the best)

I've tried to compile Cabrio with different version by myself, but I optained an error at each compilation :(
I download the pre-built image and back-up on the Pi, but it doesn't start !!!

Do you have the news about Cabrio FE for the Raspberry Pi 2 ?!! or the project is definitely dead ?!!

Thanks you very much.

Nitrogen_Widget
Posts: 38
Joined: Tue Aug 28, 2012 5:52 pm

Re: Cabrio front end - lets try to make it work

Mon Oct 05, 2015 5:49 pm

I have Attract Mode running on my RPI 1 rather fantastically.

http://attractmode.org/index.html

Compiling isn't too bad either.
https://github.com/mickelson/attract/wi ... -Wheezy%29

Maouu
Posts: 2
Joined: Sat Oct 03, 2015 3:41 pm

Re: Cabrio front end - lets try to make it work

Sun Oct 11, 2015 11:31 am

Thanks Nitrogen,

I've tried to compile on Raspian Wheezy but I obtained an error when I type :


pi@raspberrypi ~/develop/sfml-pi/build $ cmake -DEGL_INCLUDE_DIR=/opt/vc/include -DEGL_LIBRARY=/opt/vc/lib/libEGL.so -DFREETYPE_INCLUDE_DIR_freetype2=/usr/include -DFREETYPE_INCLUDE_DIR_ft2build=/usr/include/freetype2 -DGLES_INCLUDE_DIR=/opt/vc/include -DGLES_LIBRARY=/opt/vc/lib/libGLESv1_CM.so -DSFML_BCMHOST=1 ..
-- The C compiler identification is GNU 4.6.3
-- The CXX compiler identification is GNU 4.6.3
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for XOpenDisplay in /usr/lib/arm-linux-gnueabihf/libX11.so
-- Looking for XOpenDisplay in /usr/lib/arm-linux-gnueabihf/libX11.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Found X11: /usr/lib/arm-linux-gnueabihf/libX11.so
CMake Error at src/SFML/Window/CMakeLists.txt:188 (message):
Xrandr library not found

Do you have an idea ?!!

Thanks you.

EDIT: The solution is : sudo apt-get install libxrandr2 libxrandr-dev after the cmake will be ok !!!

Return to “Gaming”