Forums
the next big steps - Printable Version

+- Forums (https://www.vdrift.net/Forum)
+-- Forum: Project (https://www.vdrift.net/Forum/forumdisplay.php?fid=4)
+--- Forum: Development (https://www.vdrift.net/Forum/forumdisplay.php?fid=9)
+--- Thread: the next big steps (/showthread.php?tid=562)

Pages: 1 2 3 4 5


- joevenzon - 03-30-2007

abs1nth: I think R1654 should fix the crash you were having in SetPitchSmooth.


- reece146 - 03-30-2007

joevenzon Wrote:Okay, one thing to note: I didn't put the file data/test/44k_s16_c2.wav in the SConstruct because there's no reason to install it on the end user's computer, but maybe I should have. Anyway, for the -test to work you need to copy that file to your data directory, such as /usr/share/games/vdrift/data/test/44k_s16_c2.wav

No worries, leave it out, I'll know better next time:

Code:
optimus test # /usr/share/games/vdrift/bin/vdrift -test
BinReloc successfully initialized.
Executable path: /usr/share/games/vdrift/bin/vdrift
Data dir: /usr/share/games/vdrift/data
Localedir: /usr/share/games/vdrift/share/locale
No data_dir found in VDrift.config, using /usr/share/games/vdrift/data
Found config file /root/.vdrift/controls.
Found config file /root/.vdrift/VDrift.config.
No data_dir found in VDrift.config, using /usr/share/games/vdrift/data
Version of game: development
Skin name not found in config file...
Performance testing Sample16bit (64ms for 1 second of 44.1khz stereo audio with 32 sources): 1/1 = 100% PASS
Performance testing SampleAndAdvance16bit (78ms for 1 second of 44.1khz stereo audio with 32 sources): 1/1 = 100% PASS
Performance testing SampleAndAdvanceWithPitch16bit (168ms for 1 second of 44.1khz stereo audio with 32 sources): 1/1 = 100% PASS
Sound effects testing: 2/3 = 66.6667% FAIL
Sound management testing: 6/6 = 100% PASS
Sound source testing: 3/3 = 100% PASS
Wave loading 44k s16 c2: 5/5 = 100% PASS
TOTAL: 19/20 = 95% FAIL

I did this over the satellite link and ssh hopped through a couple of hoops so I have no idea if the machine running vdrift actually made any useful bleeps or not. I can check it on Monday when I get back to the lab if you need me to.

Host is nothing very exotic:

Code:
optimus test # lsmod
Module                  Size  Used by
snd_seq                62336  0
snd_seq_device         12052  1 snd_seq
fglrx                 625912  11
snd_hda_intel          23072  1
snd_hda_codec         248704  1 snd_hda_intel
snd_pcm                85896  2 snd_hda_intel,snd_hda_codec
snd_timer              26248  2 snd_seq,snd_pcm
snd                    56624  8 snd_seq,snd_seq_device,snd_hda_intel,snd_hda_codec,snd_pcm,snd_timer
snd_page_alloc         13328  2 snd_hda_intel,snd_pcm
Code:
optimus test # lspci | grep -i audio
00:1b.0 Audio device: Intel Corporation HD Audio Controller (rev 02)



- joevenzon - 03-31-2007

The problem with the sound effect testing failure should be fixed in the latest SVN.


- abs1nth - 04-05-2007

tried some more to get the new sound engine work on ppc, without success. with my patch all the tests besides one sound filter test pass ( the sound filter results seem to be one off: 343 instead of 342, 520 instead of 519)

however the actual sound output is still all garbage... ;-(

btw. please apply the patch below as i'm away from my machine.

Code:
Index: sound.cpp
===================================================================
--- sound.cpp   (revision 1677)
+++ sound.cpp   (working copy)
@@ -726,8 +726,9 @@
{
        //line below is used for performance testing to find bottlenecks
        //return 123;
-
-       return ((short *)sound_buffer)[position*info.channels+(channel-1)*(info.channels-1)];
+       short result = ((short *)sound_buffer)[position*info.channels+(channel-1)*(info.channels-1)];
+       short swapped_result = ENDIAN_SWAP_16(result);
+       return swapped_result;
}



- joevenzon - 04-05-2007

Can you put that in a #define block? That's an extremely performance-critical section....


- joevenzon - 04-05-2007

abs1nth: what do you get when you compile the simple example "Playing streaming audio, mixing 2 (or more) audio streams" at:

http://www.libsdl.org/cgi/docwiki.cgi/Audio_20Examples


- abs1nth - 04-06-2007

i will be away the next days but will check out the examples when i'm back

the updated patch:
Code:
Index: sound.cpp
===================================================================
--- sound.cpp   (revision 1677)
+++ sound.cpp   (working copy)
@@ -726,8 +726,13 @@
{
        //line below is used for performance testing to find bottlenecks
        //return 123;
-
+       #if SDL_BYTEORDER == SDL_BIG_ENDIAN
+       short result = ((short *)sound_buffer)[position*info.channels+(channel-1)*(info.channels-1)];
+       short swapped_result = ENDIAN_SWAP_16(result);
+       return swapped_result;
+       #else
        return ((short *)sound_buffer)[position*info.channels+(channel-1)*(info.channels-1)];
+       #endif
}

inline const int SOUNDINFO::GetChannels() const



- joevenzon - 04-06-2007

Checked in, R1683


- thelusiv - 04-08-2007

I finally got sound working on the new comp and have tested out the new sound system. Here's what I get when I run vdrift -test:
Code:
Performance testing Sample16bit (87ms for 1 second of 44.1khz stereo audio with 32 sources): 1/1 = 100% PASS
Performance testing SampleAndAdvance16bit (62ms for 1 second of 44.1khz stereo audio with 32 sources): 1/1 = 100% PASS
Performance testing SampleAndAdvanceWithPitch16bit (118ms for 1 second of 44.1khz stereo audio with 32 sources): 1/1 = 100% PASS
Performance testing SampleAndAdvanceWithPitch16bit with 1st order filter (173ms for 1 second of 44.1khz stereo audio with 32 sources): 1/1 = 100% PASS
Sound effects testing: 3/3 = 100% PASS
Sound filter testing: 1/2 = 50% FAIL
Sound management testing: 6/6 = 100% PASS
Sound source testing: 3/3 = 100% PASS
Wave loading 44k s16 c2: 5/5 = 100% PASS

During gameplay I noticed that the sound was sometimes a little crackly. It would happen sometimes, then go away, then come back...at times it went away slowly, other times quickly...it didn't seem to happen in relation to any other event.

Other than that though, the pitch-shifting is much smoother sounding than with OpenAL; it doesn't sound like it's being played from an old dusty record anymore.


- joevenzon - 04-08-2007

Quote:Performance testing SampleAndAdvanceWithPitch16bit (118ms for 1 second of 44.1khz stereo audio with 32 sources): 1/1 = 100% PASS

Dang, your CPU is much faster than mine.

What else can you tell me about these crackles?


- rookie1 - 04-09-2007

thelusiv Wrote:During gameplay I noticed that the sound was sometimes a little crackly. It would happen sometimes, then go away, then come back...at times it went away slowly, other times quickly...it didn't seem to happen in relation to any other event.

I can hear crackling sound when the opponent car is near me. It will disappear when the opponent car is further away. Not sure this is the same as what you are hearing.


- thelusiv - 04-09-2007

I'll post some more stuff about the crackling when I get the chance to do some more investigation.


- abs1nth - 04-09-2007

joevenzon Wrote:what do you get when you compile the simple example "Playing streaming audio, mixing 2 (or more) audio streams"

a clear and constant tone


- joevenzon - 04-10-2007

Iiiinteresting. That's what you're supposed to get. It seems that the problem is the data that's getting written into the stream... have you tried going to the function SOUND::Callback16bitstereo and byteswapping out1 and out2 as they get assigned to the stream?

Code:
((short *) stream)[i*2] = out1;
((short *) stream)[i*2+1] = out2;



- abs1nth - 04-11-2007

no doesn't work i tried that some while ago already. ;-(

just wondering, why have all the methods "int" in their signature although they are dealing with shorts (16 bit audio)?

if we had an test that actually played the short audio file we could add debug output to the callback function to print out the stream which could give us some clue...