Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling on the Raspberry Pi 4 (Raspbian Buster) #576

Open
ghost opened this issue Jul 13, 2019 · 126 comments
Open

Compiling on the Raspberry Pi 4 (Raspbian Buster) #576

ghost opened this issue Jul 13, 2019 · 126 comments

Comments

@ghost
Copy link

ghost commented Jul 13, 2019

It seems to be the opportune moment to update the compilation guide of Attract-Mode in pi4 with Raspbian Buster, right?

@mickelson
Copy link
Owner

mickelson commented Jul 13, 2019 via email

@ghost
Copy link
Author

ghost commented Jul 30, 2019

I have already prepared the pull request, with the AM compilation in Buster, including Buster Lite, but I have two problems:
1 - This does not allow me to add a new pull request anywhere.
2 - After doing the whole compilation process (in my raspberry pi 4 4GB) without seeing any error message, when I'm going to start attract-mode, it doesn't start and says "* failed to add service - already in use?

@SUPER-DAN
Copy link

Hi, I have the same exact same problem. No problem compiling like @ghost, but when it's time to start it, I have the same error : "* failed to add service - already in us?"

I had the same error when compiling Retroarch on the Raspberry Pi 4. It seems to be a problem with version 1 of OpenGL (Gl1) which is not supported in the new GPU if I remember well. Just before compiling, one guy suggested to add flag(option) to disabled it from the make so the application is not trying to start it(causing the error we get).

I don't know how to interpret this Attract-Mode, but I would like to get it working on my Raspberry Pi 4. This guy @karbinunit on Github was able to get us debugged by this command before compiling : CFLAGS='-mfpu=neon -mtune=cortex-a72 -march=armv8-a' ./configure --enable-alsa --enable-udev --enable-neon --disable-videocore --enable-opengles --enable-opengles3 --disable-opengl1 --enable-x11

Source is : https://gist.github.com/AlexMax/32e5d038a66ce57253e740ea75736805

I am not too sure if you can do something with that from here. If i find something, I'll let you know.

@kwyxz
Copy link

kwyxz commented Oct 23, 2019

Just saw Attract-Mode was updated to 2.6.0 @SUPER-DAN does it fix your issue?

@mbirnie
Copy link

mbirnie commented Oct 27, 2019

@kwyxz This is issue still occurs with 2.6.0 when compiling with the most recent raspbian updates.

@mbirnie
Copy link

mbirnie commented Nov 2, 2019

This error has disappeared with the latest code from git and raspian updates 👍

@kwyxz
Copy link

kwyxz commented Nov 4, 2019

@mbirnie did you do anything specific? Following the documentation here - which means building sfml-pi and ffmpeg for mmal - I am still getting the error * failed to add service - already in use? when attempting to run attract mode from the command line (without X11) on a Raspberry Pi 4 running Raspbian with the latest update.

@mbirnie
Copy link

mbirnie commented Nov 6, 2019

I did nothing specific. I am currently on the latest raspbian image with all the latest updates. This version of raspbian also has a libsfml-dev package that can be installed instead of building sfml locally. I cloned the attract mode git repository from Oct 29th and built with USE_GLES=1

@kwyxz
Copy link

kwyxz commented Nov 6, 2019

Thanks, I had not thought about building using the Raspbian package for SMFL. I'll give it a try.

@kwyxz
Copy link

kwyxz commented Nov 7, 2019

@mbirnie can you please confirm you're running Attract-Mode with FKMS and not X11 because building the latest git rev using libsfml-dev from Raspbian and USE_GLES=1 I end up with Failed to open X11 display; make sure the DISPLAY environment variable is set correctly when running attract-mode.

@iOtero55
Copy link

I definitely don't think mbirnie got the compilation in the terms he told us. Either something is missing, or does not tell the truth.

@Sinistars
Copy link

any update on if anyone was successful?

@mbirnie
Copy link

mbirnie commented Feb 14, 2020

Sorry, I've been busy starting my own business and have had little time for hobbies... I am using the FKMS overlay driver with X11. With the latest git commits, I got attract-mode to work when compiled with

make USE_GLES=1 USE_VC4=1

@iOtero55
Copy link

If @mbirnie is using attract-mode he will do it under x11, because compiling as he says the message still comes out:
"Failed to open X11 display; make sure the DISPLAY environment variable is set correctly"

@chase-cobb
Copy link
Contributor

I just added a page to the wiki with the build process I followed to get a working build in Buster.

@chase-cobb
Copy link
Contributor

I just added a page to the wiki with the build process I followed to get a working build in Buster.

