Author Topic: Black screen in macOS build  (Read 359 times)

0 Members and 1 Guest are viewing this topic.

Offline Forestidia86

  • Posts: 504
    • View Profile
Black screen in macOS build
« on: April 07, 2019, 03:18:30 pm »
There seems to be an issue with a macOS build. From the descriptions of macOS users:

It starts and opens a window, but which has only a black screen. The music plays and at least with ldc it segfaults.

Issue 381 on github

From the #lix log of 4th of Jan, 2019 (concerning Lix 0.9.24):

[11:24:47]    <tarzeau> i've got an up to date 10.14 mojave mac now... i shall retry?
[11:24:55]    <tarzeau> remember what i need to install with brew?
[11:25:55]    <SimonN> brew install ldc dub allegro enet
[...]
[11:30:09]    <tarzeau> uncaught exception when i run ./bin/lix but that's surely the releaseXDG
[11:30:27]    <tarzeau> rebuilding...
[11:31:19]    <tarzeau> now i get a window called Lix, which shows black, nothing else
[11:31:59]    <tarzeau> adding --build=release as in windows
[11:32:04]    <SimonN> what is your exact build command?
[11:32:20]    <tarzeau> now it's: HOME=. dub build --build=release -f --compiler=ldc2
[11:33:07]    <tarzeau> oh wow now ./bin/lix goes fullscreen
[11:33:10]    <tarzeau> staying black
[11:33:21]    <tarzeau> pressing esc: segmentation fault
[11:33:23]    <SimonN> yeah, release defaults to fullscreen
[11:34:03]    <SimonN> go into the segfault with a debugger
[...]
[11:52:11]    <SimonN> tarzeau: When you build Lix, dub outputs versions of other dub packages. What version is "allegro" in that output?
[11:54:08]    <tarzeau> allegro 4.0.4+5.2.0: building config "no-libs"
[11:54:15]    <tarzeau> maybe i should not have copied that dub packages from linux?
[11:54:47]    <SimonN> hmm, 4.0.4+5.2.0 is correct version.
[11:55:34]    * tarzeau drops HOME=. and rebuilds, removed all the *-n/ dirs too
[11:55:40]    <SimonN> Copying stuff from Linux: dub stores built binaries in .dub dir, thus the copying could cause problems. Delete ~/.dub/ and (lix)/.dub and then build.
[11:56:14]    <tarzeau> i've not taken any binaries, just the sources
[11:56:21]    <tarzeau> but will try as well...
[11:56:28]    <SimonN> ah, hm, then should work. But try anyway.
[11:57:17]    <tarzeau> all black... maybe it doesn't find data files?
[11:58:02]    <tarzeau> oh user/log.txt says
[11:58:06]    <SimonN> in dub.json, in "libs": [ ... ], between these square brackets, add this line including quotes and comma: "allegro_color",
[...]
[11:59:17]    <tarzeau> added and rebuilding...
[12:12:51]    <tarzeau> i can't find ~/.dub on macOS but i removed .dub
[12:13:06]    <SimonN> okay, hmm, I'm sure it'll be fine
[12:13:15]    <SimonN> did the rebuild do any good?
[12:15:33]    <tarzeau> but the icon appears when starting it
[12:15:36]    <tarzeau> in the dock
[12:15:43]    <tarzeau> black screen as always
[12:16:35]    <SimonN> okay. Remove `"allegro_color",` again, then `brew install dmd`, then build Lix with `--compiler=dmd`
[12:21:45]    <tarzeau> building...
[12:22:42]    <tarzeau> it also builds fine, however same black window
[12:22:54]    <tarzeau> i run ./bin/lix from the source unpacked tree
[12:23:13]    <tarzeau> however esc just exits, no segfaults
[...]
[12:56:37]    <SimonN> tarzeau: download the music: http://www.lixgame.com/dow/lix-music.zip -- extract in Lix's directory, then run the game again. Does music play during the black screen?
[13:02:25]    <tarzeau> back, i already have the music there
[13:02:31]    <tarzeau> let me make louder
[13:02:49]    <tarzeau> yep music plays
[13:06:41]    <SimonN> okay, hmmm, this is tricky then. Lix runs but doesn't display anything.
[13:08:02]    <tarzeau> ack
[13:08:06]    <tarzeau> do you use opengl?
[13:08:45]    <SimonN> Not directly. Via Allegro 5.
[13:09:43]    <SimonN> Okay, I have one abstruse idea.
[13:10:12]    <SimonN> Downgrade DAllegro5 bindings and add allegro_color back. I will instruct you how to do this.
[13:10:35]    <tarzeau> k
[13:11:51]    <SimonN> dub.json, line 13: Replace with: "allegro": "==4.0.3",
[13:12:28]    <SimonN> in line 21 or so, add new line: "allegro_color",
[13:12:40]    <SimonN> (all these times, the trailing commas are important)
[13:13:03]    <tarzeau> done
[13:13:14]    <SimonN> in dub.selection.json, replace line 4 with: "allegro": "4.0.3+5.2.0",
[13:13:34]    <tarzeau> done
[13:13:34]    <SimonN> then run: dub build --force --compiler=dmd
[13:13:47]    <tarzeau> running
[13:14:20]    <tarzeau> built, runs the same
[13:14:33]    <tarzeau> and it's the same windowed or fullscreen
[13:14:37]    <SimonN> i.e., black screen, music plays, and no image? hmm.
[13:14:42]    <tarzeau> yes
[13:14:46]    <SimonN> Okay, then I'm out of ideas :)
[13:15:22]    <tarzeau> https://www.google.ch/search?q=allegro5+macos+black+screen&oq=allegro5+macos+black+screen&aqs=chrome..69i57.5323j0j7&client=ubuntu&sourceid=chrome&ie=UTF-8
[13:15:23]    <SimonN> I didn't believe this would have helped anyway, but I would have slapped myself had it been the solution and had I not tried it.
[...]
[13:16:34]    <tarzeau> https://wiki.allegro.cc/index.php?title=Allegro_5_Tutorial/Displays ?
[13:16:49]    <tarzeau> al_flip_display(); needed?
[13:17:06]    <SimonN> yes, should be needed.
[13:17:07]    <tarzeau> i remember macOS (well cocoa) has different coordinate system
[13:17:25]    <SimonN> Allegro is an abstaction over any OS-specific stuff.
[13:17:48]    <SimonN> maybe run that example code and see if you get window
[13:17:51]    <tarzeau> https://github.com/liballeg/allegro5/issues/546
[13:18:00]    <tarzeau> single buffer?
[13:18:11]    <tarzeau> i don't know either. if you want me to retry, tell me
[13:18:47]    <tarzeau> this gh issue produces black display, works windows + linux
[13:20:10]    <SimonN> okay, no time. I think I double-buffer. My code is in src/hardware/display.d, public interface to that module is ALLEGRO_DISPLAY* display to get backbuffer to draw there, then void flip_display()

