IRC logs for #opendune on OFTC at 2011-09-01
            
01:27:37 <glx> hmm intro corrupts memory
01:29:42 <glx> HEAP[opendune.exe]: Heap block at 00A87640 modified at 00A87948 past requested size of 300 <-- opendune.c:2621, triggered only if intro has been played
01:38:47 <glx> oh found it
01:43:37 <DorpsGek> SVN: glx (r2513) -Fix: don't write past allocated memory
01:56:28 <DorpsGek> SVN: glx (r2514) -Add: native win32 DSP implementation
02:37:36 *** glx has quit IRC
08:50:42 <DorpsGek> SVN: truebrain (r2515) -Codechange: a sprankle of coding style over mpu_ files
08:51:06 <planetmaker> sprankle? Does that come from spanking? ;-)
08:51:32 <planetmaker> from the evil English teacher? ;-)
08:51:45 * planetmaker hugs TrueBrain and wishes a particularily good morning
08:54:48 <TrueBrain> morning planetmaker :)
08:54:57 <TrueBrain> and funny to see that you are willing to let go an 'r' to make it dirty :D
08:55:21 <planetmaker> :-P
08:55:21 <DorpsGek> SVN: truebrain (r2516) -Codechange: renamed mpu_ files to midi_ files, as that is what they do
08:55:56 <TrueBrain> why is it so hard to find alsa manuals :(
08:57:10 <DorpsGek> SVN: truebrain (r2517) -Fix (r2516): nothing to see here
08:59:50 <Xaroth|Work> :o
08:59:58 <TrueBrain> you looked, didn't you?
09:05:23 <DorpsGek> SVN: truebrain (r2518) -Add: create a DSP_None device, to use in case we don't want DSP
09:06:04 <DorpsGek> SVN: truebrain (r2519) -Fix (r2518): forgot SVN props
10:30:23 <TrueBrain> yippie, my ALSA DSP driver works
10:30:37 <TrueBrain> hmm, not completely
10:30:42 <TrueBrain> seems to have a weird bug
10:55:32 <TrueBrain> might help if you not play the whole buffer, but just the length of the sample you have :D
10:55:34 <TrueBrain> hihi
11:00:48 <DorpsGek> SVN: truebrain (r2520) -Add: introducing an ALSA driver for DSP
11:03:23 <DorpsGek> SVN: truebrain (r2521) -Fix: don't be verbose about finding MIDI ports
11:04:37 <DorpsGek> SVN: truebrain (r2522) -Fix: committed a testline
11:11:53 <DorpsGek> SVN: truebrain (r2523) -Fix: minor warning I overlooked
11:18:19 <DorpsGek> SVN: truebrain (r2524) -Update: update valgrind suppression file
12:32:05 *** glx has joined #openDune
12:32:05 *** ChanServ sets mode: +o glx
12:32:12 <TrueBrain> hello glx :)
12:32:15 <TrueBrain> I liked your win32 DSP
12:32:19 <TrueBrain> so I made ALSA DSP :D
12:32:23 <TrueBrain> works very well :D:D:D
12:32:44 <glx> hello
12:35:19 <glx> and no need to convert audio
12:35:29 <TrueBrain> nope
12:35:33 <TrueBrain> only lot of open/close
12:35:34 <TrueBrain> but meh :P
12:35:50 <planetmaker> what btw is DSP? an audio driver? or...?
12:35:56 <glx> voice driver
12:35:59 <planetmaker> i.e. what does it abbreviate?
12:36:07 <TrueBrain> Digital Sound Playback? :P
12:36:17 <planetmaker> he. Thanks :-)
12:36:22 <TrueBrain> everything not MIDI :P
14:05:32 *** Osai has quit IRC
14:07:42 *** SmatZ has quit IRC
14:09:22 *** Yexo has quit IRC
14:09:22 *** planetmaker has quit IRC
14:09:27 *** tneo has quit IRC
14:15:33 *** SmatZ has joined #openDune
14:16:04 *** planetmaker has joined #openDune
14:16:04 *** tneo has joined #openDune
14:16:20 *** planetmaker is now known as Guest8147
14:17:34 *** Osai has joined #openDune
14:17:34 *** Yexo has joined #openDune
14:25:56 *** Guest8147 is now known as planetmaker_
14:47:33 <DorpsGek> SVN: glx (r2525) -Fix: removed useless declaration
15:21:33 *** planetmaker_ is now known as planetmaker
15:32:53 *** TinoDidriksen has quit IRC
15:41:42 *** fjb has joined #openDune
15:42:18 <fjb> Moin
15:42:34 <Xaroth> o/
15:44:29 <fjb> Moin Xaroth
15:44:33 <Xaroth> moin
15:45:41 *** TinoDidriksen has joined #openDune
16:21:09 <TrueBrain> I don't know what to do for OpenDUNE anymore ... sad :P
16:21:14 <TrueBrain> I might write another video driver for lolz ...
16:31:14 <glx> that's what I'm doing ;)
16:34:14 <planetmaker> lol... have you guys been successful at scenario editor acheology meanwhile?
16:34:49 <TrueBrain> nope :)
16:34:51 <TrueBrain> :(
16:35:09 <planetmaker> :-(
17:33:06 <TrueBrain> I wonder if there are any better video drivers for Linux ..
17:33:13 <TrueBrain> and OSX need drivers, but meh ... OSX .. you know ..
17:37:21 *** Alberth has joined #openDune
17:37:22 *** ChanServ sets mode: +o Alberth
17:45:03 <TrueBrain> o/ Alberth
17:45:11 <TrueBrain> would you mind testing DSP + MIDI with trunk?
17:45:14 <TrueBrain> (with ALSA)
17:45:17 <TrueBrain> I made a native DSP driver)
17:47:10 <Alberth> I don't even know what sound stuff I have :)
17:47:24 <TrueBrain> you used alsa last time :P
17:47:35 <TrueBrain> ./configure will detect and use it ;)
17:47:42 <TrueBrain> (at least, it should :P)
17:49:05 <Alberth> 70 new revisions :)
17:51:47 <Alberth> checking asound... found <-- this is alsa ?
17:51:51 <TrueBrain> yes
17:52:40 <Alberth> No valid MIDI output ports. <-- right, not working out of the box :p
17:52:46 <Alberth> will install some things :)
17:52:50 <TrueBrain> you still need timidity :)
17:53:13 <TrueBrain> but I am mostly interested if you also hear voices correct
17:53:18 <TrueBrain> as you had the rate issue the other time
18:13:50 <Alberth> 257MB download? wtf?
18:13:57 <TrueBrain> ?
18:15:17 <Alberth> some fluid-soundfont-* packages
18:19:32 <Alberth> fluid-soundfont-lite-patches, a mere 137 MB :p makes you wonder how big heavy patches are :)
18:19:40 <TrueBrain> lol
18:29:03 <Alberth> no sound at all
18:29:49 <TrueBrain> no midi nor voice?
18:29:54 <TrueBrain> do you have it enabled in your settings? :)
18:30:01 <TrueBrain> (load a game, setting, switch to on)
18:31:00 <Alberth> good point :p
18:31:11 <Alberth> yay, music!!
18:31:17 <TrueBrain> really annoying in Dune, as you can only change it ingame :(
18:31:49 * Alberth smells an enhancement ;)
18:31:54 <TrueBrain> hihi
18:31:58 <TrueBrain> but midi and voice work, fluent?
18:32:00 <TrueBrain> also the intro etc?
18:32:28 <Alberth> hmm, no emperor voices
18:33:10 <Alberth> only at the very start with "planet arrakis", and no more
18:33:32 <TrueBrain> ingame, if you click units, does it work correctly? (you hear the whole sample)
18:35:05 <Alberth> that seems to work
18:35:15 <TrueBrain> hmm
18:36:27 <Alberth> house selection fails, I can click the house icon, it says "house blabla", but no switching to the mentat
18:36:40 <TrueBrain> so your playing is never false, so alsa never reports underrun
18:36:42 <TrueBrain> hmm
18:37:03 <TrueBrain> I cheated a tiny bit; to detect if a piece of voice is done playing, I wait for ALSA to tell me there is an underrun (buffer empty)
18:37:13 <TrueBrain> but seemly that never happens for you
18:37:25 <TrueBrain> can you put a debug line in src/audio/dsp_alsa.c, in DSP_Callback
18:37:35 <Alberth> there is constant music
18:37:49 <TrueBrain> 2 different outputs :))
18:38:06 <TrueBrain> can you print snd_pcm_avail(s_dsp) and s_bufferLen
18:38:15 <TrueBrain> then load a game, and click a unit
18:42:35 <Alberth> hmm, at 64bits, 32 bits is not a long any-more :p
18:44:03 <Alberth> doesn't get called
18:46:56 <Alberth> really doesn't get called, I added a printf("s_playing=%d\n", s_playing); above the if (!s_playing) return;
18:46:59 <TrueBrain> doesn't get called?!
18:47:09 <TrueBrain> weird ...
18:47:10 <TrueBrain> hmm
18:47:16 <TrueBrain> no, makes no sense :P
18:47:28 <TrueBrain> downside of ALSA
18:47:31 <TrueBrain> every implementation is different
18:47:32 <TrueBrain> euuuhhh
18:47:43 <Alberth> joy :)
18:48:04 <TrueBrain> can you add a snd_pcm_start(s_dsp) below snd_pcm_writei
18:48:09 <TrueBrain> around line 132
18:48:30 <TrueBrain> and can you confirm that that DSP function is used btw? :P
18:48:37 <TrueBrain> not that is sneaky is using SDL or what-ever :P
18:50:40 <Alberth> no callback, but the function at line 132 does get called when clicking :)
18:50:57 <TrueBrain> can you print what 'len' is after the writei line?
18:52:51 <Alberth> len=11216 for "reporting"
18:52:58 <TrueBrain> wuth?
18:53:00 <TrueBrain> holy crap
18:53:10 <TrueBrain> I tried for most part of the implementation to get a bigger buffer
18:53:14 <TrueBrain> so I didn't have to do an async bla
18:53:16 <TrueBrain> I failed horribly
18:53:27 <TrueBrain> beucase .. well .. the biggest buffer I could get was 213 long
18:53:35 <TrueBrain> and for you it just works :(
18:53:46 <Alberth> len=9767 "yes sir"
18:54:02 <TrueBrain> at least explains why you hear the full snippet
18:54:10 <TrueBrain> now how are we going to detect if the snippet is done playing
18:54:12 <TrueBrain> euh
18:54:26 <TrueBrain> DSP_GetStatus, can you print .. euh ... snd_pcm_status(s_dsp) there?
18:55:33 <TrueBrain> it should be 4 while playing, then switch to 5
18:55:34 <TrueBrain> I hope
18:55:46 <TrueBrain> owh, and: does your application block while clikcing a unit?
18:55:52 <TrueBrain> does it freeze for that bit of time?
18:56:02 <TrueBrain> (in other words, is it non-blocking)
18:57:19 <Alberth> not that I noticed, it did in the past though
18:57:39 <Alberth> oh, it has a status struct pointer too
18:58:52 <TrueBrain> euh, use snd_pcm_state
18:58:54 <TrueBrain> sorry :)
19:00:18 <TrueBrain> http://devs.opendune.org/~truebrain/temp.patch
19:00:25 <TrueBrain> still works here, might solve it for you?
19:02:14 <TrueBrain> it is btw funny, I cannot increase the size of the buffer, but if I return nothing in the callback, it multiplies the buffer size with 2 every call, up to 4k :p
19:02:19 <TrueBrain> stupid ALSA drivers :P
19:02:29 <TrueBrain> there is a reason they developed Jack ...
19:03:58 <Alberth> nope, no change
19:04:49 <TrueBrain> what does snd_pcm_state return in GetStatus?
19:07:37 <Alberth> snd_pcm_state(s_dsp)=3
19:08:04 <TrueBrain> and it stays that?
19:08:09 <TrueBrain> (it should be called a lot)
19:08:10 <Alberth> should I add some code to reduce the number of duplicate output?
19:09:12 <TrueBrain> nah; I just want to know if it ever becaomes none-3
19:10:31 <TrueBrain> here it is 4 90% of the time, unless I click a unit (on a level1 map of course, else missile etc also make voices :D)
19:11:41 <TrueBrain> basically, I need a way to detect when it is done playing :)
19:11:57 <TrueBrain> another wild idea:
19:11:58 <TrueBrain> len = snd_pcm_writei(s_dsp, s_buffer, s_bufferLen);
19:12:00 <TrueBrain> change into:
19:12:03 <TrueBrain> len = snd_pcm_writei(s_dsp, s_buffer, 128);
19:12:21 <TrueBrain> really guessing :D
19:13:06 <Alberth> if (!s_playing) return 0; <-- below that line, it is always 3
19:13:41 <TrueBrain> weird .....
19:14:00 <TrueBrain> why doesn't it want to underrun :P
19:14:40 <Alberth> with 128, units are not "reporting" any more
19:14:53 <TrueBrain> but callback is still never called, and state is still always 3?
19:16:33 <Alberth> yes, I just checked the callback
19:16:49 <TrueBrain> then how am I going to detect end-of-playback on your machine
19:16:51 <TrueBrain> eeeuuuuhhh
19:17:22 <TrueBrain> can you print the value of snd_pcm_avail(s_dsp) in DSP_GetStatus?
19:17:40 <Alberth> http://www.fpaste.org/gocw/ <-- current changes
19:18:39 <Alberth> good, I had a useless 'playing' variable anyway :)
19:20:04 <Alberth> snd_pcm_state(s_dsp)=3, snd_pcm_avail(s_dsp)=4194303
19:20:17 <TrueBrain> does avail ever change?
19:22:35 <glx> win32 was easier ;)
19:22:44 <TrueBrain> and can you put it before the !s_playing, and put a if (s_dsp != NULL){} around it?
19:22:51 <glx> but I'm now fighting with drawing :)
19:23:04 <Alberth> http://www.fpaste.org/IX2X/
19:23:35 <Alberth> 4 lines with values, but they change a bit each time
19:23:38 <TrueBrain> so 4194303 seems to indicate it is done for you ...
19:23:51 <Alberth> looks like it
19:24:59 <Alberth> @calc 4194303 - 4183088
19:24:59 <DorpsGek> Alberth: 11215
19:24:59 <TrueBrain> can you print the result value of snd_async statement?
19:25:20 <Alberth> 11216-1 :)
19:27:32 <Alberth> snd_async_add_pcm_handler()=-38
19:27:46 <Alberth> I disabled music btw, but that should not matter, right?
19:28:06 <TrueBrain> nope; this is on ALSA level
19:30:17 <TrueBrain> http://devs.opendune.org/~truebrain/temp.patch
19:30:25 <TrueBrain> best is to start a new game, click a house
19:30:28 <TrueBrain> see if it continues
19:30:59 <TrueBrain> ugh, should have added printing of s_playing
19:31:44 <TrueBrain> owh, now it fails here, lolz
19:32:15 <TrueBrain> not a second time
19:32:17 <TrueBrain> weird
19:32:57 <TrueBrain> updated patch
19:34:03 <TrueBrain> hacks on hacks on hacks
19:34:05 <TrueBrain> we will get there :D
19:38:23 <TrueBrain> indeed the async function gives NOT IMPLEMENTED back
19:38:29 <TrueBrain> (-38 is ENOSYS, meaning that)
19:40:21 <Alberth> does not work
19:40:35 <Alberth> the values do change, should I add code to reduce output?
19:40:53 <TrueBrain> or just put it in a paste
19:41:02 <TrueBrain> when you go to Play a game and select a house, it should not be that long
19:41:06 <TrueBrain> (here it isn't anyway :D)
19:42:44 <Alberth> only 3668 lines :p
19:42:49 <Alberth> 1) 3 :: 4178943 / 4194304 :: 0
19:42:49 <Alberth> 1) 3 :: 4183737 / 4194304 :: 0
19:42:49 <Alberth> 1) 3 :: 4188631 / 4194304 :: 0
19:42:49 <Alberth> 1) 3 :: 4193243 / 4194304 :: 0
19:42:49 <Alberth> 1) 3 :: 4194303 / 4194304 :: 0
19:42:55 <TrueBrain> off by one
19:42:56 <TrueBrain> nice
19:43:07 <TrueBrain> why does it never play the last byte
19:43:08 <TrueBrain> lol
19:43:10 <TrueBrain> that is silly
19:43:39 <TrueBrain> well, you can add a -1 in the if
19:43:46 <Alberth> :D
19:43:51 <TrueBrain> see if that works?
19:44:48 <TrueBrain> the other (maybe better?) solution is to update the value every tick, and check if it didn't change
19:45:00 <TrueBrain> (or at least, didn't go up anymore)
19:45:09 <TrueBrain> but that might not be solid
19:45:13 <TrueBrain> lets see what the -1 does :P
19:46:09 <TrueBrain> updated the patch btw, but I am sure you can add a -1 yourself :D
19:46:11 <Alberth> yay
19:46:40 <Alberth> well.... there are 2 sides of an == operator .... ;)
19:46:42 <TrueBrain> please do check the intro completely, see if they all work with -1
19:46:49 <TrueBrain> a -1 can only go on one side
19:46:52 <TrueBrain> otherwise it is a +1 :P
19:47:01 <Alberth> so I found out :)
19:47:05 <TrueBrain> hihihihih
19:47:08 <Alberth> testing the intro now
19:47:19 <TrueBrain> I can see this should be a >= instead of a ==
19:47:32 <TrueBrain> but lets put it to the test before making that conclusion ;)
19:49:35 <Alberth> intro seems fine
19:49:47 <TrueBrain> so it consistenly misses one byte :P
19:49:49 <TrueBrain> hihi
19:51:44 <DorpsGek> SVN: truebrain (r2526) -Fix: ALSA issues. There are implementations that do not support async, and have a large buffer. They appear to never issue an underrun error, so we need other ways to detect end-of-stream (hack 1). Those implementations also never seem to consume the whole buffer, but leave 1 byte (hack 2). The implementations with async support sometimes seem to switch to SETUP state instead of XRUN when underrunning, so just check if we are not RUNNING (hack 3). Yeah for ALSA, one API, many problems.
19:51:47 <TrueBrain> :D
19:51:53 <TrueBrain> tnx a lot Alberth
19:52:00 <TrueBrain> I am happy you have another ALSA implementation :)
19:52:35 <Alberth> np :)
19:53:02 <Alberth> weren't you planning to reduce the amount of text in a commit message? ;)
19:57:33 <TrueBrain> btw, no issues with frequency?
19:57:36 <TrueBrain> as in, voice is nice on pitch?
20:01:14 <Alberth> except when she mentions the houses, but that was always the case in opendune
20:01:41 <TrueBrain> Yeah, I believe itis in the VOC itself too
20:01:46 <TrueBrain> meaning Dune2 also does it like that?
20:01:49 <TrueBrain> not sure ... would hav eto check
20:01:52 <TrueBrain> if most is correct, I am happy :)
20:02:02 * Alberth never had sound with Dune2
20:02:34 <Alberth> heck, just this evening I had music for the first time :)
20:03:08 <Alberth> possbily due to the timidity download :)
20:04:41 <TrueBrain> :P
20:04:46 <TrueBrain> concratz
20:04:50 <TrueBrain> made a lengthy post about ALSA
20:04:52 <TrueBrain> explaining the problems
20:04:56 <TrueBrain> hope it helps someone else some day
20:05:28 <TrueBrain> I am just really happy we have sound on linux, without SDL :P
20:06:00 <TrueBrain> although I am pretty proud on the SDL upscale routine :P
20:06:38 <Alberth> SDL so bad?
20:06:41 <TrueBrain> yup
20:06:53 <TrueBrain> always have been, SDL audio is one of the most debated parts of SDL :)
20:06:57 <TrueBrain> SDL Mixer is even worse :P
20:07:10 <TrueBrain> SDL tries to support everything, which of course is always an issue :)
20:07:20 * Alberth keeps that in mind for the rollercoaster project :p
20:07:38 <TrueBrain> as you can see, even a simple something like ALSA requires multiple hacks :P
20:07:51 <TrueBrain> the other issue with SDL was that it kept complaining the buffer was getting an underrun
20:07:55 <TrueBrain> while that is intended in OpenDUNE
20:07:59 <TrueBrain> we don't supply a constant feed
20:08:05 <TrueBrain> SDL does expect that
20:08:12 <TrueBrain> lol, you are doing an openrollercoastertycoon?
20:08:16 <TrueBrain> openrct :P
20:10:11 <Alberth> it already exists @ googlecode :(
20:10:14 <TrueBrain> you have code already, or?
20:10:17 <TrueBrain> just planning?
20:11:21 <Alberth> we have professional sprites already, just no code :)
20:11:34 <TrueBrain> who is we?
20:11:52 <TrueBrain> and know if you need hosting to let us know; I am sure we can host an openrct next to openttd and opendune :P
21:00:20 *** Alberth has left #openDune
22:52:25 <glx> I hate palettes
22:52:53 <glx> or maybe it's the way opendune uses them
23:34:32 <glx> ok drawing works