Could you provide a link :S

https://github.com/mickelson/attract/wiki/Compiling-on-the-Raspberry-Pi-4-(Raspbian-Buster)

@chase-cobb
Copy link
Contributor

I just added a page to the wiki with the build process I followed to get a working build in Buster.

Could you provide a link :S

https://github.com/mickelson/attract/wiki/Compiling-on-the-Raspberry-Pi-4-(Raspbian-Buster)

Thanks this will help users fine a direct link. Also did you get this working on a pi 4 ?

Yes, these were the steps I took to get it running on my Pi 4.

@kwyxz
Copy link

kwyxz commented Apr 29, 2020

Yes, these were the steps I took to get it running on my Pi 4.

... under X11, right?

@kwyxz
Copy link

kwyxz commented Apr 29, 2020

Very strange issue still shows Even on a fresh install that is already in use... mhmmm

Unless SFML is patched, there's no way to use Attract on the Raspberry Pi 4 without X11.

@chase-cobb
Copy link
Contributor

Very strange issue still shows Even on a fresh install that is already in use... mhmmm

Unless SFML is patched, there's no way to use Attract on the Raspberry Pi 4 without X11.

What’s the best guide to follow to install it on X11 at this time for new users.

Try this -> https://github.com/mickelson/attract/wiki/Compiling-on-the-Raspberry-Pi-4-(Raspbian-Buster)

@MancV21
Copy link

MancV21 commented May 13, 2020

@chase-cobb - When I follow your steps on a clean build of Raspian Buster, I get the error "Failed to open X11 Display". Is there something I should've done before trying to run it?

@kwyxz
Copy link

kwyxz commented May 13, 2020

@chase-cobb - When I follow your steps on a clean build of Raspian Buster, I get the error "Failed to open X11 Display". Is there something I should've done before trying to run it?

Yes : install and run X11.

@MancV21
Copy link

MancV21 commented May 13, 2020

NVM. I was using a terminal from my PC (so I could easily just copy ROMs across once it was installed). I decided I'd just try it straight on the machine (run > attract) and it works fine (so far). Now to install some emulators and ROMs and try it out.

Cheers. :)

EDIT - Out of interest, is it worth trying to install it on the latest RetroPie or is that a no go? And while I've got you, does lr-mame2003 run on Buster / RP?

Thanks again.

@2play
Copy link

2play commented May 19, 2020

The buster guide works great to compile but attract will run only on desktop/x11
otherwise "Failed to open X11 Display"
You can edit autostart to startx and then attract.
But it would be nice to run with FKMS as everything now changed for pi4 support.
Probably a clean buster with desktop and and no kms enabled should work as before, right?

@oomek
Copy link
Collaborator

oomek commented May 19, 2020

What do you mean by saying "through RetroPie" ? AM will not magically turn complicit with KMS.

@2play
Copy link

2play commented May 19, 2020

Hi @supremeretropie
Unfo Attract mode runs over x11 not with KMS at the moment. I can run attract on the desktop my self thats not the problem.
AM cant run and boot directly to it from cli as in the past as a seaprate frontend.
Thats the only way to run it, over x11.
I think the discussion here is to make AM boot/run as was on pi3. Option to exit retropie boot direct to AM if supported.

OK from what you posted last if their devs manage to make it run oven KMS then task will be accomplished. Ive already updated my auto install scritps for pi4.
Now we wait for KMS :-)

@oomek
Copy link
Collaborator

oomek commented May 19, 2020

The main advantage of FKMS is that we can finally have shaders working on PI. This requires a serious rewrite of the SFML linux window/glcontext management functions.

@2play
Copy link

2play commented May 19, 2020

@supremeretropie ill reply quick as its not the place. since PB v1 Nov 2008 I have created an auto installation script for ppl to install AM and all extras. Now ive updated to include the latest pi4 devs advised.

@airman221
Copy link

@chase-cobb - When I follow your steps on a clean build of Raspian Buster, I get the error "Failed to open X11 Display". Is there something I should've done before trying to run it?

Yes : install and run X11.

how do you install and run x11

@2play
Copy link

2play commented May 26, 2020

@chase-cobb - When I follow your steps on a clean build of Raspian Buster, I get the error "Failed to open X11 Display". Is there something I should've done before trying to run it?

Yes : install and run X11.

how do you install and run x11

Just google "install x11" but if you have already desktop on your pi4 probably you have it.
If you have you can run the attract mode in there

@cyborgcnc
Copy link