Offline Simon

  • Administrator
  • Posts: 2658
    • View Profile
    • Lix
Re: Black screen in macOS build
« Reply #1 on: April 07, 2019, 06:48:05 pm »
Thanks for the good summary!

We had 2 people (tarzeau and MartinDelille) failing on Mac via homebrew, both in 2019, both in the same way: Build succeeds, Lix window opens, music plays (if it's downloaded), no graphics are shown.

Pressing Esc (for tarzeau) terminates the program properly. For Martin, Lix gobbles resources, then segfaults. For Martin, I merely assume that it's on a Mac; Martin didn't write about system in github issue 381.

We had spacetag succeeding in early 2018 via homebrew. But definitely spacetag built an older Lix with an older D toolchain.

Debugging ideas: I want to make a minimal D/Allegro example for Martin that shows some colored screens, then terminates. If that fails, then C/Allegro.

-- Simon
« Last Edit: April 07, 2019, 07:07:32 pm by Simon »

Offline Forestidia86

  • Posts: 504
    • View Profile
Re: Black screen in macOS build
« Reply #2 on: May 04, 2019, 05:27:11 pm »
This problem transformed to a crash (stop reason = EXC_BAD_ACCESS (code=1, address=0x1e000000000)) after validating the user name on macOS 10.14.4.
The program crashes in src/file/option/screen.d in the function displayTryMode.
The reason for this is not found, yet and quite puzzling.