#exult@irc.freenode.net logs for 2 Nov 2009 (GMT)

Archive Today Yesterday Tomorrow
Exult homepage

[00:14:18] <-- Dominus has left IRC ("Leaving.")
[00:32:03] --> pupnik has joined #exult
[00:46:02] <-- pupnik has left IRC ("leaving")
[00:46:03] <-- Marzo_away has left IRC ("Marzo vanishes suddenly.")
[00:46:18] --> pupnik has joined #exult
[01:21:42] --> Marzo has joined #exult
[01:31:58] --- Marzo is now known as Marzo_away
[03:24:21] <-- Marzo_away has left IRC ("Marzo vanishes suddenly.")
[09:11:39] <-- Guest71118 has left IRC ("not planned disconnect")
[09:12:00] --> RadoS has joined #eXult
[10:16:25] --> Dominus has joined #exult
[10:16:25] --- ChanServ gives channel operator status to Dominus
[10:42:05] <Dominus> now lets see if hacking together a Coremidi audio driver for Exult worked… Fun what you can copy/paste together when you have actually no clue what you are doing… :)
[10:43:10] <Dominus> ok, that clearly didn't work somehow :)
[10:43:13] <Dominus> oh well :)
[10:55:32] <Dominus> I might need some help there some other time...
[12:16:43] <pupnik> copypaste coding is an adventure
[12:17:20] <Dominus> :)
[12:20:44] <Dominus> if anyone has an idea why that is not initialising… coreaudiomididriver.h http://pastebin.com/f62d245c6 and the cpp http://pastebin.com/m1f9f64a6
[12:21:14] <Dominus> to make it easier at first, I thought it would be enough to just alter the existing file.
[12:21:28] <Dominus> it's loosely based on the scummvm driver...
[12:21:58] <Dominus> probably it is not initialising because of countless errors I made :)
[12:25:24] <-- Colourless has left IRC ("casts improved invisibility")
[13:02:39] <pupnik> mm
[13:05:06] <pupnik> on n810 here- will look but takes time
[13:07:37] <wjp> doesn't pentagram already have a CoreAudioMidiDriver?
[13:09:19] <pupnik> exult here
[13:09:39] <wjp> I know
[13:09:54] <wjp> but pentagram and exult share their midi driver architecture
[13:10:15] <pupnik> aha wjp with key info Dominus
[13:10:54] <wjp> not info, question :-)
[13:16:39] <-- ettin has left IRC (Read error: 104 (Connection reset by peer))
[13:26:58] <-- Kirben has left IRC (Read error: 110 (Connection timed out))
[14:54:26] --> Marzo has joined #exult
[15:04:30] --- Marzo is now known as Marzo_away
[15:23:13] --> ettin has joined #exult
[16:56:03] <-- Lord_Nightmare has left IRC (Remote closed the connection)
[17:14:35] --> Lord_Nightmare has joined #exult
[18:08:45] <Dominus> wjp: I wasn't very clear earlier. We do have CoreAudio drivers which is good for normal midi. I tried to implement CoreMidi drivers
[18:09:01] <Dominus> which are needed for proper real MT32 support
[18:09:19] <wjp> aha
[18:09:53] <Dominus> the CoreAudio drivers of Exult do have a hackish support for Midi hardware but that doesn't support sysex messages, e.g. it crashes exult when MT32 is set
[18:10:12] <Dominus> only with fakemt32 does it work but it doesn't sound right
[18:11:15] <Dominus> with the hackish stuff I tried today I was just changing the coreaudio files so that I don'T make even more mistakes when I try to implement a new driver
[18:12:06] <wjp> transplanting the contents of scummvm's driver into pentagram/exult's _should_ pretty much work :-)
[18:12:46] <Dominus> that was my feeling as well, since much of it looked very similar
[18:13:36] <wjp> what did it do?
[18:14:18] <Dominus> it compiled but doesn't initialise, meaning that exult defaults to the fmopl instead
[18:14:56] <Dominus> and in the in game audio setup I can't choose coreaudio anymore
[18:15:16] <wjp> hm
[18:16:39] <Dominus> so I've probably made a mess of it...
[18:16:54] <wjp> so you got something like "Trying config specified Midi driver: `...' Failed!" ?
[18:16:57] --- Marzo_away is now known as Marzo
[18:17:44] <Marzo> The pastebin links in the log are accurate?
[18:18:06] <Dominus> it doesn't even give me a failed, but "Trying: FMOpl
[18:18:24] <Dominus> Marzo: yes, that was the alst batch I was trying it with
[18:18:35] <wjp> but it does say Trying Coresomething first?
[18:18:55] <Dominus> no it doesn't
[18:19:31] <Dominus> exult may not be as forthcoming with its messages atm...
[18:21:52] <Dominus> it wasn't build with debug enabled, I'm not sure if that would help
[18:22:00] <Marzo> I think I see the problem
[18:22:31] <Marzo> Comparing the CoreAudioMidiDriver.h with the one in pastebin, a couple things jump out:
[18:23:08] <Dominus> yeah there is a lot different since I went with what was written in the scummvm cpp
[18:23:12] <Marzo> In the original, using MacOSX defines USE_CORE_AUDIO_MIDI in that header file
[18:23:31] <wjp> ah, that would do it
[18:23:36] <Marzo> Without this, MidiDriver.cpp does not add the driver to the list
[18:23:52] <Dominus> oh, I see
[18:24:04] <Dominus> I'll try that now
[18:24:05] <Marzo> If you just paste that, however, it won't do: that file requires a few things missing in the pastebin file
[18:24:33] <Marzo> (a few static members from the CoreAudioMidiDriver class)
[18:24:42] <Dominus> hmm
[18:25:03] <Marzo> There are other interface members that could cause issues if missing
[18:25:39] <Dominus> that maybe why I left it out… the coremidi drivers of scummvm and dosbox just need the #include <CoreMIDI/CoreMIDI.h> and not the coreaudio includes
[18:26:33] * Marzo wonders if it would be better to just copy the DOSBox/ScummVM drivers
[18:27:16] <Marzo> (the entire audio code, I mean)
[18:27:16] <wjp> isn't that what we're doing right now? :-)
[18:27:21] <wjp> oh, why?
[18:28:12] <Marzo> Well, as pointed out, a simple copy isn't enough; there has to be a lot of changes so that it actually works
[18:28:37] <Marzo> But that is just me going all-out for the possibility of being lazy in the future
[18:28:43] <Marzo> Don't pay much attention to that
[18:28:48] <Marzo> :-)
[18:29:31] <Marzo> Dominus: at minimum, you will need to do this:
[18:29:42] <Marzo> Change the name of sysEx to send_sysex;
[18:30:00] <Marzo> Copy the functions increaseThreadPriority and yield (these *might* not be needed, though);
[18:30:33] <Marzo> (and the first may require more changes than it is worth; need to check)
[18:31:23] <Marzo> The two static members of the class (including the lines 36-37 of CoreAudioMidiDriver.cpp);
[18:34:15] <wjp> CoreAudioMidiDriver.h can probably stay almost entirely the same as in SVN
[18:34:27] <Marzo> Aye, I was just thinking that
[18:34:35] <wjp> it might just need removal of the AudioUnit things and maybe some includes
[18:36:02] <wjp> and then in the .cpp take your current file, and add increaseThreadPriority and yield back from the SVN version, and rename sysEx to send_sysex (like Marzo mentioned)
[18:36:16] <Dominus> k, will do now
[18:37:22] <Marzo> I have noticed an intriguing thing: in CoreAudioMidiDriver::open, the "new" file uses what the svn file lists as being 'ENABLE_HACKISH_NATIVE_MIDI_SUPPORT'
[18:37:34] <wjp> hm, "scummvm_output_port". I think maybe this copying might have happened before :-)
[18:39:30] <Dominus> marzo: the enable_hackisch… does not work properly, that's what I wrote about not much earlier...
[18:39:42] <Dominus> wjp: it was the same coder :)
[18:39:55] <Marzo> I am noticing a few slight differences between the Exult and ScummVM code
[18:41:40] <Marzo> A theory: the support in Exult was 'hackish', copied to ScummVM then fixed, but never backported
[18:42:29] <Dominus> the theory is probably not to far off, exchange exult and pentagram and you have probably hit it :)
[18:42:47] <Marzo> Ah, it is from Pentagram?
[18:43:18] <Dominus> or more likely, it (CoreAudio) started with exult, done properly in scummvm, ported to pentagram
[18:43:42] <Dominus> in the meantime, coremidi was done properly on scummvm and never got ported to exult/pentagram
[18:44:46] <Dominus> and pentagram doesn't really need it since its midi is "just" GeneralMidi and hooking up midi hw would not make it better
[18:45:37] <Dominus> pentagram's audio code was ported into exult by colourless some time ago, hence the pent_include.h :)
[18:46:49] <Dominus> ok, with these changes exult still doesn'T want the coreaudio driver :(
[18:48:28] <Dominus> #define USE_CORE_AUDIO_MIDI messes things up, I get some problems in compiling coreaudiomididriver.cpp then
[18:48:53] <Marzo> That is because it wasn't compiling before
[18:49:07] <wjp> you need that #define
[18:49:27] <Dominus> ok, I understand, let's se what I've done now :)
[18:49:33] <Marzo> Show us the error logs for the compile and we will help
[18:50:08] <Dominus> http://pastebin.com/d3419a05f
[18:51:51] <Marzo> Some of these are ScummVM error codes
[18:53:08] <Marzo> I think it would be best to convert to the Exult codes instead of using the ScummVM ones, though
[18:53:41] <wjp> send_sysEx should be send_sysex
[18:54:04] <wjp> and 'byte' (line 127) should be changed to 'uint8'
[18:55:57] <Marzo> Sorry, had to pick up the phone
[18:56:14] <Marzo> An example: in ScummVM, MERR_ALREADY_OPEN = 4; but the value used in Exult is 1
[18:57:25] <Marzo> The other 2 MERR_??? don't have an uniquely defined value in Exult (they aren't there)
[18:57:46] <Marzo> Wait a moment while I check if there is any harm in using the ScummVM values
[18:58:07] <Dominus> comparing the svn cpp to this, I'd guess the merr_cannot_connect would be 0
[18:59:20] <Dominus> er, probably not, don't know I made this assumption...
[19:02:02] <Marzo> Well, it seems that it will cause no harm if you use the ScummVM values
[19:02:28] <Marzo> They are here: http://sourceforge.net/apps/trac/scummvm/browser/scummvm/trunk/sound/mididrv.h?rev=35180
[19:03:43] <Marzo> (you can simply copy the enum to the CoreAudioMidiDriver.h file; though in the long run, we might want to consider doing something similar for the other drivers in Exult)
[19:05:23] <Dominus> ok, what about line 80 and 81?
[19:05:36] <Marzo> Those are just warnings
[19:06:20] <Marzo> Line 114 must be converted to use perr
[19:06:54] <Dominus> how to do that?
[19:09:07] <Marzo> First, add "#include <iomanip>" and "using namespace std;", in two separate lines, at around line 26
[19:09:29] <Marzo> Then, replace the old line 114 by:
[19:09:30] <Marzo> perr << "CoreMIDI driver encountered unsupported status byte: 0x" << hex << setw(2) << status_byte << endl;
[19:10:03] <wjp> don't we have perr.printf?
[19:10:15] <Marzo> Together with what wjp said, that should wipe out the other errors
[19:10:19] <Marzo> Do we?
[19:10:34] <wjp> i.e., just replace warning(...) by perr.printf(...)
[19:10:50] <Marzo> No: in pent_include.h, perr is #define'd as std::cerr
[19:11:16] <wjp> hm, only for pout, then?
[19:11:33] <Marzo> It is #define'd as std::cout
[19:11:39] <wjp> hm
[19:11:52] <Marzo> We do have POUT and PERR macros, but they are not the same thing
[19:12:09] <Marzo> (maybe Exult and Pentagram are more out-of-synch than you remember :-p)
[19:12:21] <wjp> probably :-)
[19:12:34] <Dominus> it compiles with that but it crashes when set to mt32
[19:12:36] <Dominus> Precaching Timbres
[19:12:36] <Dominus> exult(52943,0x7fff70d80be0) malloc: *** error for object 0x100662320: pointer being freed was not allocated
[19:12:36] <Dominus> *** set a breakpoint in malloc_error_break to debug
[19:12:36] <Dominus> LLMD: Uploading Custom Timbre `Piano? ` from 2:0 into 2:0
[19:12:36] <Dominus> Abort trap
[19:13:39] <Dominus> The error when using the hackish define in the svn coreaudiomididdriver.cpp had a similar error, I think
[19:14:05] <Marzo> In all likelyhood, the issue is not in the driver, then
[19:14:51] <Marzo> Hm
[19:15:24] <Dominus> but at least the mt32 output sounds much better with this driver and conversion set to fakemt32
[19:16:01] <Dominus> meaning the mt32 output sounds very similar to the oggs
[19:17:02] <Marzo> A couple questions: Are you using GCC? Do you have GDB?
[19:17:12] <Dominus> yes to both
[19:17:28] <Marzo> Can you compile with GDB debugging information?
[19:18:10] <Marzo> You can pass --enable-heavy-gdb-debug to ./configure, along with anything else you usually pass
[19:18:21] <Dominus> can do that
[19:18:53] <Marzo> It will make a much bigger and slower binary, but this shouldn't be an issue
[19:19:20] <Marzo> Hrm
[19:19:24] <Dominus> compiling now
[19:20:06] <Marzo> I am sorry only that I won't be here to help again until tomorrow... (I will be going out soon)
[19:20:30] <Dominus> no problem there is no hurry...
[19:20:45] <Marzo> And I can't guarantee being available here for at least 20 hours starting now
[19:21:14] <Dominus> have fun (if it is something to have fun)
[19:21:28] <Marzo> It is indeed
[19:21:34] <Dominus> :)
[19:22:08] <Marzo> (at least, the part about it today; tomorrow, I will be attending the funeral of the father of a close friend)
[19:22:41] <Dominus> ugh, funerals...
[19:24:14] --> Fingolfin has joined #exult
[19:24:14] --- ChanServ gives channel operator status to Fingolfin
[19:25:26] <Marzo> Also, I have confirmed that Core Audio started in Pentagram, was ported to Exult, then to ScummVM, then fixed to the current state
[19:26:46] <Marzo> (at least, that is the story told by the respective svn trunks)
[19:27:17] <Marzo> Well, at any rate, I am off
[19:27:19] <Marzo> Farewell
[19:27:22] <Dominus> thanks
[19:27:28] <Dominus> and see you tomorrow
[19:27:44] <Marzo> (though you can probably poke Fingolfin for some help, now that he is here)
[19:28:02] <Dominus> will do :)
[19:28:23] <-- Marzo has left IRC ("Marzo vanishes suddenly.")
[19:31:25] <Fingolfin> hm=
[19:31:26] <Fingolfin> ?
[19:31:49] <Dominus> Fingolfin: with much help from marzo and wjp I mucked around with scummvm's coremidi code. and now it is somewhat working, only it crashes when in exult conversion is set to mt32 conversion...
[19:33:29] <Dominus> and on a related note and maybe of interest to you, scummvm svn (yesterday) compiles and runs fine on os x 10.6.1 now
[19:49:51] <Fingolfin> oh yes? that's surprising. we didn't change anything regarding the use of Carbon in the gui browser code
[19:54:18] <Dominus> I just checked the browsing and that works fine, too
[19:58:06] <Dominus> hmm, now I remember… sorry, browser.h was still the one we "hacked" some time ago to make it compile
[21:38:17] <Dominus> I cleaned the coremidi driver up a bit and made it its own driver in Exult. The current code is http://pastebin.com/m22f83cc6 CoreMidiDriver.h; http://pastebin.com/m758da8c8 CoreMidiDriver.cpp
[21:40:53] <-- jvlee has left IRC (Read error: 104 (Connection reset by peer))
[21:46:30] <-- Dominus has left IRC ("Leaving.")
[22:08:07] --> Colourless has joined #Exult
[22:08:07] --- ChanServ gives channel operator status to Colourless
[22:19:20] <-- Fingolfin has left IRC ()
[22:46:05] --> Kirben has joined #exult
[22:46:05] --- ChanServ gives channel operator status to Kirben