Compiling ffmpeg is not needed anymore repo's version of libavcodec related files have mmal enabled by default. Make sure you specify USE_DRM=1 and USE_MMAL=1 on both make and make install statement when compiling attract

OK, I did that, and it DOES compile, but I still get the X11 error, need to specify display. I am probably doing something stupid....I do have a proper attract.cfg and other files, as the X11 error is the only one I get (yes I am starting it via the autoshart.sh ). Thoughts?

@joyrider3774
Copy link
Contributor

joyrider3774 commented Jun 16, 2020 via email

@cyborgcnc
Copy link

Yes, completely new Retropie image, as clean as it gets. Compiled sfml then attrack, all compile, and then used the installation options as specified above. Placed attract in the autoshart.sh and then reboot....it fails with:

"Failed to open X11 display, make sure you specify DISPLAY variable...."

Not sure what I am missing, and THANK YOU for your replies and help!

@2play
Copy link

2play commented Jun 16, 2020

That means you havent compiled with DRM and installed also same as compiled command (both need to havethe DRM)

@cyborgcnc
Copy link

cyborgcnc commented Jun 16, 2020

I SPECIFICALLY do this:

git clone --depth 1 https://github.com/mickelson/attract attract
cd attract
make USE_DRM=1 USE_MMAL=1
sudo make install USE_DRM=1 USE_MMAL=1
cd util/linux/drm
make
sudo make install

and this flag for sfml...cmake .. -DSFML_DRM=1

Is this wrong?

@joyrider3774
Copy link
Contributor

Or he is using compile instructions from earlier in the topic or has libsfml-dev installed from repos which might be another indicator he is using wrong compile instructions make sure libsfml is not installed from repo's, remove it using sudo apt-get statement if you added it

@joyrider3774
Copy link
Contributor

Those seem correct but smfl-pi comes before installing attract and make sure libsfml-dev is not installe by apt and have you called sudo ldconfig after building sfml-pi

@cyborgcnc
Copy link

cyborgcnc commented Jun 16, 2020

Removing libsfml-dev did it!! THANK YOU! Attract mode is now running! (I guess the above instructions should be modified). This is what I used on a clean Retropie Image for the Rpi4:

mkdir code
cd code
sudo apt-get install -y cmake libflac-dev libogg-dev libvorbis-dev libopenal-dev libjpeg8-dev libfreetype6-dev libudev-dev libdrm-dev libgbm-dev libegl1-mesa-dev
git clone --depth 1 https://github.com/mickelson/sfml-pi sfml-pi
mkdir sfml-pi/build; cd sfml-pi/build
cmake .. -DSFML_DRM=1
sudo make install
sudo ldconfig
clear
sudo apt-get install -y cmake libflac-dev libogg-dev libvorbis-dev libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libswscale-dev libavresample-dev libopenal-dev libfreetype6-dev libudev-dev libjpeg-dev libudev-dev libfontconfig1-dev libglu1-mesa-dev libxinerama-dev libcurl4-openssl-dev
cd ..
cd ..
git clone --depth 1 https://github.com/mickelson/attract attract
cd attract
make USE_DRM=1 USE_MMAL=1
sudo make install USE_DRM=1 USE_MMAL=1
cd ~;rm -rf ./code/attract && rm -rf ./code/ffmpeg && rm -rf ./code/sfml-pi
sudo reboot now

(REMOVED DRM Helper, as stated, no longer needed!)

THANK YOU again!!..on to scraping and configuring ROMs and emulators...

mickelson added a commit that referenced this issue Jun 16, 2020
- for this to work attract must be linked against the most recent
  version of sfml-pi i.e. later than: mickelson/sfml-pi@55ab6ae#diff-3793c0000e00da5abb7e50333fdc6ba0
- attract mode will now fully release its hold on the display when
  launching an emulator, eliminating the need for attract-drm-helper.
- attract-drm-helper files have been removed from the repository and
  the executable should be removed from your system if you have it!
- Issues: mickelson/sfml-pi#13
		#576
@Zarach0095
Copy link

Is the joypad input working? I have a new install going but I haven't tried attract-mode yet hoping for someone's answer?

@joyrider3774
Copy link
Contributor

joypad input is working, i use joysticks myself. But you might need a keyboard attrached for intial setup

@cyborgcnc
Copy link

It seems that there are still a few keyboards issues. With attract mode running, if I try to press a key to bring up the launch menu (so say we can change an emulator for a particular ROM etc) it only works if I press the ESC key. Also, once in that menu, keyboard navigation does NOT work...In addition, if say I exit attract mode, once back in the terminal, keyboard does not work again...

