Jump to content

New Sound Manager svn patch


Recommended Posts

DebugView log:



[4892] HRT: activating HPET failed: Unknown error (-100022, 0xFFFFFFFFFFFE794A)
[4892] HRT: using name=TSC freq=3292000000.000000
[4892] HRT: counter=TSC freq=3.292e+009 res=3.03767e-010 bits=64
[4892] Cache: 200 (total: 8192) MiB
[4892] TIMER| InitVfs: 2.01368 ms
[4892] Sound: AlcInit success, using DirectSound Software
[4892] TIMER| InitScripting: 1.02034 ms
[4892] TIMER| CONFIG_Init: 6.01386 ms
[4892] TIMER| RunHardwareDetection: 102.155 ms
[4892] TIMER| write_sys_info: 40.9052 ms
[4892] TIMER| InitRenderer: 3.36158 ms
[4892] TIMER| ps_console: 7.90511 ms
[4892] TIMER| ps_lang_hotkeys: 868.259 us
[4892] TIMER| common/setup.xml: 1.55405 ms
[4892] TIMER| common/styles.xml: 160.811 us
[4892] TIMER| common/sprite1.xml: 3.15789 ms
[4892] TIMER| common/init.xml: 3.03275 ms
[4892] TIMER| common/common_sprites.xml: 3.84756 ms
[4892] TIMER| common/common_styles.xml: 654.127 us
[4892] TIMER| pregame/sprites.xml: 1.02636 ms
[4892] TIMER| pregame/styles.xml: 158.662 us
[4892] TIMER| pregame/mainmenu.xml: 12.5619 ms
[4892] TIMER| common/global.xml: 686.716 us
[4892] TIMER| common/setup.xml: 928.922 us
[4892] TIMER| common/styles.xml: 55.5355 us
[4892] TIMER| common/sprite1.xml: 3.00595 ms
[4892] TIMER| common/common_sprites.xml: 3.69616 ms
[4892] TIMER| common/common_styles.xml: 543.417 us
[4892] TIMER| gamesetup/setup.xml: 502.7 us
[4892] TIMER| gamesetup/sprites.xml: 156.942 us
[4892] TIMER| gamesetup/styles.xml: 191.49 us
[4892] TIMER| gamesetup/gamesetup.xml: 21.587 ms
[4892] TIMER| common/setup.xml: 876.955 us
[4892] TIMER| common/styles.xml: 53.9326 us
[4892] TIMER| common/sprite1.xml: 2.68229 ms
[4892] TIMER| common/init.xml: 2.36128 ms
[4892] TIMER| common/common_sprites.xml: 3.39419 ms
[4892] TIMER| common/common_styles.xml: 494.327 us
[4892] TIMER| loading/styles.xml: 456.698 us
[4892] TIMER| loading/sprites.xml: 617.618 us
[4892] TIMER| loading/loading.xml: 1.95623 ms
[4892] TIMER| common/global.xml: 424.69 us
[4892] TIMER| common/setup.xml: 842.38 us
[4892] TIMER| common/styles.xml: 56.1671 us
[4892] TIMER| common/sprite1.xml: 2.69921 ms
[4892] TIMER| common/icon_sprites.xml: 216.249 us
[4892] TIMER| common/common_sprites.xml: 3.30853 ms
[4892] TIMER| common/common_styles.xml: 515.111 us
[4892] TIMER| session/sprites.xml: 4.93378 ms
[4892] TIMER| session/styles.xml: 573.576 us
[4892] TIMER| session/session.xml: 82.6612 ms
[4892] TIMER| common/global.xml: 1.53398 ms
[4892] GAME STARTED, ALL INIT COMPLETE
[4892] TIMER| common/setup.xml: 849.679 us
[4892] TIMER| common/styles.xml: 60.9806 us
[4892] TIMER| common/sprite1.xml: 2.74146 ms
[4892] TIMER| common/common_sprites.xml: 3.40602 ms
[4892] TIMER| common/common_styles.xml: 523.782 us
[4892] TIMER| msgbox/msgbox.xml: 1.28979 ms
[4892] TIMER| common/setup.xml: 863.111 us
[4892] TIMER| common/styles.xml: 58.2102 us
[4892] TIMER| common/sprite1.xml: 2.68619 ms
[4892] TIMER| common/icon_sprites.xml: 112.852 us
[4892] TIMER| common/init.xml: 2.39029 ms
[4892] TIMER| common/common_sprites.xml: 3.3176 ms
[4892] TIMER| common/common_styles.xml: 505.859 us
[4892] TIMER| summary/summary.xml: 23.9028 ms
[4892] TIMER| summary/sprites.xml: 395.892 us
[4892] TIMER| common/global.xml: 813.036 us
[4892] TIMER| common/setup.xml: 830.03 us
[4892] TIMER| common/styles.xml: 72.8821 us
[4892] TIMER| common/sprite1.xml: 2.6682 ms
[4892] TIMER| common/init.xml: 2.40887 ms
[4892] TIMER| common/common_sprites.xml: 3.39123 ms
[4892] TIMER| common/common_styles.xml: 529.837 us
[4892] TIMER| pregame/sprites.xml: 684.689 us
[4892] TIMER| pregame/styles.xml: 53.2609 us
[4892] TIMER| pregame/mainmenu.xml: 6.85793 ms
[4892] TIMER| common/global.xml: 442.447 us
[4892] TIMER| common/setup.xml: 851.218 us
[4892] TIMER| common/styles.xml: 58.387 us
[4892] TIMER| common/sprite1.xml: 2.74036 ms
[4892] TIMER| common/common_sprites.xml: 3.33611 ms
[4892] TIMER| common/common_styles.xml: 525.965 us
[4892] TIMER| msgbox/msgbox.xml: 879.151 us
[4892] TIMER| shutdown TexMan: 5.25456 us
[4892] TIMER| shutdown Renderer: 2.62743 ms
[4892] TIMER| shutdown SDL: 219.058 ms
[4892] TIMER| shutdown UserReporter: 225.961 us
[4892] TIMER| shutdown ScriptingHost: 9.77857 ms
[4892] TIMER| shutdown ConfigDB: 0.705346 us
[4892] TIMER| resource modules: 160.571 ms
[4892] TIMER TOTALS (10 clients)
[4892] -----------------------------------------------------
[4892] tc_dds_transform: 1852.75 kc (822x)
[4892] tc_png_decode: 76.2657 Mc (64x)
[4892] tc_pool_alloc: 50.1092 Mc (3081x)
[4892] tc_commit: 48.1217 Mc (2627x)
[4892] tc_transform: 3204.99 kc (279x)
[4892] tc_plain_transform: 1090.07 kc (279x)
[4892] tc_ShaderValidation: 19.4141 Mc (58x)
[4892] tc_ShaderGLSLLink: 42.2376 Mc (54x)
[4892] tc_ShaderGLSLCompile: 200.31 Mc (108x)
[4892] xml_validation: 65.568 Mc (130x)
[4892] -----------------------------------------------------
[4892] TIMER| shutdown misc: 12.5318 ms
[4892] TIMER| shutdown wmi: 719.187 us

