Author Topic: MAME Plugin Progress Thread  (Read 74651 times)

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
MAME Plugin Progress Thread
« on: December 10, 2007, 07:47:59 am »
I am starting this thread to detail my progress with the MAME Plugin/Player pair that I am coding for LinuxMCE (and perhaps PlutoHome too).

I have made the first bits of necessary database changes in order to make the File list and UpdateMedia daemon start to index and list the files inside the games/ directory in the LinuxMCE structure.

I currently have to manually set attributes for now, but it does index the filename as title currently, and I am able to add pictures, and it does display on a file list on all of my orbiters.

I have assigned a MediaType of 8 (because it was available...) I hope I haven't trampled on anyone's toes for this. I will need to figure out how to use sql2cpp effectively to get the proper media ID (because I know under sqlcvs the PK_ fields will most likely change, I can't assume that they will be constant!).

There is no plugin/player combination yet, so while the new games scenario, file list, and single file/attribute views work properly, it doesn't do anything after that except say, "I have no devices in this entertainment area capable of playing this file!", and the DCERouter file currently gives the message:

Code: [Select]

08      12/10/07 1:20:00.560            Received Message from 80 (Windows XP PC/tablet (Horiz) / Bedroom (Master) #1) to 10 (Media Plug-in / Bedroom (Master) #1), type 1 id 43 Command:MH Play Media, retry none, parameters: <0x727a8b90>
08      12/10/07 1:20:00.560              Parameter 2(PK_Device): 0 <0x727a8b90>
08      12/10/07 1:20:00.560              Parameter 13(Filename): !F50880 <0x727a8b90>
08      12/10/07 1:20:00.560              Parameter 29(PK_MediaType): 0 <0x727a8b90>
08      12/10/07 1:20:00.560              Parameter 44(PK_DeviceTemplate): 0 <0x727a8b90>
08      12/10/07 1:20:00.560              Parameter 45(PK_EntertainArea): 1 <0x727a8b90>
08      12/10/07 1:20:00.560              Parameter 116(Resume): 0 <0x727a8b90>
08      12/10/07 1:20:00.560              Parameter 117(Repeat): 0 <0x727a8b90>
05      12/10/07 1:20:00.561            Play media type 8 in entertain area 1 but nothing to handle it <0x917e6b90>
01      12/10/07 1:20:00.561            Couldn't find any media handlers for type 8 <0x917e6b90>


so, at least the messages are being routed...

I need to finish putting together a stable dev environment now, so I can work on the plugin/player pairs.

I do figure out from the DCERouter logs, that I will need the Plugin AND the Player... the DCE router sends messages to the Plugin first, to determine how to route things... I suspected this, but I would like more information as to why it is separated in this manner...the source code is a little bit foggy in this area, and I am using Xine_Player/Plugin as a reference.... Does anyone know what is going on?

But for now, I am pasting the following screenshots:

http://www.localeconcept.com/pub/scratch/games/media_scenarios.png
http://www.localeconcept.com/pub/scratch/games/file_list.png
http://www.localeconcept.com/pub/scratch/games/single_game.png

more later!  ;D ;D ;D ;D ;D

-Thom

Zaerc

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 2256
  • Department of Redundancy Department.
    • View Profile
Re: MAME Plugin Progress Thread
« Reply #1 on: December 10, 2007, 01:27:38 pm »
The screenshots look awesome, glad to see you making some good progress on this.  I wish I could be of some assistence, but you're obviously way ahead of me.
"Change is inevitable. Progress is optional."
-- Anonymous


Matthew

  • Douchebag
  • Addicted
  • *
  • Posts: 567
    • View Profile
Re: MAME Plugin Progress Thread
« Reply #2 on: December 10, 2007, 05:02:25 pm »
Very exciting. Not just for MAME players, but as an example of an entire architectural expansion. Personally, the only games I'm interested in are the ones that run under the atari800 emulator (I was an Atari geek in the early 1980s). Do you think you could explain how to add a different emulator, for others to follow your lead?

In fact, it would be very useful for developers to see just how you got to the point where you are now. Like setting up a dev env, tools/techniques for finding where the target code resides before you start editing it, tools/techniques for (eg.) finding an unused media type, etc. Maybe you could add a section->page to the Developers Guide wiki entry? That would help me (or someone else) add atari800, and then the next media type, like maybe documents or just arbitrary applications.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: MAME Plugin Progress Thread
« Reply #3 on: December 10, 2007, 05:22:43 pm »
Very exciting. Not just for MAME players, but as an example of an entire architectural expansion. Personally, the only games I'm interested in are the ones that run under the atari800 emulator (I was an Atari geek in the early 1980s). Do you think you could explain how to add a different emulator, for others to follow your lead?

In fact, it would be very useful for developers to see just how you got to the point where you are now. Like setting up a dev env, tools/techniques for finding where the target code resides before you start editing it, tools/techniques for (eg.) finding an unused media type, etc. Maybe you could add a section->page to the Developers Guide wiki entry? That would help me (or someone else) add atari800, and then the next media type, like maybe documents or just arbitrary applications.

I am an old Atari800 hacker from the 1980s, myself.. still am (looking at my Ben Heckendorn Atari 800 Laptop).

As for doing a generalised emulation framework.... I can't say at this point how possible that will be.

Ideally I want to use a Game Plugin, which forwards messages to individual Game Players, keying off file extensions to do so. This however, may not be possible without looking very awkward for one reason, the parts of the code that determine menu items for a given player are defined IN the Plugin, not the Player (because the Plugin is part of the DCE router's address space), this is a limitation of C++, and would require some sort of IDL type system if we needed to do dynamic introspection of the emulator capabilities.

As it is right now, I am building for ONE emulator type per plugin pair, currently this is MAME, so that I can see where the issues are. It is important that this not be a half-baked integration project, so it's not as simple as just hanging an emulator executable off the system somewhere. I intend to implement ALL of the media plugin features, (follow me, state saving for moving an instance to another MD, etc.).

I will know more once I get my dev environment stabilized. But it is very early in the project.

There are also other scalability issues that this media type will inevitably expose, on a potential system, there will be tens of thousands of ROMs in the file list, before you start applying filters! This will undoubtedly stress test the whole system to find bottlenecks. I've already found some obnoxious ones in the media sync portion of the Web Admin site as a result! (and I've only added my MAME roms!)

More to come soon!

-Thom

Matthew

  • Douchebag
  • Addicted
  • *
  • Posts: 567
    • View Profile
Re: MAME Plugin Progress Thread
« Reply #4 on: December 10, 2007, 06:31:21 pm »
Personally, the only games I'm interested in are the ones that run under the atari800 emulator (I was an Atari geek in the early 1980s).

I am an old Atari800 hacker from the 1980s, myself.. still am (looking at my Ben Heckendorn Atari 800 Laptop).

Let's reimplement DCE as CIO and run it on an 800XL! :)

More seriously, I'd love to see you wiki your dev environment and procedures so the rest of us can get up and running. Hopefully 0710 and a standard dev env will dovetail very soon.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: MAME Plugin Progress Thread
« Reply #5 on: December 15, 2007, 07:10:07 am »
Status update: still trying to get a stable development environment working on my VM. Will let you guys know how things get on. I'm trying to build using the current SVN sources in anticipation for the 0710 release.

-Thom


Matthew

  • Douchebag
  • Addicted
  • *
  • Posts: 567
    • View Profile
Re: MAME Plugin Progress Thread
« Reply #6 on: December 15, 2007, 07:36:14 am »
Status update: still trying to get a stable development environment working on my VM. Will let you guys know how things get on. I'm trying to build using the current SVN sources in anticipation for the 0710 release.

Is the current version of 0710 that developers are working on the one that's in SVN? I'd love to see a HowTo for building it locally and trying to run it (as well as debugging a few issues that Mantis says haven't been touched in a while).

totallymaxed

  • LinuxMCE God
  • ****
  • Posts: 4660
  • Smart Home Consulting
    • View Profile
    • Dianemo - at home with technology
Re: MAME Plugin Progress Thread
« Reply #7 on: December 15, 2007, 10:40:11 am »
Status update: still trying to get a stable development environment working on my VM. Will let you guys know how things get on. I'm trying to build using the current SVN sources in anticipation for the 0710 release.

Is the current version of 0710 that developers are working on the one that's in SVN? I'd love to see a HowTo for building it locally and trying to run it (as well as debugging a few issues that Mantis says haven't been touched in a while).

Well it looks to me that the latest checkins at http://svn.charonmedia.org/ are from 2-3 days ago. Some of our work on vdr seems to be there (some have not been committed yet as we are working through some issues related to Myth & vdr coexisting happily without Myth breaking). So overall things are pretty much up to date - i think. But I can't be sure how complete the current version is or what happens to revisions made in the public SVN when the same files are next synced from the non-public SVN and have in intervening time been updated there too.

May be DanielK can comment on this?
Andy Herron,
CHT Ltd

For Dianemo/LinuxMCE consulting advice;
@herron on Twitter, totallymaxed+inquiries@gmail.com via email or PM me here.

Get Dianemo-Rpi2 ARM Licenses http://forum.linuxmce.org/index.php?topic=14026.0

Get RaspSqueeze-CEC or Raspbmc-CEC for Dianemo/LinuxMCE: http://wp.me/P4KgIc-5P

Facebook: https://www.facebook.com/pages/Dianemo-Home-Automation/226019387454465

http://www.dianemo.co.uk

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: MAME Plugin Progress Thread
« Reply #8 on: December 15, 2007, 06:13:06 pm »
well, the overall problem is, once I build from those sources and install the packages, things break horribly, and I wind up with a system that simply refuses to function.

is there a procedure I'm missing?

*hmm*

I just want a build environment so I can work on a fucking plugin pair. AWAY FROM MY PRODUCTION Core and MD.

-Thom


tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: MAME Plugin Progress Thread
« Reply #9 on: December 16, 2007, 10:02:01 am »
Okay, I've got a stable dev environment working now, and was able to build and launch both a plugin and player combination into my dev vm

I've also done much of the necessary database work to implement the file list, updatemedia etc work....

and I understand how the plugin and player pairs interact.....

but i seem to be missing one link, how does the system know to talk with the DCE router plugin? right now it says
"I can't play this media type for this entertainment area" and the DCErouter log confirms this

however, I _know_ there is a database table I'm  missing, probably in pluto_main, which maps what media types go to which entertainment areas etc... totallymaxed: what am I missing?

-Thom



Matthew

  • Douchebag
  • Addicted
  • *
  • Posts: 567
    • View Profile
Re: MAME Plugin Progress Thread
« Reply #10 on: December 16, 2007, 05:35:18 pm »
Okay, I've got a stable dev environment working now, and was able to build and launch both a plugin and player combination into my dev vm

I've also done much of the necessary database work to implement the file list, updatemedia etc work....

and I understand how the plugin and player pairs interact.....

but i seem to be missing one link, how does the system know to talk with the DCE router plugin? right now it says
"I can't play this media type for this entertainment area" and the DCErouter log confirms this

however, I _know_ there is a database table I'm  missing, probably in pluto_main, which maps what media types go to which entertainment areas etc... totallymaxed: what am I missing?

Would you post a HowTo for getting the dev env up, and the SVN sources down into it, built, and tested? Maybe a walkthru of the net summary of this "Building a dev environment for 0704?" topic and the threads linked from it.

Can you grep the sources for the "I can't play this media type for this entertainment area" string, post the file in which it's defined, and I'll try to figure out in the source where is the "missing link" and how to fix it.
« Last Edit: December 16, 2007, 05:39:27 pm by Matthew »

darrenmason

  • Addicted
  • *
  • Posts: 529
    • View Profile
Re: MAME Plugin Progress Thread
« Reply #11 on: December 16, 2007, 10:41:44 pm »

but i seem to be missing one link, how does the system know to talk with the DCE router plugin? right now it says
"I can't play this media type for this entertainment area" and the DCErouter log confirms this

however, I _know_ there is a database table I'm  missing, probably in pluto_main, which maps what media types go to which entertainment areas etc... totallymaxed: what am I missing?

Thom,

There is a routine somewhere called getDeviceForEntertainmentArea or something like that. I remember looking at it, at one stage and it might take a bit of tracing but it should lead you to the tables. If you havn't found anything and I get a chance tonight I will have a bit of a browse and see if I can help (that will be at least 12 hours from this post though)

Regards
Darren

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: MAME Plugin Progress Thread
« Reply #12 on: December 17, 2007, 05:45:05 am »
been at it all night, still in the same place.

frustrated.

 ???

 :-[


tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: MAME Plugin Progress Thread
« Reply #13 on: December 17, 2007, 07:35:32 am »
pasted rant about code in this thread. I may have to abort this plugin.

http://forum.linuxmce.org/index.php?topic=3489.0

-Thom

Matthew

  • Douchebag
  • Addicted
  • *
  • Posts: 567
    • View Profile
Re: MAME Plugin Progress Thread
« Reply #14 on: December 17, 2007, 07:49:47 am »
pasted rant about code in this thread. I may have to abort this plugin.

http://forum.linuxmce.org/index.php?topic=3489.0

Y'know, of all the different languages that all the world's programmers know, the one we all use in common is foul language ;).