MAMEWorld >> EmuChat
Previous thread Previous  View all threads Index   Next thread Next   Flat Mode Flat  

Bryan Ischo
MAME Fan
Reged: 03/28/10
Posts: 358
Send PM
Re: Some videos of my frontend in progress
04/27/11 12:39 AM


> > I've been posting for a while now making vague allusions to the frontend that I am
> > working on. Well I've made a few videos showing my progress for anyone who is
> > interested. Keep in mind that it's very rough and very early, but it will give some
> > idea of some of the effects that I am going for.
>
> Since no-one else has responded. I think its cool that you've persisted with this. I
> had the idea of doing something similar (sending the composited video frames over
> IPC) about a decade ago but never got around to it (much like most of the other crazy
> ideas I had: hooking Continental Circus up to me stereoscopic glasses, abstracting
> the force-feedback, implementing the native networking over shmem or possibly
> sockets).
>
> Btw, Glmame / Xmame (Sven Goethel) had a similar visualisation a long time ago (a
> rendered cab with the game running on it), although that was all in the same process.

Yeah I originally had MAME linked into the same process also but that caused some problems:

- MAME has *alot* of very complex code in it and unfortunately, it crashes sometimes. Especially when you are abusing it like I am (starting and stopping games constantly). I also am not convinced that some drivers don't leak memory in some situations, and the shutdown path is not always that robust. The upshot is that when I was running MAME in the same process (separate thread), it was not uncommon for the frontend to crash.

- It is not possible to run multiple copies of MAME at once in the same process because of the globals that MAME uses; running MAME in separate processes solves this nicely.

So what I did was to move MAME out into a separate process, using a shared memory IPC mechanism; I use "no lock" IPC (compare and swap instructions and memory barriers) with rapid polling (every 1/2 millisecond - uses like 0.3% of a CPU) to ensure that the MAME process cannot screw up the frontend (i.e. grabbing a lock and then dying/hanging) under any circumstances. It works so well that I can sit there and fork off copies of MAME all day long and no matter what happens to them, the frontend is undisturbed.

The video and sound frames are pushed through the shared memory segment like you'd expect. I have instrumentation that can measure the latency this introduces and it's generally not perceptible - about 1/4 millisecond on average, just what you'd expect with a 1/2 millisecond polling interval.







Entire thread
Subject Posted by Posted on
* Some videos of my frontend in progress Bryan Ischo 04/26/11 11:35 AM
. * Re: Some videos of my frontend in progress StilettoAdministrator  04/27/11 12:03 AM
. * Re: Some videos of my frontend in progress Bryan Ischo  04/27/11 12:21 AM
. * Re: Some videos of my frontend in progress StevieWunderful  04/26/11 11:35 PM
. * Re: Some videos of my frontend in progress Bryan Ischo  04/27/11 01:27 AM
. * Re: Some videos of my frontend in progress Bryan Ischo  04/27/11 12:32 AM
. * Re: Some videos of my frontend in progress StevieWunderful  04/27/11 01:00 AM
. * Re: Some videos of my frontend in progress Bryan Ischo  04/27/11 01:24 AM
. * Re: Some videos of my frontend in progress Tourniquet  04/26/11 10:50 PM
. * Re: Some videos of my frontend in progress Bryan Ischo  04/27/11 12:39 AM
. * Re: Some videos of my frontend in progress Bryan Ischo  04/26/11 08:38 PM

Extra information Permissions
Moderator:  Robbbert, Tafoid 
0 registered and 14 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 1838