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

RCA Video Problems #155

Closed
mutant763 opened this issue Apr 14, 2013 · 21 comments
Closed

RCA Video Problems #155

mutant763 opened this issue Apr 14, 2013 · 21 comments

Comments

@mutant763
Copy link

I'm having an issue with the component video on the PI. Its the 512, rev 2 board. Basically through rca video it will fully load emulationstation and I can move through the rom selection perfectly fine, however when I select a rom I will completely lose the video signal. Even stranger is that with snes roms I can hear the sound of the game playing when the video disappears, megadrive/genesis roms refuse to load at all and normally when selected the screen will go black for a moment, revert to the rom selection and soon the thing will crash completely.

I am able to run everything perfectly using HDMI with absolutely no issues but I can for the life of me figure out what is happening with the rca video.

Any ideas would be much appreciated, thanks :-).

@petrockblog
Copy link
Member

Recently, I have added function for changing the HDMI resolution when starting RetroArch-based systems. You can alter this behavior by changing the line

COMMAND=$rootdir/supplementary/runcommand/runcommand.sh 1 "retroarch -...

to

COMMAND=$rootdir/supplementary/runcommand/runcommand.sh 2 "retroarch -...

The problem is that some emulators do not work well (if at all) when using the RCA output.

Maybe there should be some sort of option in the setup script, to choose configurations for HDMI or RCA output. What do you think?

@ghost
Copy link

ghost commented Apr 16, 2013

Have experienced the exact same thing (RCA output). MAME worked OK, NES didn't (whereas it did before). Changing that 1 into a 2 for retroarch systems seems to solve it. Option would be a good thing.

@Aloshi
Copy link

Aloshi commented Apr 16, 2013

Similar thing with the Doom core on EmulationStation issue 65.

@mutant763
Copy link
Author

@petrockblog Thanks so much buddy, made this change and the snes roms now work perfectly, very much appreciated. Is there an similar option to this for the megadrive/genesis emulator that you know of?

Either way, thank you very much, :-).

@petrockblog
Copy link
Member

Glad to hear!

I do not know a reliable solution for DGEN or Osmose. Maybe someone else?

@CalZing
Copy link

CalZing commented Apr 19, 2013

I've had exactly the same issues with dgen. I installed the dispmanx SDL backend

https://github.com/vanfanel/SDL12-kms-dispmanx

