New Hypseus and lr-Daphne to add on Retropie-Setup
-
@g30ff said in New Hypseus and lr-Daphne to add on Retropie-Setup:
FYI. Something else I noticed, most of the HD versions of the games have some strange things happening with audio. Some of them at the very start, the music speeds up for a short while, as if the video ran ahead and the audio is quickly trying to catch up with it. The video plays at normal speed when this happens.
Singe 2 has an audio bug.
Try playing any of the MP4 files from a Singe 2 game in VLC. You will see that video and audio are completely out of sync by approx 9-10 video frames (0.333s on a 29.97 FPS game, more on 24FPS titles.). This 'out-of-sync' is put deliberately in the MP4 by the game devs to work-a-round the bug.
The speedup you hear is Hypseus correcting that sync, the audio bug obviously doesn't exist in Hypseus. The ffmpeg recode tries to correct it but not completely. It is more obvious on the HD games for reasons I can only put down to more CPU cycles being used on the HD video. Haven't been able to completely track it down why you hear it more on some than others. On my desktop it's usually only a blip for a ms or so, so if on the Pi if it is more notable, it could well be down to CPU cycles.
It only happens on startup of the game (VLDP init) then plays fine throughout gameplay. It is sometimes more obvious on one startup than another.
If anyone can figure out an ffmpeg command to get the audio more accurately out of the MP4 I would be grateful....
I did consider reducing the volume on the ogg for the first few seconds and fading in on the VLDP init sequence (game boot up, the time you cannot input any key commands), but decided against it. But that is one solution if it really bugs you:
http://underpop.online.fr/f/ffmpeg/help/afade.htm.gz
Some of the MP4 are a real mess and ffmpeg just complains madly about corrupt timing frames, maddog-hd in particular throws out many warnings. The Singe 2 game devs found various ways to work-a-round the bug initially, so earlier games have more problematic MP4's.
I have to work with what I have :)
-
@dirtbagxon That makes sense. This is my first time trying to use Singe games, so I was unaware of a lot of these details regarding how the games/engine work. Thank you again for taking the time to explain these things! It's very much appreciated!
-
@g30ff said in New Hypseus and lr-Daphne to add on Retropie-Setup:
@dirtbagxon That makes sense. This is my first time trying to use Singe games, so I was unaware of a lot of these details regarding how the games/engine work. Thank you again for taking the time to explain these things! It's very much appreciated!
I think I have a better solution.
There are a couple of intros I would rather not hear in any case, as are overbearingly loud. This post gave me an idea.
In the next release there will be a new argument for Singe called '-bootsilent`.
This will attempt to mute the sound during the VLDP boot process, it covers this issue nicely. It's also then configurable per game.
The next release will have the following changelog.
- Allow a 32bit Pi OS to fseeko64() in files over 2Gb in size. FILE_OFFSET_BITS=64 is ignored in fseek() on the Pi!!
This will become important as some of the new releases will have extended video and require larger m2v files.
See below (dltv is 4hrs in length). - Add the -bootsilent option to alleviate the audio correction heard in certain Singe 2 game ports, or disable for the hell of it.
This is game code dependant: Works on all except "Gun Games", which use an antiquated LUA code base. - Upgrade the Daphne VLDP from 16bit to 32bit - and remove the 65535 video frame limit that has always been present in Daphne.
This enables me to port all the outstanding Singe 2 games that were previously over this frame limit:You will need to grab the new version from source in RetroPie-Setup (v2.8.0).
- Allow a 32bit Pi OS to fseeko64() in files over 2Gb in size. FILE_OFFSET_BITS=64 is ignored in fseek() on the Pi!!
-
Hi, thanks for making this an easy Retro-Pie install... however.. I have no idea what I am doing and I can't seem to get any of this working.
I've had Daphne running for years and upgraded many of my videos to the latest HD's on the emuline forum. I have all the usual Daphne games running, except Badlands. So I'm fluent in working with Daphne.
I started with the instructions on https://github.com/DirtBagXon/hypseus-singe/blob/master/src/3rdparty/retropie/RETROPIE.md
...and what looks like a simple adding a simple file "xxx.singe" but where do these files come from?
So I pulled down Dragon's Lair II from the above location and it has a ton of additional folders in it. What do I need? I copied over the DL2e.mp4, created a new framefile and pointed it at DL2e.mp4 at mark 0. Then I added in the DL2e.singe file. Selected Singe as my emulator to run it, dumps back to menu.
I then just copied over the DLE2.singe file to my original lair2 folder, and renamed it lair2.singe, it fails back to menu. However I switch back to Daphne, it works fine.
Not sure what I'm doing wrong here... but this is my runcommand.log and it says it can't compile a
Singe script?Thanks for your help, and of course, all the hard work you've done to get all of this working. I know it's something I'm doing wrong, I just don't know what it is.
JamR
-
@jamrom2 said in New Hypseus and lr-Daphne to add on Retropie-Setup:
I've had Daphne running for years and upgraded many of my videos to the latest HD's on the emuline forum. I have all the usual Daphne games running, except Badlands. So I'm fluent in working with Daphne.
That's a good start and the hardest part over :)
Thanks for your help, and of course, all the hard work you've done to get all of this working. I know it's something I'm doing wrong, I just don't know what it is.
So if you are not familiar with Singe games, there are currently two generations of the games: Original Singe (1) and Singe 2. Singe games are simulation in LUA, not emulation via ROM, like Daphne. They are fan created and easily editable.
Original Singe games were contained in a sub-folder of Daphne conveniently called
singe
* and ran as a plugin to Daphne (alongside the originalvldp
andvldp_dl
game data folders you will recall from the original Daphne).Daphne used MPEG-2 and OGG (video
.m2v
and audio.ogg
) containers. Hypseus is an extension of this original engine and therefore adopts this structure and video/audio format, by default, to maintain Daphne compatibility.Singe 2 is a complete rewrite of the Singe engine, uses a different video container (
MP4
) and adopted a different folder structure. It also does not contain the Daphne emulation engine.Therefore you cannot directly use Singe 2 MP4 in Hypseus (you can use the new folder structure but let's not get off topic). So we flatten out the folder structure, ala Singe 1, and convert video/audio to align with original Singe format in order to work in Hypseus. (See more below )
So, if you have original Singe games you should be able to drop them in as per the instructions here and that's it.
If you want to use Singe 2 games, then you need to convert the MP4 to MPEG-2 and OGG as described in this porting repo (also linked in my signature ).
The 'ffmpeg' tool is simple and fast, so should only take a couple of minutes to convert video on a standard PC. Probably better to encode on a PC (Windows binaries are available ) rather than the Pi, as the Pi will take some time.
Use the repository: https://github.com/DirtBagXon/hypseus_singe_data - [Note: Keep game directory names but add .daphne for RetropIe]
All you need to worry about is the video and audio files, everything else you need is in that repo (it's all fan created material so no copyright issues ). If you know Daphne, you will know what framefiles are, so look there for the structure layout. If you have original Singe games the video and audio are already converted, just drop them in. If you want to bring Singe 2 games over, you either have to find already converted copies of the
.m2v
and.ogg
or use ffmpeg to convert yourself.Although original Singe games will work unaltered, I have added a
00-singe1
folder in the porting repo, this either fixes bugs found in the original games or makes alignment changes that work better in hypseus overlays.The errors you were seeing were due to just dropping an un-ported Singe 2 game into hypseus, i.e. trying to use the MP4 and alternate folder structure. So hopefully a little reading of the porting repo will get you on the right track.
In the latest Hypseus update (which you can grab via RetoPie-Setup source install ) all the Singe 2 games are now possible to be ported over. However, many of these contain high bitrate HD video and the Pi will struggle to render them at reasonable speeds. On these games it may be better to downscale the video at the ffmpeg stage, so a 1920x1080 MP4 recode would be downscaled like this (Halve each axis resolution - These commands also cover the Singe 2 audio bug described a few posts above ):
ffmpeg -i TRON.mp4 -vf tpad=stop_mode=clone:stop_duration=2,scale=960:540 -an -qscale:v 4 -c:v mpeg2video tron.m2v ffmpeg -i TRON.mp4 -ss 00:00:00.33 -vn -c:a libvorbis -ar 44100 -map a -b:a 160k tron.ogg
*(Informational blurb, ignore this paragraph if you like: Thesinge
folder is actually still required (as it is hardcoded in the LUA ) but hypseus contains apath rewrite
argument that means you will not see it, or need it, in the documentation for RetroPie. A description of what happens is here if anyone is really interested.) -
This is very helpful and really cleared it up for me. I understand now the difference between all the version and what I was doing wrong.
I can see the files in the Singe games, pretty easy... but what about roms that make them work? How do I get ES to see the game in my list, then of course how does it run without a rom?
For example, I want to run Platoon. Framefile, Vid and OGG's are in \roms\daphne\platoon.daphne with a sub-folder of platoon.singe inside of that.
So how does ES see this game?
Thanks again!
-
@jamrom2 said in New Hypseus and lr-Daphne to add on Retropie-Setup:
I can see the files in the Singe games, pretty easy... but what about roms that make them work? How do I get ES to see the game in my list, then of course how does it run without a rom?
Singe (unlike Daphne) is a simulator, not an emulator. The ROM data in this sense is the LUA game code in the
.singe
filesFor example, I want to run Platoon. Framefile, Vid and OGG's are in \roms\daphne\platoon.daphne with a sub-folder of platoon.singe inside of that.
No sub-folder should be there. All files should be in
\roms\daphne\platoon.daphne
- There should be no sub-folders within that.daphne
folder. One exception to this is that some of the old Singe 1 games had acdrom
ordvd
sub-folder that contained the.m2v
and.ogg
files. But the Singe 2 ports (including Platoon) have none.As the docs describe:
roms |-- daphne | | | |-- timegal.daphne | | | | | |-- timegal.commands (Optional) | | |-- timegal.txt | | |-- timegal.m2v | | |-- timegal.ogg | | |-- timegal.singe | | |-- *.* | | | +-- roms |
So how does ES see this game?
If the
<game>.daphne
folder exists and a<game>.singe
within the root of that folder, then the LUA within that.singe
file will boot the game.ES triggers off the
.daphne
folder extension as a game listing. Just reload ES (or reboot) after placing the folder there.BTW: I wouldn't recommend
platoon
as your introduction to the world of Singe. It was only ever a 'protoytype' game and is quite rough around the edges..... -
Ok, I see it now. I have to remember ALL names must match.
So I tried it with Freedom Fighter and Cliff Hanger. What I'm going to have to do is pull-down a new Cliff Hanger video set because my current framefile is set to use CH_640x480_24p as the main video. Your's has it broken down to sections (intro1...etc). So my game is a mess. But that's not a big deal. I can see the icons, and the "insert coin"... all looks great!
Now I understand all this, and I'm going to switch over my games to your Hypseus standard. It's much better with all the correct overlays and such.
Thanks!
One more question... I did this because I saw that Tron game. Is that one considered Singe 1 or Singe 2? I really want that one, I'm a huge fan of that Movie!
-
@jamrom2 said in New Hypseus and lr-Daphne to add on Retropie-Setup:
One more question... I did this because I saw that Tron game. Is that one considered Singe 1 or Singe 2? I really want that one, I'm a huge fan of that Movie!
Yes you basically only need to ensure that the video is the required one for the framefile and timing events. These are fan made games, so there can be multiple versions just to make life easy. Hence the FRAMEFILE.md I put in each game folder.
'Tron' is very definitely a Singe 2 game (it's also one of the extended games only playable in the latest version of Hypseus 2.8.0 ), so you will need to acquire the MP4 and run the recode on that one. Or find an archive that is already converted. Remember my note about the HD video on the Pi above.
Again, once you have the
.m2v
and.ogg
files you just need the peripheral files from the porting repo: https://github.com/DirtBagXon/hypseus_singe_data/tree/master/tronGrabbing the Release zip file, or cloning the repo, will be easier than trying to download files individually
Also just released is the full extended version of TitanAE, the previous version was missing scenes due to the length of the video.
-
With Hypseus, does it help the speed of the death scenes in Dragon's Lair. That was always an annoyance to me. I remember them being a lot longer like when he get squeezed by the snake, or eaten, falls.. whatever.
Daphne always seemed very fast to me when it came to that.
So far, everything is working good on Freedom Fighter. I'll start looking for the rest of the videos and such. Is there a cross-over for every Daphne game or only a selected few?
I've never heard of Titan AE. Looks like another Don Bluth game. Pretty nice looking to say the least.
-
@jamrom2 said in New Hypseus and lr-Daphne to add on Retropie-Setup:
With Hypseus, does it help the speed of the death scenes in Dragon's Lair. That was always an annoyance to me. I remember them being a lot longer like when he get squeezed by the snake, or eaten, falls.. whatever.
Daphne always seemed very fast to me when it came to that.
Hypseus "Daphne" is Daphne code, there should be little difference.
Is there a cross-over for every Daphne game or only a selected few?
In Singe ? There are some "Daphne" games in Singe.
But remember these are 'simulated' and therefore not as authenticate as the emulation Daphne does from the arcade ROM.
I don't tend to port games that have Daphne emulation for this reason.
dl2e is an exception: http://www.dragons-lair-project.com/tech/enhancements/dl2e.asp
There is no emulation for this version in Daphne, so the Singe game is ported.
Singe Cliffhanger also has extended scenes.
I've never heard of Titan AE. Looks like another Don Bluth game. Pretty nice looking to say the least.
It is Don Bluth.
-
Hi. So I have everything running now, I see what you mean and now understand the idea behind the addition of Singe 1 to Daphne. It's very good.
The only thing I have not found is where you pulled your cliff hanger vids from. I've searched just about every spot I know and have not seen them as "scenes", only as 1 .m2v file. *** Nevermind... 3 hours after I wrote this... I found your spot. LOl. ***
I tried to use my own framefile, but it doesn't work. Is there a chance to have this use the HD video, and not Singe 2, I mean the ones Karis did. The quality is great.
I see what you mean about the Pi3b+ and 4k videos... it just doens't do well. So I keep them all in the 720p range. It's fine. I like the old school look of a little blur in them anyway.
Thanks for the help,
JamR
-
@jamrom2 said in New Hypseus and lr-Daphne to add on Retropie-Setup:
With Hypseus, does it help the speed of the death scenes in Dragon's Lair. That was always an annoyance to me. I remember them being a lot longer like when he get squeezed by the snake, or eaten, falls.. whatever.
Daphne always seemed very fast to me when it came to that.
I think this is memory fog here on the speed of the death scenes, the video is taken direct from the laserdisc at the same FPS, the scene is dictated by a set of frames (which come from the ROM), and displayed at the same FPS.
I would be very surprised if Matt didn't correct anything weird like that in this game.
I think peoples memories get a little foggy on these games, it's like the 'opening bridge scene' that so many people definitely remember from the original game - but actually it wasn't really there until later (home) release, or dle, versions...
Thanks for the help
Glad to help.
-
@dirtbagxon LOL!... I like the way you explain it.. and you're probably right! At 52, I'm guessing what I used to see 40 years ago when I first played it in the Arcades is definitely distorted by fog... as is everything else. LOL.
I agree on the bridge scene. I once argued with a fan on the Daphne form that it did not exist in the arcade game, he was adamant that it did...
-
I installed everything I wanted from my "list" and a few extras. The version of Cliff Hanger you used is fantastic, but it's too much for my Pi3B+. How did you create the framefile and is there one that uses a lesser video scale but still uses the Singe side as well?
I already have an M2v that uses only Daphne that runs fine in 4:3 720p. I just need Singe to run the framefile, but it doesn't. Is there a way I can?
Thanks.
-
@jamrom2 said in New Hypseus and lr-Daphne to add on Retropie-Setup:
I installed everything I wanted from my "list" and a few extras. The version of Cliff Hanger you used is fantastic, but it's too much for my Pi3B+. How did you create the framefile and is there one that uses a lesser video scale but still uses the Singe side as well?
The best approach would be to downscale the existing 1080p Singe video with
ffmpeg
ffmpeg -i cliff.m2v -an -qscale:v 4 -b:v 6000k -vf scale=1280:720 -codec:v mpeg2video 720_cliff.m2v
As your re-encoding there will be a slight loss of quality, but probably nothing you will realise due to to downsize in resolution in any case.
We keep the bittate high with-qscale:v 4
- See ffmpeg docs.You can check the frames are equal, on each, after the recode with
mediainfo
mediainfo --Inform='Video;%FrameCount%' cliff.m2v 36780 mediainfo --Inform='Video;%FrameCount%' 720_cliff.m2v 36780
See my Singe 2 porting repo for links on how to get these tools.
Each game incarnation has a different frame layout, so you can't really use a video from one game in another version without rewriting all the game frame reference code in the LUA. This is one inherent issue with Singe (which will have fan changes and tweaks), unlike Daphne where the ROM frame references will always be the same. It's better to keep the video with the LUA code. You then just have to deal with the means to distribute it like that, and the inherent consequences.
Provided you have a decent quality source, down-scaling the video shouldn't be an issue. So having the 1080p will always allow you to get the games running on lower spec hardware, with a little work. Singe overlays are written to work with source video resolution, but hypseus will try to align on the new resolution. Some games have options to move sprites around in the Service menu (9 in-game ).
Others, you may need to make minor alignment changes in the LUA (text editing - main.singe - spriteDraw(x,y,sprite[LIVES]) ).
This is Daphne, but see my Dragon's Lair on a Pi Zero (first Gen), using downscaled video, in the forum here.
-
I finished up the video conversions, and it looks great... but the audio is still way off. Lagging behind a few seconds.
Is there a way to build new OGG files based on the new M2V files? I've tried a few on line converters, but that was fruitless.
The video is very impressive though. Much better than what I had before.
-
@jamrom2 said in New Hypseus and lr-Daphne to add on Retropie-Setup:
I finished up the video conversions, and it looks great... but the audio is still way off. Lagging behind a few seconds.
Is there a way to build new OGG files based on the new M2V files? I've tried a few on line converters, but that was fruitless.
The audio shouldn't need recoding, as the recode of video should not have changed anything timing related.
You can play with the start audio timing with
-ss
as detailed here in the porting repo. Daphne, and therefore Hypseus, are very specific about the frequency of.ogg
files (see discussion), so you need to use specific arguments passed to ffmpeg.There is normally only two reasons for this sync issue I have seen:
- Resource exhaustion
- FPS mistimings
As you have downsized the video, it shouldn't be using too much CPU to cause exhaustion... You can check by running
top
in an ssh session when the game is running.Can you see anything in the logs when this occurs ?
cat /dev/shm/runcommand.log
Maybe also share the
mediainfo
output for the current.m2v
and.ogg
files.sudo apt-get install mediainfo
mediainfo cliff.m2v
andmediainfo cliff.ogg
on the relevant files.I do think that some of these Singe 2 HD titles are pushing the limits of the 32bit OS on the Pi <= RPi3
I tried the recode on video (as above ) on my RPi3b and am not seeing the issue, although performance on the Pi4 running full aarch64 from raspberrypi.org is significantly better.
You could test if the Pi is the cause of the issue by grabbing the Windows version of Hypseus and running the same game files. It will eliminate the recoding as the cause.
-
@dirtbagxon I'm actually using the videos that are broken down into sections by level.
I can try the Singe 2.0 set as well now that you taught me to how it's done. In fact I will just to see what the difference is.
At any rate...
Here is the runcommand.log
https://pastebin.com/kEJJXrKuAnd, unfortunately, a screen shot of the mediainfo. I'm just not that good with Linux to do the black box thing you guys always do.
Hopefully there is something in these files you see, because everything looks like it should. The sound is good, it's just not synched with the video. And again.. the video is fantastic, even condensed to 720p.
-
@jamrom2 said in New Hypseus and lr-Daphne to add on Retropie-Setup:
@dirtbagxon I'm actually using the videos that are broken down into sections by level.
Ok, so this the the original Singe 1 release.
And, unfortunately, a screen shot of the mediainfo. I'm just not that good with Linux to do the black box thing you guys always do.
Just paste text using the
</>
tags above ;)The image is perfectly readable. Also it doesn't show any issues at you state.
Hmmm.. it does appear that some of these games are gonna be problematic on the Pi.
I don't believe that there has ever been a widely adopted version of Singe (1) on Linux previously (at least several people have told me this). Most of the early Singe 1 games created by a guy known as RDG (worked with Scott Duensing who wrote Singe) used SD video (720x480 in nearly all cases ) back in 2009-10. All of these work perfectly on the Pi.
Then around 2019 a group of guys tackled new games (we know their names) but these were pretty much all designed to work on Windows Daphne Singe (as this was the most widely adopted platform, but used bitrot SDL1 ). Resources are not really much a consideration on games like these in Windows. This re-interest is what started the Singe 2 application, which gets a whole lot more resource intensive especially with the full 32bit overlays (Singe 1, and Hypseus, use simple 8bit overlays and are vastly lightweight in comparison, alongside looking more Retro IMHO ).
I'm not using excuses here, honest, but I think what is starting to become clear is that these later HD (2019), and Singe 2, games have MPEG-2 video that pushes the Pi limits.
Hypseus comes with an optimised version of the libmpeg2 library which works on (x86) Linux, Windows and Mac. But not on the Pi (ARM), we have to use the ARM optimised packaged version of the library from Raspberry Pi OS: https://raspbian.mirror.ac.za/raspbian/pool/main/m/mpeg2dec/
Even this ARM libmpeg2 package (On Pi's up to 3b+ ) didn't use mmal or v4l/v4l2 for GPU hardware acceleration. MPEG-2 decoding through hardware is no longer available as of the Pi4, so all MPEG-2 decoding, on all Pi's, is done on the CPU: https://forums.raspberrypi.com/viewtopic.php?p=1947760#p1947760
I have had reports now that (Singe) Cliff and Asterix games seem particularly troublesome on the Pi. 64bit Pi4 included. I cannot see why these titles in particular are more problematic, video encoding looks identical to others via mediainfo. Even when downscaled with ffmpeg they still appear to have issues, which seems like it is possibly some frame timing/encoding issue. If anyone has more insight on this, I would be grateful. I am no expert here, but it does appear to be platform specific.....maybe.....
At least we have the Daphne version of 'cliff' to cover one of these problematic games. (The Daphne version is available in a true 4k version in Hypseus, which will definitely only work on x86 - see screenshot here ).
The current Pi implementations still use an early SDL2 version, this may also be an issue. SDL2 1.0.16 suddenly bought the Windows version of Hypseus to life, with no other changes or optimisations. So I am hopeful we may see improvements when the Pi OS's default SDL2 version catches, or surpasses, this.
This still, of course, leaves all the Daphne games and 30+ Singe games that should run fine on the current generation of Pi's.
Hopefully there is something in these files you see, because everything looks like it should. The sound is good, it's just not synced with the video. And again.. the video is fantastic, even condensed to 720p.
I am not certain I have a solution on singe 'cliff' as per above.... sorry..... maybe the next generation of Pi will bump this comment.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.