Open wu-lee opened 4 years ago
First off, this is really cool, and if you get this running I'd love to put some screenshots of it on the homepage (if you didn't mind)! :smile:
Since the Racket CSFML examples work, it most likely has to be something in the R-cade code. While bugs are possible, my gut tells me it's probably a feature being used that isn't supported on the Raspberry Pi or your setup isn't prepared for them. Some of those features:
Audio. It's possible the crashes are due to OpenAL and libsndfile1 not being present. I'm sure libraries for both exist for Raspberry Pi, although I haven't looked. I'm only guessing this since you didn't list them as being installed.
Audio cont. Even if you don't play any sound, sound channels still get created. If you fork the code and change this line to [sounds null]
, then no sound channels will be created. If that ends up working, let me know and I can add a #:audio
flag to the run
method. Note: music won't create a channel unless you attempt to play music. You may need to try and example that doesn't play music or comment out the line that starts the music playing. This may obliterate the requirement of the other 2 libraries, but I don't know.
Shaders. Check out the run function, and try disabling the #:shader #f
effects and see if that works.
Render-to-texture. I doubt this is it. But, if it is there's not much to be done as it's a core implementation detail of r-cade.
First off, this is really cool, and if you get this running I'd love to put some screenshots of it on the homepage (if you didn't mind)! smile
Absolutely!
So I've checked:
[later] Hmm. Perhaps disabling audio doesn't even help with the segfault, as I get a one reliably now even though I've done it.
Checking on my desktop: running ex_3.rkt
in the csfml source code opens a window and a yellow-bordered blue ball follows the mouse cursor. Examples 1 and 2 do too, although 1 doesn't even show anything and 2 just opens a red background window and waits for an escape key press.
Checking these on the Pi: 1 and 2 are still working as above. 3 opens a window, but the ball does not follow the mouse. Hacking it with a debug print, I can see the event loop is running, and events of some sort do arrive when the mouse cursor enters the screen. I've not yet worked out how to print these events' type.
Are there any more pure csfml examples I could try running?
I've been attempting to get r-cade running on a Kano, which is essentially a Raspberry Pi running (a version of) Raspbian. Specifically:
The problem: I get a segmentation fault when I run all r-cade examples. See output below. The window opens, but nothing appears in it. After a few seconds, it disappears when the program dumps core.
I'm trying to track this down, but perhaps you might be able to offer some clues diagnosing this?
Here is the console output:
I think the "vertical sync not supported" message can be ignored as working cases of SFML print this too (see below). Likewise the "server socket err" is I think related to absence of a Jack server. Therefore I don't think these are related to the segmentation fault.
Aside: the stock version of Racket for Raspbian 9.6 is in the 6.x series and has other problems (no definition of
vector-equals?
which I infer means r-cade needs a 7.x version). As does the stock version of libcsfml (see #5). Hence I've had to work around these by getting newer packages elsewhere.I've attempted to get a stack trace from these crashes, but not really successfully so far. For example (core from running the hello-world program example in the r-cade tutorials):
Valgrind (this time running twinkle.rkt) seems to offer a bit more of a clue, but not much:
Examples of SFML working: the C++ Pong example in SFML's source-code seems to run if I compile it, as do the Racket CSFML library examples (although they might have locked up the system once). No seg fault.
I can also get a simple racket HTDP program to run, which opens a window and renders into it, so the problem doesn't seem to be racket or its usual graphics libraries.
However, I have run out of ideas of things to check easily for the moment!