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

Attract Mode not working on Raspberry Pi 4 #575

Closed
chunksin opened this issue Jul 3, 2019 · 25 comments
Closed

Attract Mode not working on Raspberry Pi 4 #575

chunksin opened this issue Jul 3, 2019 · 25 comments

Comments

@chunksin
Copy link

chunksin commented Jul 3, 2019

Attract Mode compiles but will not run on the new Raspberry Pi 4 - I suspect this is due to the new videocore - are there compile flags we can use to get this working or will it need to be recoded for the new hardware?

@mickelson
Copy link
Owner

mickelson commented Jul 3, 2019 via email

@kwyxz
Copy link

kwyxz commented Sep 18, 2019

Linking to sfml-pi using the old method (hence linking with the libs in /opt/vc/) ends up with this:

pi@pi4:~ $ attract
* failed to add service - already in use?

Using the packaged sfml, attract is asking for X11.

Running X11 sure is a solution, but it's a lot of CPU / GPU power wasted as it would be real nice to be able to run Attract-mode directly from KMS like before.

@kwyxz
Copy link

kwyxz commented Oct 23, 2019

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

@kwyxz
Copy link

kwyxz commented Nov 4, 2019

Welp unfortunately, I am still getting the same message even with latest Git version of Attract-Mode

pi@pi4:~ $ attract
* failed to add service - already in use?

@iOtero55
Copy link

iOtero55 commented Nov 6, 2019

I'm in the same situation...

@chunksin
Copy link
Author

chunksin commented Nov 6, 2019

Confirmed working for me in X11 but not from the frame buffer

@joyrider3774
Copy link
Contributor

if drm / kms support is used / implemented in sfml-pi (if at all possible) is that enough for running attract outside of X11 ? i've seen sample codes kmscube or others on github that run on my pi when using /dev/dri/card1 (card0 does not produce output in samples i tried). Unfortunatly i'm no linux dev expert and have no idea how hard it would be to get this working als don't know if adding it to sfml-pi is enough to get it working outside X11

@alinke
Copy link

alinke commented Apr 28, 2020

getting the same error, anyone have a fix to compile attract yet on Pi 4? I make a LED marquee called Pixelcade https://youtu.be/WizU4eX6M5A?t=539, have quite a few Pi 4 customers requesting Attract Mode support so would like to take the project up, just hoping it can compile on a Pi 4 and then I can make the needed mods to integration with the marquee , thanks

@kwyxz
Copy link

kwyxz commented Apr 28, 2020

I believe an update to SFML is necessary. Until then Attract-Mode won't work under DRM/KMS on the Pi4.