Using the same keyboard (to rule out any issues) all works fine in emulation station, including all the menus etc...just not in attract mode.

Keyboard works fine while IN attract mode, but seems to not work for menus etc...is anyone else seeing this?

@joyrider3774
Copy link
Contributor

joyrider3774 commented Jun 17, 2020

@cyborgcnc
i don't have such issues, i just tested again with keyboard only. Do you have latest attract & latest sfml-pi running ? i've said it last time for some reason if you end up with a locked console when exiting (which has nothing todo with keyboard but might look like that as typing does not produce input on the console) it could be due to the restoring of the console not being executed with you for some reason. The console where attract is being run from is set to non interactive, meaning it receives no input whatsoever but it should be restored upon exiting attract. If this does not happen for you or it can not restore it for some reason you can not type in the console after exiting attract

i can run the runcommand menu (which has nothing todo with attract at all) without problem pressing enter or esc. if launch images are shown i do have to press a key twice. But i think even on my pi3 in the past that only specific keys worked for it and not all. i can navigate the runcommand menu without problems using keyboard

I'm not sure but it is possible console is also restored upon launching an emulator and if it that also does not happen with your setup (like when it does not happen when exiting attract) for some reason it might explain your behaviouir

Please provide better instructions on how to reproduce as to when this is happening as it can not be reproduced with me with a quick test.

Is your attract & sfml-pi latest versions ?
did you start fresh from a clean image like really flashed the retropie pi 4 image on a card and started from there and not using some older images etc ?
You run attract & immediatly exit attract -> is console locked (like accepting no input) ?
if not you run a certain emu exit game exit attract -> is console locked ? if so tell us which emu and see if it's reproducable if it's with all emu's does not matter.
how do you start attract ?
what is your select button set to in attract ?

it still seems to me restoring the console does not seem to work with you but i can not reproduce it

@cyborgcnc
Copy link

Answers below...thanks again!

Is your attract & sfml-pi latest versions ?
-Yes I compiled them both Yesterday..using what I typed above...Don't think there has been another update?

did you start fresh from a clean image like really flashed the retropie pi 4 image on a card and started from there and not using some older images etc ?
-Correct....Brand new Image, nothing on it, flashed a new 128GB card

You run attract & immediatly exit attract -> is console locked (like accepting no input) ?
-NO, in this case the console is not locked..I can type. Also, if I type exit, I get back to attract

if not you run a certain emu exit game exit attract -> is console locked ? if so tell us which emu and see if it's reproducable if it's with all emu's does not matter.
-YES, in this case, if I exit Atttract AFTER I run a ROM, the console now IS LOCKED, does not accept any input. Only emulator I am testing with at the moment is advmame (no libreto), straight advmame..which runs the rom with no issue. Once in the ROM/Game, I can also bring up the mame config menu, again, keyboard works. If I exit attract then, => locked console.

how do you start attract ?
From /opt/retropie/configs/all/autostart.sh

what is your select button set to in attract ?
-Currently set to ENTER, but I also tried LCNTRL, and deleting ENTER, but same results.

Thank you for your help!

@joyrider3774
Copy link
Contributor

@cyborgcnc does it happen with other emulators also so startup run 1 game from other emulator and exit attract? i jus tried the same with advmame but the problem did not occur with me so really not sure what is going on in your case

@cyborgcnc
Copy link

Just also tried it with mame2003, same result...something is really messed up..I have also tried two different keyboards to rule out hardware....Absolutely no issues in Emulationstation, just in attract mode....

Could you share a short snip of what you did to compile yours? Maybe I am missing something, or some library etc..not sure what else to try anymore.....I want to convert two of my machines over to Raspberry pi4 from 3, and this is driving me nuts!!!

@cyborgcnc
Copy link

Did something change to install method ?

Read the comments above...You no longer need libsmfl library, and no longer need the drm helper...a few comments above, is where I went through this, and then it all compiled again...

As you can also see, I am having massive keyboard issues, that I have not been able to resolve...curious as to your findings...

@supremeretropie
Copy link

On the previous version before all these changes everything worked 100% I’m may even thinking something was changed to case your issues.

@cyborgcnc
Copy link

Trying to find that out....I have compiled like 5 different times...thinking it is one thing or the other, and for the life of me, the keyboard just refuses to work once I enable the Launch menus, or exit attract after I run a game.....agreed, has to be something, as I am not doing anything strange, and I always start from a clean retropie Image...Would appreciate it, if you share your findings after you compile it again...

@supremeretropie
Copy link

Can you provide the steps you followed. To get it to load and I’ll see if I can fine a older branch of attract as id love to compare it.