Link to comment
Share on other sites

Continuing to delve into this. Apparently the OpenAL32.dll we bundle with the game is in fact OpenAL Soft as of r7279. If you download the latest OpenAL Soft win32 binary, the accompanying readme has this notice:

Note that it is still expected to install the OpenAL redistributable provided by Creative Labs (at http://openal.org/), as that will provide the "router" OpenAL32.dll that applications talk to, and may provide extra drivers for the user's hardware. It will also provide 64-bit DLLs. The DLL provided here will simply add additional devices for applications to select from. If you do not wish to use the redistributable, then simply rename soft_oal.dll to OpenAL32.dll.. just be aware this will prevent other system-installed OpenAL implementations from working.

We do the latter, not sure how relevant that is to the current problems. We could at least update the OpenAL Soft lib to the latest v1.14.

Link to comment
Share on other sites

Though, the music doesn't sound as impressive as before ...

At first I thought I agreed with this after using the new DLL. But after minimizing distractions in the room and doing a comparison, I can't hear any audible difference between using the different DLLs. Of course that's on my system and it could well be different on someone else's.

However comparing the new sound system with Alpha 10, you're right - the music sounds quite a bit different, it seems less dynamic and "rich" now. It doesn't seem to be only a difference in volume. Could it be a difference in how the OGG file itself is handled and played? Maybe we set some parameters before to boost the sound. Anyway I'm glad to hear it fixes your crash (y)

Link to comment
Share on other sites

If anyone wants to try something, download the attached file and copy it to the game's binaries/system directory, replacing the old one. This only applies to Windows users of course, I'm curious if it will solve any of the problems or create new ones.

This created more problems for me.

Whenever I start a new game, it crashed first few seconds.

Now when I applied that OpenAL32.dll to my binaries/system and run the program again,

Instantly, I get this:

http://img1.uploadsc...481327-orig.jpg

Using Windows 7 premium 64 bits with AMD a8-3850 processor.

Edited by rjs23
Link to comment
Share on other sites

THings are starting to free up for me, especially next week, so I plan on being able to put some time in on this...

Seems the main issue is the archive thing (I will lurk around IRC to discuss how to handle that), also to handle being disabled from the command line and/or due to errors in the startup. Then moving the sound processing into another thread as a possibly next version upgrade, does that sound about right?

Link to comment
Share on other sites

OK, fix in for the archive problem! It actually fit in kind of nicely! RIght now its in brnach on git at:

https://github.com/stwf/0ad/tree/ogg-streams

Sorry for those who were watching my fork, I deleted it and started over. #afraidofgit

I did have one time where the main menu music stopped, but I couldn't reproduce it, so we may not be out of the woods yet...

Link to comment
Share on other sites

I have also had the problem where the main menu music stopped, several times. I don't know how to reproduce it though (other than launching the game a few times and lots of waiting). I had wondered if it might be caused by the stream running out of buffered content and causing an error before getting more data. This is a pretty wild guess though.

Link to comment
Share on other sites

I just ran into an error, which might have been mentioned before, but anyway: here it is. It happened after half an hour (maybe shorter) of gameplay, and I think it had something to do with my Roman cavalry finally going after the chickens near the civ center (lazy bugger ;) ). It seems related to this ticket (crash upon selecting an entity), although I am not entirely sure (perhaps it is only superficially similar given the same error message).