I ended up giving up and built Attract-Mode under X11. The Pi4 is more than capable and the performance loss is manageable, even though it brings other challenges (sometimes when it starts, Attract Mode doesn't have mouse focus which is quite problematic on a system with no mouse)

@alinke
Copy link

alinke commented Apr 28, 2020

thanks much @kwyxz ! will try on X11. Have not built under X11 before, if you have any instructions on how to do that, would be helpful.

@kwyxz
Copy link

kwyxz commented Apr 28, 2020

As far as I can remember, there's nothing specific to do as long as the X11 development packages from Raspbian are installed. You can even use libsfml-dev from Raspbian. The build process should find the proper headers and build a X11-enabled Attract-mode.

@alinke
Copy link

alinke commented Apr 28, 2020

Got it @kwyxz , thx much !

@kwyxz
Copy link

kwyxz commented Apr 28, 2020

You're welcome, hope you get it to work. In order to minimize the desktop environment impact, I switched from whatever is installed by default to i3 and I run attract automatically from its startup file. As I said I sometimes suffer from mouse cursor issues and attract-mode cannot capture the focus, and sometimes not, it's random.
Also, the PixelCade LED marquee looks AMAZING!! Any chance this could be adapted to a Picade? That is what I plugged my Pi4 to.

@alinke
Copy link

alinke commented Apr 28, 2020

Will try this out tonight and report back , thx again ! For Pixelcade , it can do one led panel too for bartops , here is one I did https://youtu.be/krdcABgy68A . For Pi Cade , can you send me the dimensions of the marquee spot and I will check , send to al@ledpixelart.com . I still need to mod attract mode and add in the hooks for Pixelcade which are just rest api calls triggered when attract mode selects a game (screen saver events too if possible). I have this working for EmulationStation , having the same compile problem there too , am hoping this fix will also take care of that.

@oomek
Copy link
Collaborator

oomek commented Apr 28, 2020

Hi, I see a lot of interest of running AM under DRM recently, so I've been thinking about what would be the best approach to that. There are 3 paths:

  1. Suggest a DRM backend addition to SFML devs (Which I have already done, sadly Laurent the main dev wasn't even aware of its existence and did not say if he's interested)
  2. Adding it myself and propose a pull request to SFML
  3. Move to managing DRM window creation inside AM, a bit messy, but the only path that gives us full control.

Currently I'm occupied by other projects, anyway, I doubt it's a one man job, I would need some helping hand. Anyway with the DRM window and GLES 2.0 context and through MESA's OpenGL driver we would have finally shaders working on the RPI, so the outcome would be quite rewarding.

@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.

@alinke
Copy link

alinke commented Apr 29, 2020

thanks Chase, I tried that on the latest RetroPie Pi 4 image that was released a few days ago. It compiles but then errors out when launching X. I didn't try though on Raspian, will give that a shot too. As RetroPie doesn't have X, I also did

sudo apt-get install xinit
xinit attract

This process did work for me through on the RetroPie Pi 4 image https://forum.odroid.com/viewtopic.php?t=18283

@chase-cobb
Copy link
Contributor

thanks Chase, I tried that on the latest RetroPie Pi 4 image that was released a few days ago. It compiles but then errors out when launching X. I didn't try though on Raspian, will give that a shot too. As RetroPie doesn't have X, I also did

sudo apt-get install xinit
xinit attract

This process did work for me through on the RetroPie Pi 4 image https://forum.odroid.com/viewtopic.php?t=18283

Thanks for the link.

I can only validate that the method I outlined worked for me on Raspbian Buster. Haven't tried it personally on any other distros or permutations.

@joyrider3774
Copy link
Contributor

'xinit attract' did not work for me. Well it is to say it did start attract but i'm having focus issues and advmame did not work (no keyboard input working). I also used apt to install xinit (not sure if i installed something else) then used & installed fluxbox as window manager created a startup script to start attract & set background black using 'xterm -e attract' also edited xterm app settings to show always maximized and without window decorations i also added a 'killall Xorg' command so that when i exit attract X is closed and i end up outside x. it's working fine now for me also in advmame (input is working) now and can't say i have noticed focus issues yet but have not tested much still need to test other emulators

It's a workaround but having a KMS backend for sfml pi would be nicer

@chase-cobb
Copy link
Contributor

chase-cobb commented May 1, 2020

'xinit attract' did not work for me. Well it is to say it did start attract but i'm having focus issues and advmame did not work (no keyboard input working). I also used apt to install xinit (not sure if i installed something else) then used & installed fluxbox as window manager created a startup script to start attract & set background black using 'xterm -e attract' also edited xterm app settings to show always maximized and without window decorations i also added a 'killall Xorg' command so that when i exit attract X is closed and i end up outside x. it's working fine now for me also in advmame (input is working) now and can't say i have noticed focus issues yet but have not tested much still need to test other emulators

It's a workaround but having a KMS backend for sfml pi would be nicer

Your suggestion is a workaround for not running a X11 environment, but that's not what this ticket is for. Using the instructions I provided, Attract Mode does work on Raspberry Pi 4. Which should help resolve this specific issue.

What you're asking for are new features and should probably be it's own ticket.

@joyrider3774
Copy link
Contributor

i know that it compiles like that, i have done it in the past already, and recently did it again. Was just saying that running "xinit attract" will show attract but you can end up with "usuability problems" one such example is mouse fouces if the default window manager is used (twm). Another problem i alreay encoutered is using advmame and twm user input from keyboards is not working then but probably also a focus issue. Thats why i used fluxbox window manager with a few extra's. Was just saying it to give a headsup that you might encounter problems running it like that.

Suggestion was long time ago made already in sfml-pi repo. Only mentioned that i'm using that workaround until the feature might be implemented.

@kwyxz
Copy link

kwyxz commented May 1, 2020

Your suggestion is a workaround for not running a X11 environment, but that's not what this ticket is for. Using the instructions I provided, Attract Mode does work on Raspberry Pi 4. Which should help resolve this specific issue.

It's unclear because of the wording of the issue title. Building and running with X11 has always worked. Looking at what the OP wrote, he was definitely trying to run attract-mode without X11. Maybe @chunksin could update the issue title to reflect this.

@chase-cobb
Copy link
Contributor

Your suggestion is a workaround for not running a X11 environment, but that's not what this ticket is for. Using the instructions I provided, Attract Mode does work on Raspberry Pi 4. Which should help resolve this specific issue.

It's unclear because of the wording of the issue title. Building and running with X11 has always worked. Looking at what the OP wrote, he was definitely trying to run attract-mode without X11. Maybe @chunksin could update the issue title to reflect this.

I get what you're saying and maybe this ticket should be closed either way. The issue is moot because AM does indeed run on Raspberry Pi 4, which is the literal solution to the title of the issue, or it is an ambiguous duplicate of the other issue.

@kwyxz
Copy link

kwyxz commented Jan 9, 2023

Same here, this can definitely be closed @mickelson

@chunksin chunksin closed this as completed Jan 9, 2023
@chunksin
Copy link
Author

chunksin commented Jan 9, 2023

Thanks all, attract mode working perfectly in and out of X windows on Pi 4

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

8 participants