scottferg / Fergulator

NES emulator, written in Go
Other
614 stars 44 forks source link

No available video device #5

Closed zhuangya closed 11 years ago

zhuangya commented 11 years ago

i've already passed go test, and when i load a nes:

./Fergulator ~/Downloads/super_mario.nes
-----------------
ROM:
  PRG-ROM banks: 2
  CHR-ROM banks: 1
  Mirroring: Vertical
  Mapper: 0x0 -> NROM
2013/04/17 01:23:14 No available video device

btw, my OS: Mac OS X 10.8.3, brew doctor also passed.

scottferg commented 11 years ago

Do you have XQuartz installed? On Apr 16, 2013 12:25 PM, "Zhuang Ya" notifications@github.com wrote:

i've already passed go test, and when i load a nes:

./Fergulator ~/Downloads/super_mario.nes

ROM: PRG-ROM banks: 2 CHR-ROM banks: 1 Mirroring: Vertical Mapper: 0x0 -> NROM 2013/04/17 01:23:14 No available video device

btw, my OS: Mac OS X 10.8.3, brew doctor also passed.

— Reply to this email directly or view it on GitHubhttps://github.com/scottferg/Fergulator/issues/5 .

zhuangya commented 11 years ago

I just installed XQuzrtz, restart the machine, still no.. :(

./Fergulator  ~/Downloads/cjmlazwb.nes                                                                                                                                    1 ↵
-----------------
ROM:
  PRG-ROM banks: 2
  CHR-ROM banks: 1
  Mirroring: Vertical
  Mapper: 0x0 -> NROM
2013/04/17 12:13:18 No available video device
scottferg commented 11 years ago

When you ran go get you set the proper path for pkgconfig?

This is an issue I've come across before. It's just a matter of making sure you told go get where to find SDL.

zhuangya commented 11 years ago

@scottferg hmm... that's strange.

i just follow your instruction to install, and here is some output related:

check this gist

is there anything wrong?

pusewicz commented 11 years ago

I'm having exactly the same issue.

ghost commented 11 years ago

This issue is open here, too btw https://github.com/0xe2-0x9a-0x9b/Go-SDL/issues/16

KTamas commented 11 years ago

Same here.

scottferg commented 11 years ago

So I used to experience this issue frequently and it was always a case of go get looking in the seemingly wrong place. Two things that I've done that got around it:

  1. I installed SDL manually from source (http://www.libsdl.org/release/SDL-1.2.15.tar.gz) and pointed PKG_CONFIG_PATH to that
  2. Installed from brew as the README suggests and pointed the PKG_CONFIG_PATH there

Currently on my OSX machine, which I've been using the past few months as the primary devbox for this project, I don't have or need any PKG_CONFIG_PATH set when I run go get, even from a clean build where I've zapped the pkg/ and relevant src/ dirs from my GOPATH. I do, however, remember go getting SDL and friends manually once, and setting PKG_CONFIG_PATH to the relevant .pc directories setup by brew, and I think that may be the issue you guys are seeing.

Something like: PKG_CONFIG_PATH=/usr/local/Cellar/sdl/1.2.15/lib/pkgconfig go get github.com/scottferg/Go-SDL/sdl

With regards to the bug report @mtrotzinski noted, I have come across that culprit as well but like I said, I've always fixed this particular error by making sure I was building the SDL bindings properly. I do see this problem show up here though: https://github.com/0xe2-0x9a-0x9b/Go-SDL/issues/7

What's weird with that one is that I never see it on Go 1.0.3. When I compile with Go 1.1 I see it intermittently, and simply retrying to run the emulator eventually works alt text

It's entirely possible that the README is just incorrect and I set something up way back when and totally forgot what it was. I'll try on a fresh machine later and see if I can nail down the exact process.

ghost commented 11 years ago

I found a way to fix this issue: edit the brew recipe for sdl ($brew edit sdl) and remove the line that says "args << '--without-x'". After that you can reinstall sdl and everything should work fine!

scottferg commented 11 years ago

Nice find!

ghost commented 11 years ago

i noticed that it compiles with this flag when i reinstalled sdl several times without success. But i am still wondering if it is possible to make Go-SDL use quartz instead of x

scottferg commented 11 years ago

I force the SDL driver to x11 in Go-SDL/sdl/sdl_darwin.go in the event that SDL_VIDEODRIVER isn't set, so that may be a means of doing it.

zhuangya commented 11 years ago

i tried @mtrotzinski 's method, and it works ;)

i'm wondering, should we edit sdl's brew for the " --with-x " parameter.

sugarsync-eisnerguy1 commented 11 years ago

I'm still having this issue

scottferg commented 11 years ago

Did you try the above solution?

scottferg commented 11 years ago

After successfully getting this installed and running on a handful of Macs using @mtrotzinski 's solution, I've added it to the README. Closing this issue.