|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0002680||FSSCP||sound||public||2012-07-04 22:03||2012-07-05 21:47|
|Platform||Homebrew PC||OS||Microsoft Windows||OS Version||7 x64 Ultimate|
|Product Version||3.6.14 RC6|
|Target Version||Fixed in Version|
|Summary||0002680: FSO does not correctly detect a sound card that does not support MIN_SOURCES|
|Description||FSO does not correctly detect a sound card that does not support MIN_SOURCES (currently 48 sources).|
Attached is a patch to fix it in a different way than Niffiwan proposes in Mantis 2266.
|Steps To Reproduce||Using OpenALSoft set the channels to 47 in alsoftrc (see http://repo.or.cz/w/openal-soft.git/blob_plain/HEAD:/alsoftrc.sample) and notice that FSO does not fail the sound card.|
Note you will have to look in the debug log because the "Generic Software" devices on windows are not affected by the settings in alsoftrc.
|Additional Information||Was noticed by Niffiwan in mantis 2266.|
|Tags||No tags attached.|
My justification for the different implementation in Mantis 2266:
"I don't know how many hardware sound cards we would find that can actually do 48 voices so I think just disabling the sound if we don't have 48 is not really a valid solution espcially when FSO is actually able to dynamically use a smaller or larger number of max channels."
I like the approach, however it doesn't seem to work properly so far.
ALsoft 1.13 doesn't seem to generate the same error codes as 1.14 (sigh). When testing with sources=25 in .alsoftrc I get lots of this in the fs2_open.log:
SOUND: sound/ds.cpp:1441 - OpenAL error = 'Invalid Value'
When testing with ALSoft 1.14, it seems to cap MAX_CHANNELS too early. i.e. I get this in the log:
SOUND: Ran out of sources too soon. Capping MAX_CHANNELS to 12 (was 32)
This is with sources=25 in .alsoftrc so I thought it should cap at 25. In two other tests, it capped once at 11, and once at 12. Could it be possible that they are sounds which are started without respecting MAX_CHANNELS? Would that be the original reason for setting MIN_SOURCES to 32+16?
FYI, if I set the default sources=256 then no errors are logged (as would be expected).
I wasn't sure which branch the patch is based on (r8846 was antipodes?), and I couldn't get it to apply cleanly to 3.6.14, antipodes or trunk (kept complaining about line 28 being invalid?) so I applied this by hand to trunk, r8983.
Lastly, with dynamic channel detection in place, would it be worthwhile either removing the initial setting of MAX_CHANNELS, or setting it to something very high, so that those people running ALSoft could make use of all those extra channels? :)
(ps - how can you find out how many channels a sound card supports? I had a bit of a google and couldn't find the info for the Xi-Fi - which is just the 1st card I picked to look for)
I have no doubt that there is stuff using sources that don't use the channels array (which is where the capping is coming from). I know for sure that the built in but disabled multiplayer player-to-player voice stuff just calls alGenSources directly. Also, as far as I know, the music system also bypasses ds.cpp. That is probably the reason that min sources is 32+16.
The patch was against the 3.6.14 branch with the patch from 2266 applied, sorry about that.
I have no idea. I also tried googling and it doesn't seem to be something that they (Creative at least) give away freely, I would have thought it would be listed on the spec sheets. You may have more luck googling for the number of "voices" that the card can do, which is how I found that a Creative Card (some X-Fi) does 128 in software, but there was no information about what the hardware could actually do.
|2012-07-04 22:03||iss_mneur||New Issue|
|2012-07-04 22:03||iss_mneur||Status||new => assigned|
|2012-07-04 22:03||iss_mneur||Assigned To||=> iss_mneur|
|2012-07-04 22:03||iss_mneur||File Added: openal_sources_checking.patch|
|2012-07-04 22:09||iss_mneur||Relationship added||related to 0002266|
|2012-07-04 22:10||iss_mneur||Note Added: 0013826|
|2012-07-05 08:57||niffiwan||Note Added: 0013831|
|2012-07-05 21:47||iss_mneur||Note Added: 0013835|