which solved the problem and increased performance. Too bad you need to manually patch emulationstation in order to make it work. (It's really not emulationstations fault)

@Aloshi
Copy link

Aloshi commented Apr 19, 2013

I'd be happy to try and fix EmulationStation to work with the SDL dispmanx backend, but I'm not sure if it's possible to make one binary work both with and without it. The only thing I need SDL for is input (and timing), but that requires opening an SDL window. Perhaps I should contact the author.

@CalZing
Copy link

CalZing commented Apr 19, 2013

I was able to make it work in both cases by removing the SDL_Quit(); call in src/Renderer_init_rpi.cpp, line 182 as pointed out by others. However keyboard and mouse doesn't work after exiting Emulationstation by doing so. I solved this by placing a call to SDL_Quit() in main.cpp just before the return statement (line 227). I don't have experience with SDL, but I guess this is not a good way to do it since you probably want a clean state (aka not having SDL stuff running/initialized) when starting the emulator. This solution works good for me and I haven't had any problems so far. It seems almost impossible to make dgen play nice with composite output when using the stock SDL lib in raspbian

@petrockblog
Copy link
Member

Does dispmax interfere with RetroArch or other SDL-based emulators?

@CalZing
Copy link

CalZing commented Apr 19, 2013

Not that I know of yet. I'm currently using it with retroarch and dgen. I haven't configured up more systems yet, but I'll know pretty soon as I'm configuring my system up with osmose, vice and fce ultra

@Aloshi
Copy link

Aloshi commented Apr 19, 2013

Just had a quick peek at the dispmanx SDL backend source code. I think you'll run into a bug where everything breaks after playing about 6 games due to the dispmanx video init calling "bcm_host_init()" every time ES returns. A simple fix is to just not have ES deinitialize SDL...but that has worrisome potential consequences.

@kalehrl
Copy link

kalehrl commented Apr 19, 2013

Emulationstation doesn't work when dispmanx SDL libraries are installed.
CalZing mentioned a fix which I also used but had some serious problems with my keyboard.
If I remember correctly, keyboard would stop working after exiting a game and returning to emulationstation frontend.
Now I use export LD_LIBRARY_PATH="/home/pi/RetroPie-Setup/SDL12-kms-dispmanx/build/.libs" before starting emulator. I didn't run sudo make install because that would replace default SDL libs.
A command for dgen looks like this:
COMMAND=export LD_LIBRARY_PATH="/home/pi/RetroPie-Setup/SDL12-kms-dispmanx/build/.libs"; ~/Games/RetroPie/emulators/dgen/dgen %ROM%

@CalZing
Copy link

CalZing commented Apr 19, 2013

kalehri: you're right that the keyboard stops working if you do exactly that one fix, but if you read my post again I wrote you also have to add a SQL_Quit() call (which no one else has suggested that I know of) in emulationstation:s main.cpp in order to make it shutdown properly and release the keyboard.
Also note that I don't do any changes at all in the dispmanx backend source. I've read some people uncommenting the exit call in dispmanx but that just caused me problems.

Aloshi: I've played around quite alot and have not managed to crash my setup after launching different games and emulators from emulationstation 20+ times. I think that most emulators calls (they should do it at least) SDL_Quit() when exiting. That would make it less bad that emulationstation does bcm_init() when switching back. I could be wrong with this, but main point is I'm not having any issues and it's working =). Yes it's an ugly fix ;)

@CalZing
Copy link

CalZing commented Apr 19, 2013

And thanks for the LD_LIBRARY_PATH suggestion! Worked like a charm. I don't like to overwrite the SDL Libraries either...

@petrockblog
Copy link
Member

Could someone point me to a guide that explains how to compile the dispmanx lib? I would try and add the LD_LIBRARY_PATH-solution that @kalehrl has pointed to.

@CalZing
Copy link

CalZing commented Apr 20, 2013

I was able to compile it by first running the MAC_ConfigureDISPMANX.sh script and then doing make. I fetched the repo at https://github.com/vanfanel/SDL12-kms-dispmanx

by configuring dgen to use 320x240 or 320x224 resolutions without fullscreen, you get a real nice performance boost from dispmanx use of hardware scaling. I was able to acheive full speed in all sonic games by doing this combined with "Medium" overclocking settings. I guess this would apply to any emulator using SDL (Setting low resolution and let dispmanx scale it up)

@ruadrim
Copy link

ruadrim commented Apr 20, 2013

Osmose works on composite, as long as you connect a joystick. Funny, that :)

I can confirm that changing the '1' to '2' in the .emulationstation/es_systems.cfg file solves most issues with composite video out.

@kalehrl
Copy link

kalehrl commented Apr 20, 2013

@petrockblog
You may need to use:
export CFLAGS="-I/opt/vc/include/interface/vmcs_host/linux"
before compiling is it complains about missing vchost_config.h.
Also, if I remember correctly, I had to run autogen.sh before MAC_ConfigureDISPMANX.sh.

@jon-tk-chan
Copy link

@petrockblog was running into the exact same problem (losing video output for RCA). was wondering where do you change that line from 1 to 2? I'm new to the Pi and wasn't sure where to look for the file to make the changes.

@Aloshi
Copy link

Aloshi commented May 1, 2013

Should be in ~/.emulationstation/es_systems.cfg.

@petrockblog
Copy link
Member

Issue #161 basically has the same topic. I close this issue and would expect any further comments be made in the issue #161 thread.

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

7 participants