#exult@irc.freenode.net logs for 28 Jan 2013 (GMT)

Archive Today Yesterday Tomorrow
Exult homepage


[00:03:26] <Dominus> needing help with changing the coreaudio driver to be more like scummvm's
[00:03:53] <Dominus> my diff to the very latest exult coreaudio code is http://pastebin.com/60U3XXcP
[00:04:18] <Dominus> scummvm'scoreaudio history is at https://github.com/scummvm/scummvm/commits/master/backends/midi/coreaudio.cpp
[00:05:13] <Dominus> and the file that is closest to my diff is https://github.com/scummvm/scummvm/blob/6ec05c48f937cad59f881484bd0b04f8fcc3fc99/backends/midi/coreaudio.cpp
[00:06:01] <Dominus> (except for the deprecated_attributes stuff in scummvm and the plugin interface)
[00:07:51] <Dominus> I had to go around the RequireNoErr macro in the scummvm code and that is probably the culprit. Anyway, the problem is that exult compiles and on starting the CoreAudio Midi initializes but there is no sound to be heard :(
[04:15:09] <-- Dominus has left IRC (Read error: Connection reset by peer)
[04:15:21] --> Dominus has joined #exult
[04:15:21] --- ChanServ gives channel operator status to Dominus
[04:50:07] <-- Dominus has left IRC (Read error: Connection reset by peer)
[04:50:38] --> Dominus has joined #exult
[04:50:39] --- ChanServ gives channel operator status to Dominus
[04:57:50] <-- Dominus has left IRC (Read error: Connection reset by peer)
[04:57:55] --> DominusExult has joined #exult
[04:57:56] --- ChanServ gives channel operator status to DominusExult
[06:40:00] <-- Kirben has left IRC (Ping timeout: 256 seconds)
[06:47:11] --> Kirben has joined #exult
[06:47:11] --- ChanServ gives channel operator status to Kirben
[09:44:06] <-- DominusExult has left IRC (Read error: Connection reset by peer)
[09:44:11] --> Dominus has joined #exult
[09:44:12] --- ChanServ gives channel operator status to Dominus
[10:17:27] <-- Dominus has left IRC (Read error: Connection reset by peer)
[10:17:58] --> Dominus has joined #exult
[10:17:58] --- ChanServ gives channel operator status to Dominus
[12:19:45] <-- Dominus has left IRC (Read error: Connection reset by peer)
[12:21:15] --> Dominus has joined #exult
[12:21:15] --- ChanServ gives channel operator status to Dominus
[13:35:09] <-- Kirben has left IRC (Ping timeout: 244 seconds)
[14:21:46] <Dominus> wjp, marzo, I really could use your help. This is the code that scummvm uses https://github.com/scummvm/scummvm/blob/9095de46741c9044c2deff8ecfc911903203b6fe/backends/midi/coreaudio.cpp and this is the diff to our coreaudiomididriver. http://pastebin.com/4Zg57X0C (coreaudiomididriver.cpp fully at http://pastebin.com/QMttwskh)
[14:21:57] <Dominus> the problem is that there is no sound
[14:22:40] <Dominus> (for simplicity, I commented the soundfont loading since that needs more work to be the same as scummvm)
[14:22:56] <wjp> you commented out much more than the soundfont, though?
[14:23:13] <wjp> oh, wait, maybe I'm misreading the diff
[14:23:37] <Dominus> the diff is a bit massive since it is using a different backend/framework now
[14:24:07] <Dominus> what is really different is the RequireNoErr macro in scummvm that clashed with the soundfont code
[14:24:27] <Dominus> and I wasn't sure whether I understood correctly
[14:24:54] <wjp> it's an error checking macro
[14:25:17] <wjp> how you adapted it should work but without error checking
[14:25:47] <wjp> which would be useful here I suppose :-)
[14:26:35] <Dominus> hmm, I'll give it a try since I commented the soundfont stuff anyway
[14:27:03] <wjp> it looks like the main thing is the definition of that macro and the 'bail:' label and block
[14:30:31] <Dominus> ok, with the error checking I get an assertion failure at (_auGraph != NULL), function send_sysex,
[14:30:32] <Marzo> Which after Dominus converts I will change to use a try-catch block
[14:30:51] <Marzo> (no need for goto's)
[14:32:07] <wjp> would be good to put an error message in the bail: block too, to see how/where it fails there
[14:32:18] <wjp> or maybe just an assert(err == noErr) in the macro itself
[14:32:40] <wjp> because presumably this means it's failing there somewhere
[14:32:46] <Dominus> http://pastebin.com/v51D897m that's hwo coreaudio..cpp looks like now
[14:33:05] <Dominus> where would I put that?
[14:34:13] <Dominus> (btw, if I remove the assert in send_sysex it assert fails in the send function)
[14:34:55] <wjp> assert(err == noErr); \
[14:34:56] <wjp> after
[14:34:59] <wjp> err = error; \
[14:35:26] <wjp> (don't keep that permanently, though)
[14:35:50] <Dominus> ssertion failed: (err == noErr), function open, file CoreAudioMidiDriver.cpp, line 75.
[14:42:53] <wjp> so that's AUGraphAddNode(_auGraph, &desc, &synthNode); ?
[14:43:26] <Dominus> yes
[14:43:42] <wjp> you have a double componentManufacturer
[14:44:35] <Marzo> The code up to that point exactly matches ScummVM's
[14:44:51] <Dominus> Iyes
[14:45:08] <wjp> I had to look quite a few times to spot this one difference :-)
[14:45:42] <Marzo> Oh, I see it now
[14:45:44] <wjp> but I guess fixing that Type/Subtype/Manufacturer will fix it
[14:45:55] <Dominus> I don't see it
[14:45:58] <Marzo> desc.componentManufacturer = kAudioUnitSubType_DLSSynth;
[14:46:01] <wjp> line 70-72 are wrong
[14:46:14] <wjp> just copy these three literally from scummvm
[14:46:16] <Marzo> Should be desc.componentSubType
[14:46:37] <wjp> (and the _MusicDevice one is wrong too)
[14:46:38] <Dominus> oww
[14:46:47] <Dominus> now I see it
[14:48:15] <Dominus> and here we have sound
[14:48:26] <wjp> nice :-)
[14:48:46] <Dominus> thanks a lot
[14:49:10] <Dominus> I hate those errors. I've been looking and looking and couldn't find the differences
[14:51:02] <Dominus> now I need to check the soundfont code since compiler doesn't like the RequireNoError before the std::string soundfont
[14:53:16] <wjp> I don't quite see how those would conflict
[14:53:34] <wjp> unless maybe when you use the RequireNoError inside the soundfont if due to the duplicate err
[14:54:22] <Dominus> CoreAudioMidiDriver.cpp:87:2: error: goto into protected scope
[14:54:22] <Dominus> RequireNoErr(AUGraphNodeInfo(_auGraph, synthNode, NULL, &_synth));
[14:54:22] <Dominus> ^
[14:54:22] <Dominus> CoreAudioMidiDriver.cpp:33:19: note: expanded from macro 'RequireNoErr'
[14:54:22] <Dominus> if (err != noErr) \
[14:54:22] <Dominus> ^
[14:54:23] <Dominus> CoreAudioMidiDriver.cpp:91:14: note: jump bypasses variable initialization
[14:54:23] <Dominus> std::string soundfont = getConfigSetting("coreaudio_soundfont", "");
[14:54:51] <wjp> ah
[14:55:05] <wjp> just move that line getConfigSetting line up
[14:55:40] <Dominus> but I think it's better to place it in an if (config->key_exists("config/audio/coreaudio_soundfont")) anyway because I don't want ti to show the "load soundfont" if there is no cfg setting for it
[14:57:06] <Dominus> and then it doesn't complain about the RequireNoError
[15:00:07] <Dominus> ok, that works.
[15:02:42] <Dominus> does placing an #if TARGET_CPU_BLABLA work right away or does one need to prepare that?
[15:03:24] <wjp> ?
[15:05:28] <Dominus> I need to do more porting of the scummvm driver https://github.com/scummvm/scummvm/commit/ad1c2a45f12bb5401ae5c0d73ef948dea734c467#backends/midi/coreaudio.cpp
[15:06:01] <Dominus> (I'm slowly working my way up ScummVMs changes to the driver :))
[15:08:28] <wjp> hum, those are Apple-specific
[15:08:54] <wjp> try putting the following three lines somewhere in that file
[15:08:59] <wjp> #ifndef TARGET_CPU_X86
[15:09:05] <wjp> #error TARGET_CPU_X86 not defined
[15:09:07] <wjp> #endif
[15:09:19] <wjp> if that doesn't complain, then the right headers are present :-)
[15:09:46] <wjp> (just put it at the very end if you're unsure about where)
[15:10:14] <-- Dominus has left IRC (Read error: Connection reset by peer)
[15:11:34] --> Dominus has joined #exult
[15:11:34] --- ChanServ gives channel operator status to Dominus
[15:12:00] <wjp> (assuming of course that you're compiling for x86)
[15:12:50] <Dominus> when using the non-deprecated API, Im compiling for 32 and 64bit, but i'm also compiling for PPC.
[15:13:11] <Dominus> wouldn't that bomb, following your ifndif?
[15:13:34] <Dominus> and it is ok for that to be apple-only since, coreaudio is also apple-only
[15:13:50] <wjp> it's only intended to test if those TARGET_CPU_* things are safe to use :-)
[15:13:54] <wjp> not to keep in there
[15:14:02] <Dominus> aye, got it
[15:19:01] <-- Rottingbeef has left IRC (Read error: Connection reset by peer)
[15:19:13] --> Rottingbeef has joined #exult
[15:33:29] <Dominus> yeah, that seems to work (need to test ppc yet, though)
[15:33:48] <Dominus> of course I've made another copy/paste plunder and had another assertion
[15:56:36] <Dominus> wjp, running into another string thing, that I'm always not quite getting. code is http://pastebin.com/iDcnZVnU adapted from https://github.com/scummvm/scummvm/commit/486f04b7614a633d39cf4633797a8baa790bb95b#backends/midi/coreaudio.cpp
[15:57:05] <Dominus> the problem is the strlen
[15:57:25] <Dominus> error: no matching function for call to
[15:57:25] <Dominus> 'strlen'
[15:57:25] <Dominus> ...(const UInt8 *)soundfont.c_str(), strlen(soundfont), false);
[15:57:25] <Dominus> ^~~~~~
[15:57:25] <Dominus> function not viable: no known conversion from 'std::string' (aka
[15:57:26] <Dominus> 'basic_string<char>') to 'const char *' for 1st argument;
[15:57:26] <Dominus> size_t strlen(const char *);
[15:58:35] <wjp> um, is that code still the same in current scummvm?
[15:59:05] <Dominus> yes, I think that is almost up to date (except for a warning/error message)
[15:59:20] <Dominus> https://github.com/scummvm/scummvm/commits/master/backends/midi/coreaudio.cpp
[15:59:41] <wjp> but use soundfont.size() instead of strlen(soundfont)
[16:00:57] <wjp> that scummvm code needs fixing...
[16:01:08] <wjp> (your code is fine)
[16:01:24] <Dominus> thanks, it now seems to work as intended.
[16:01:39] <Dominus> what's wrong with it in ScummVM?
[16:03:37] * Dominus exhales
[16:03:43] <wjp> subtle memory management; not important here :-)
[16:03:49] <Dominus> now onto testing with my three build targets
[16:03:52] <Dominus> :)
[18:59:49] <-- Dominus has left IRC (Read error: Connection reset by peer)
[19:00:20] --> Dominus has joined #exult
[19:00:20] --- ChanServ gives channel operator status to Dominus
[19:17:11] --> BrainChld has joined #exult
[19:32:36] <-- BrainChld has left IRC (Remote host closed the connection)
[20:43:38] <-- Dominus has left IRC (Read error: Connection reset by peer)
[20:44:09] --> Dominus has joined #exult
[20:44:09] --- ChanServ gives channel operator status to Dominus
[21:42:06] --> Kirben has joined #exult
[21:42:06] --- ChanServ gives channel operator status to Kirben
[21:45:46] <Dominus> hmm, interesting, contrary to what the scummvm coreaudio states, it seems that OS X 10.5 for intel also doesn't support the "new" API....
[22:07:09] <Dominus> hmm, should I file this as a bug report or as a patch or fight my way through git and set a pull/merge request or what it is called?
[22:08:31] <wjp> for scummvm? Bug report or patch is fine too
[22:08:37] <-- Dominus has left IRC (Read error: Connection reset by peer)
[22:09:09] --> Dominus has joined #exult
[22:09:09] --- ChanServ gives channel operator status to Dominus
[22:09:22] <Dominus> also when going the soundfont loading way of ScummVM in Exult that didn't succeed (FsSpec vs FsRef)...
[22:10:09] <Dominus> I'll add a patch for ScummVM and a bug report for the soundfont thing (but first need to actually compile ScummVM :))
[22:11:13] <Dominus> I ended up using #if (MAC_OS_X_VERSION_MAX_ALLOWED < 1060) instead of the Target_CPU thing, especially since it affects 10.5 x86 as well :)
[22:45:54] <Dominus> hmm, I might need another hand at error handling of the soundfont loader and this might affect ScummVM, too
[22:46:02] * Dominus compiles scummvm
[23:29:24] * Dominus is annoyed at scummvm's configure and bundle target with stuff that doesn't work if not everything is it wants it to be (hardcoded static-libs path for eaxample)