@cyborgcnc
Copy link

Can you provide the steps you followed. To get it to load and I’ll see if I can fine a older branch of attract as id love to compare it.

mkdir code
cd code
sudo apt-get install -y cmake libflac-dev libogg-dev libvorbis-dev libopenal-dev libjpeg8-dev libfreetype6-dev libudev-dev libdrm-dev libgbm-dev libegl1-mesa-dev

git clone --depth 1 https://github.com/mickelson/sfml-pi sfml-pi
mkdir sfml-pi/build; cd sfml-pi/build
cmake .. -DSFML_DRM=1
sudo make install
sudo ldconfig

sudo apt-get install -y cmake libflac-dev libogg-dev libvorbis-dev libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libswscale-dev libavresample-dev libopenal-dev libfreetype6-dev libudev-dev libjpeg-dev libudev-dev libfontconfig1-dev libglu1-mesa-dev libxinerama-dev libcurl4-openssl-dev

cd ..
cd ..

git clone --depth 1 https://github.com/mickelson/attract attract
cd attract
make USE_DRM=1 USE_MMAL=1
sudo make install USE_DRM=1 USE_MMAL=1

cd ~;rm -rf ./code/attract && rm -rf ./code/ffmpeg && rm -rf ./code/sfml-pi
sudo reboot now

Before the reboot, make sure you go into the /opt/retropie/configs/all directory and modify the auotstart.sh script to boot into attract mode, and not emulationstation...

@cyborgcnc
Copy link

Just finished and I get failed export dumb buffer: permission denied.

Did you start from a clean image?

@supremeretropie
Copy link

Just finished and I get failed export dumb buffer: permission denied.

Did you start from a clean image?

I got it to load finally but I noticed not full screen but besides that my keyboard works fine.

@cyborgcnc
Copy link

cyborgcnc commented Jun 18, 2020

Just finished and I get failed export dumb buffer: permission denied.

Did you start from a clean image?

I got it to load finally but I noticed not full screen but besides that my keyboard works fine.

OK, so once in attract, start a ROM, with the Load menu enabled, where is says (hit any key to go to load menu), does that work? Once in load menu (I can only get into it by hitting escape) does the keyboard work there?

@joyrider3774
Copy link
Contributor

joyrider3774 commented Jun 18, 2020 via email

@joyrider3774
Copy link
Contributor

joyrider3774 commented Jun 18, 2020 via email

@joyrider3774
Copy link
Contributor

joyrider3774 commented Jun 18, 2020 via email

@cyborgcnc
Copy link

I am not any closer to getting this resolved, tried everything in the book....My keyboard just does not work once in Attract mode, have compiled this with every option possible, and have been trying all sort of different configs etc....hope someone that knows a lot more than me can figure this out....I have also tried oomek's builds, with same results......

@devenhulk
Copy link

devenhulk commented Jun 21, 2020

help please it keeps saying segmentation fault permission denied when i try to boot also evan when i put in sudo attract it says permission denied also before itried this method emulationstation was working but now i get the same error
mkdir code
cd code
sudo apt-get install -y cmake libflac-dev libogg-dev libvorbis-dev libopenal-dev libjpeg8-dev libfreetype6-dev libudev-dev libdrm-dev libgbm-dev libegl1-mesa-dev

git clone --depth 1 https://github.com/mickelson/sfml-pi sfml-pi
mkdir sfml-pi/build; cd sfml-pi/build
cmake .. -DSFML_DRM=1
sudo make install
sudo ldconfig

sudo apt-get install -y cmake libflac-dev libogg-dev libvorbis-dev libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libswscale-dev libavresample-dev libopenal-dev libfreetype6-dev libudev-dev libjpeg-dev libudev-dev libfontconfig1-dev libglu1-mesa-dev libxinerama-dev libcurl4-openssl-dev

cd ..
cd ..

git clone --depth 1 https://github.com/mickelson/attract attract
cd attract
make USE_DRM=1 USE_MMAL=1
sudo make install USE_DRM=1 USE_MMAL=1

cd ~;rm -rf ./code/attract && rm -rf ./code/ffmpeg && rm -rf ./code/sfml-pi
sudo reboot now

Before the reboot, make sure you go into the /opt/retropie/configs/all directory and modify the auotstart.sh script to boot into attract mode, and not emulationstation...
exact stuff i did

@kwyxz
Copy link

kwyxz commented Jan 9, 2023

@mickelson this can definitely be closed, attract-mode builds just fine on Raspberry Pi 4 now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests