DirtBagXon / hypseus-singe

Hypseus is a SDL2 version of Daphne and Singe. Laserdisc game emulation.
https://discord.gg/dgCsCfmRfJ
GNU General Public License v3.0
143 stars 19 forks source link

(Daphne games) Not working in RetroPie #8

Closed mgiugliano closed 3 years ago

mgiugliano commented 3 years ago

The software scoreboard is the only things appearing on screen. After a couple of minutes, it says:
"Player 1: 2 Player 2: 15P2"

/dev/shm/runcommand.log says

Parameters:
Executing: SDL1_VIDEODRIVER=dispmanx SDL_DISPMANX_WIDTH=3840 SDL_DISPMANX_HEIGHT=2160 /opt/retropie/emulators/daphne/daphne.sh "/home/pi/RetroPie/roms/daphne/lair.daphne"
[version] Hypseus Singe: v2.6.0-RPi
[console] Setting alternate home dir: /opt/retropie/emulators/daphne
2021-07-10 20:19:34.594 INFO  [6305] [reset_logfile@321] Version v2.6.0-RPi
2021-07-10 20:19:34.595 INFO  [6305] [reset_logfile@325] Command line: /opt/retropie/emulators/daphne/daphne.bin lair vldp -nohwaccel -framefile /home/pi/RetroPie/roms/daphne/lair.daphne/lair.txt -homedir /opt/retropie/emulators/daphne -fullscreen
2021-07-10 20:19:34.595 INFO  [6305] [reset_logfile@326] CPU : UnknownCPU || Mem : 7872 megs
2021-07-10 20:19:34.595 INFO  [6305] [reset_logfile@327] OS : Linux 5.4 || Video : Unknown video
2021-07-10 20:19:34.595 INFO  [6305] [reset_logfile@328] RGB2YUV Function: C
2021-07-10 20:19:34.595 INFO  [6305] [reset_logfile@334] Line Blending Function: C
2021-07-10 20:19:34.595 INFO  [6305] [reset_logfile@341] Audio Mixing Function: C
2021-07-10 20:19:35.030 INFO  [6305] [game::load_compressed_rom@882] Loading compressed ROM image dl_f2_u1.bin ... 8192 bytes read.
2021-07-10 20:19:35.031 INFO  [6305] [game::load_compressed_rom@882] Loading compressed ROM image dl_f2_u2.bin ... 8192 bytes read.
2021-07-10 20:19:35.031 INFO  [6305] [game::load_compressed_rom@882] Loading compressed ROM image dl_f2_u3.bin ... 8192 bytes read.
2021-07-10 20:19:35.031 INFO  [6305] [game::load_compressed_rom@882] Loading compressed ROM image dl_f2_u4.bin ... 8192 bytes read.
2021-07-10 20:19:37.543 INFO  [6305] [ldp_vldp::read_frame_conversions@1038] Framefile parse succeeded. Video/Audio directory is: /home/pi/RetroPie/roms/daphne/lair.daphne/./
DirtBagXon commented 3 years ago

Try removing -nohwaccel from the daphne start script:

/opt/retropie/emulators/daphne/daphne.sh

You really want to be using hardware acceleration on the Pi with Hypseus.

Alternately, you can replace the default startup script with the script from this repo. This will remove that argument and also add support for Singe games:

cp /opt/retropie/emulators/daphne/daphne.sh /opt/retropie/emulators/daphne/daphne.sh.orig
cp src/3rdparty/retropie/daphne.sh /opt/retropie/emulators/daphne/daphne.sh
mgiugliano commented 3 years ago

@DirtBagXon Thank you for your time and for the hypseus-singe project.

I should mention that daphne games (ace, lair, lair2) work fine with "vanilla" Daphne on the RetroPie system.

Following (both) your suggestions did not help:

Summarising: 1) with the -nohwaccel option, everything is frozen and no video/audio is played 2) without that option, frame rate is 2 Hz, audio is out of sync, with playback running freely

In both cases, I have to "kill PID" the process to regain control of the retro pie box.

I would be happy to make other tests to help debugging the problem. My (final) objective will be running the 4k version of the games, which is not what I am trying now.

Thank you for your time.

DirtBagXon commented 3 years ago

(minor) on screen rendering of the score board appears substantially blurred and not bitmapped/sharp.

Add -nolinear_scale to the daphne.sh arguments.

(knowing the game(s) by heart, I am sure the) video sequences are played one after the other w/o any control

No changes to original Daphne gameplay have been made, only presentation. So not certain what differences you are seeing here. Although this can obviously depend on the ROM version being used and -bank switches.

interrupts from pressing the controls are ignored

Unfortunately neither daphne or hypseus use the libretro core controls. So you have to setup your controls within the specific configuration file. dapinput.ini for the old implementation and hypinput.ini for Hypseus. NOTE, Daphne is SDL1 and Hypseus SDL2 so keycodes are not compatible, so you cannot copy the config over. See details in:

https://github.com/DirtBagXon/hypseus-singe/blob/master/doc/hypinput.ini

audio starts playing but video lags behind (at a rate of 2-3 frame/s)

I have not been able to recreate this, but there are several elements including RetroPie, SDL2, aarch64 versions that can have some effect here. I am no RetroPie expert, but many users have been using Hypseus without issues. I guess heading over to the RetroPie forums with library and RetroPie version details would be a starting point... This is a SDL2 implementation so is significantly different in display library calls to the old Daphne version.

Edit: I note you are using some SDL1 environment variables in the call in the first post:

SDL1_VIDEODRIVER=dispmanx SDL_DISPMANX_WIDTH=3840 SDL_DISPMANX_HEIGHT=2160

dispmanx is not supported in SDL2.

DirtBagXon commented 3 years ago

I have pushed a patch to the RetroPie branch that now mimics the legacy (default) Daphne joystick controls in hypinput.ini

Hopefully that will make the transition from the legacy package to Hypseus a little less jarring...

Grab it direct from here: https://github.com/DirtBagXon/hypseus-singe/blob/RetroPie/doc/hypinput.ini

mgiugliano commented 3 years ago

@DirtBagXon I have just compiled and installed hypseus on my Mac: it works fine, including with ace, lair video files in 4k. This suggests that my roms and (normal as well as 4k) video files are OK.

On the Raspberry 4 (8GB), retropie, the native 'Daphne' works (not with the 4k files), while hypseus does not at all. Video frame rate is ~2Hz, while the audio keeps playing. After few tens of second, the video freezes, while the audio keeps going.

This is the output of hypseus:

Parameters:
Executing: SDL1_VIDEODRIVER=dispmanx SDL_DISPMANX_WIDTH=3840 SDL_DISPMANX_HEIGHT=2160 /opt/retropie/emulators/daphne/daphne.sh "/home/pi/RetroPie/roms/daphne/ace.daphne"
[version] Hypseus Singe: v2.6.4
[console] Setting alternate home dir: /opt/retropie/emulators/daphne
2021-07-24 19:11:02.673 INFO  [4638] [reset_logfile@322] Version v2.6.4
2021-07-24 19:11:02.673 INFO  [4638] [reset_logfile@326] Command line: /opt/retropie/emulators/daphne/daphne.bin ace vldp -framefile /home/pi/RetroPie/roms/daphne/ace.daphne/ace.txt -homedir /opt/retropie/emulators/daphne -fullscreen
2021-07-24 19:11:02.673 INFO  [4638] [reset_logfile@327] CPU : UnknownCPU || Mem : 7872 megs
2021-07-24 19:11:02.673 INFO  [4638] [reset_logfile@328] OS : Linux 5.4 || Video : Unknown video
2021-07-24 19:11:02.674 INFO  [4638] [reset_logfile@329] RGB2YUV Function: C
2021-07-24 19:11:02.674 INFO  [4638] [reset_logfile@335] Line Blending Function: C
2021-07-24 19:11:02.674 INFO  [4638] [reset_logfile@342] Audio Mixing Function: C
2021-07-24 19:11:03.123 INFO  [4638] [game::load_compressed_rom@905] Loading compressed ROM image sa_a3_u1.bin ... 8192 bytes read.
2021-07-24 19:11:03.123 INFO  [4638] [game::load_compressed_rom@905] Loading compressed ROM image sa_a3_u2.bin ... 8192 bytes read.
2021-07-24 19:11:03.124 INFO  [4638] [game::load_compressed_rom@905] Loading compressed ROM image sa_a3_u3.bin ... 8192 bytes read.
2021-07-24 19:11:03.124 INFO  [4638] [game::load_compressed_rom@905] Loading compressed ROM image sa_a3_u4.bin ... 8192 bytes read.
2021-07-24 19:11:03.124 INFO  [4638] [game::load_compressed_rom@905] Loading compressed ROM image sa_a3_u5.bin ... 8192 bytes read.
2021-07-24 19:11:05.146 INFO  [4638] [ldp_vldp::read_frame_conversions@1038] Framefile parse succeeded. Video/Audio directory is: /home/pi/RetroPie/roms/daphne/ace.daphne/./
ALSA lib pcm.c:8424:(snd_pcm_recover) underrun occurred
DirtBagXon commented 3 years ago

Good news on the Mac build :)

I believe you still need to address the DISPMANX parameters for SDL1.

You are specifying a massive resolution of 3840 x 2160 on a RPI. I think you are being a little hopeful to get this resolution - the general consensus is 720p. 1080p has been claimed by certain users on the forum.

Remember these Daphne files are MPEG-2 (m2v) encoded, not H264 (mp4).

"Pi0-3 have hardware accelerated decode for H264, MPEG4, H263, and through optional codec licences for MPEG2 and VC1. Pi4 has the same hardware accelerated decode for H264, but not the other codecs."

https://www.raspberrypi.org/forums/viewtopic.php?t=268356

I am not sure where these dispmanx parameters are coming from, but you need to try without setting them in the environment variables.

You can then start increasing the resolution with the -x and -y parameters in ace.commands file.

Many people are running Hypseus on RetroPie, so I think this issue is implementation specific.

Always worth asking the guys on the RetroPie forums.

vanfanel commented 3 years ago

@mgiugliano

Please DO NOT use the DispmanX backend on the Raspberry Pi. All Raspberry Pi models support the standard KMS/DRM graphics years ago. So build a recent libSDL version configured with --enable-kmsdrm-video.

I did the dispmanx backend for SDL1.x years ago. It is now long deprecated and should NOT be used on either SDL1.x or SDL2. Go KMSDRM, forget DispmanX, save your time for efforts that really make sense or simply for fun :)

DirtBagXon commented 3 years ago

@mgiugliano

Any progress on the issue in resolving the DISPMANX parameters ?

DirtBagXon commented 3 years ago

Closing this issue, as no further responses.

'hypseus' can now be installed without DISPMANX parameters via the RetroPie-Setup, currently in a pull request:

https://retropie.org.uk/forum/post/265501