- Error creating initial buffer !!
ERROR: error loading sound: pathname=audio/actor/fauna/animal/chicken_13.ogg, error=Function failed (no details available)
(same messages for chicken_12, chicken_11, and chicken_10)
Segmentation fault

The first few lines of the OS X 10.6 crash window log look like this (the rest seems not particularly interesting):


0 pyrogenesis 0x00000001001ce9ed CSoundGroup::UploadPropertiesAndPlay(int, CVector3D const&) + 125
1 pyrogenesis 0x00000001000b3bce CCmpSoundManager::PlaySoundGroup(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, unsigned int) + 1374
2 pyrogenesis 0x00000001000da8d7 int ScriptInterface::callMethod<void, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, unsigned int, &(class_ICmpSoundManager), ICmpSoundManager, &(ICmpSoundManager::PlaySoundGroup(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, unsigned int))>(JSContext*, unsigned int, unsigned long long*) + 439

I was not able to reproduce the error, although I have seen this problem before. The audio files mentioned do exist and I can play them. Even in-game there was no problem when I tried the same setting once more. I used an up-to-date version based on the current SVN source code.

Link to comment
Share on other sites

Tried this branch, there is a build error in ogg.cpp in MSVC: ResetFile() needs to return a value. The good news is after fixing that, it worked with and without archives, for me on Windows (y)

I noticed some other old and new issues, mostly quick cleanup that it would be nice to have done:

  • "vorbis/vorbisfile.h" doesn't need to be included again as it's pulled in from "lib/external_libraries/vorbis.h"
  • CONFIG2_AUDIO would cause a build fail if used, as it's wrapping the contents of ogg.cpp but nothing else, probably the wrapping and the "without-audio" build option should be commented out for A11, otherwise someone could try using it and not understand the resulting failures. Later after A11 we can allow building without audio if desired.
  • Add the standard Wildfire Games GPL header for both ogg.cpp and ogg.h
  • Remove the commented lines from OggData.cpp and clean up any unused variables (m_Filename?)
  • In OggData.cpp, instead of declaring g_VFS again, including "ps/Filesystem.h" would be cleaner
  • <iostream>, "lib/file/vfs/vfs_util.h", and "ps/Filesystem.h" seem to be unnecessary includes in SoundData.cpp; and "lib/os_path.h" is not needed in SoundData.h
  • <iostream> and <wchar.h> are no longer needed in OggData.cpp
  • In COggData::FetchDataIntoBuffer I'm not sure the intent of line 122, where you copy the pointer pcmout to readDest, I take it that's not intended to be a mem copy but it looks like a duplicate variable.

And don't forget the earlier discussion in this topic about increasing the buffer size on my old laptop and how that helped prevent the music from stopping ;) I think it's worth considering for A11 at least.

I was not able to reproduce the error, although I have seen this problem before. The audio files mentioned do exist and I can play them. Even in-game there was no problem when I tried the same setting once more. I used an up-to-date version based on the current SVN source code.

Without better logging and error handling, it will be difficult to track these errors down.

Link to comment
Share on other sites

Thanks, I will incorporate all of those things. Currently I am adding error handling for initialization (and better disabling if init fails) also I'll check and log errors during playback to try and nail down the intermittent problems. I was going to try and support the builds without audio as well as starting from the command line without audio as well.

I will increase the buffer size for the alpha but I think using a thread for feeding openal is the right solution for that.

Thanks for the testing and advice

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...