HardwareHeaven.com
Looking for the skin chooser?
 
 
  • Home

  • Reviews

  • Articles

  • News

  • Tools

  • GamingHeaven

  • Forums

  • Network

 

Go Back   HardwareHeaven.com > Forums > Hardware and Related Topics > kX Project Audio Driver Support Forum > Bug Reports


Reply
 
Thread Tools
Old Oct 6, 2003, 11:26 AM   #1
DriverHeaven Junior Member
 
Join Date: Oct 2002
Posts: 30
Rep Power: 0
kode54 is on a distinguished road

IDirectSoundBuffer::SetVolume()

Is it supposed to only work with the front left/right channels? If I create the buffer with the DSBCAPS_LOCSOFTWARE flag set, the SetVolume function works on all channels.
kode54 is offline   Reply With Quote


Old Oct 7, 2003, 06:38 PM   #2
kX Project Lead Programmer and Coordinator
 
Join Date: Dec 2002
Posts: 3,106
Rep Power: 73
Eugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud of

hmm.. that's strange
in user level there are no parameters for the SetVolume method
however, in =kernel= level the SetVolume function accepts a 'channel' parameter
and this parameter is 0..1, not 0..5...
sometimes it is =-1 (which means 'all the channels' -- and kX supports this)
that is, the kernel part of the direct sound engine doesn't wish to call provide our driver with the correct 'channel'..

please let me know if you find anything about this issue...
(and, btw, after some of =my= tests, I found out (well, it was long time ago) that software mixing behaves the same way -- at least, with WinDVD and similar tools)

/E
Eugene Gavrilov is offline   Reply With Quote
Old Oct 7, 2003, 08:00 PM Threadstarter Thread Starter   #3
DriverHeaven Junior Member
 
Join Date: Oct 2002
Posts: 30
Rep Power: 0
kode54 is on a distinguished road

User-level.

The buffer is created with 1, 2, 4, or 6 channels, using the flags DSBCAPS_GETCURRENTPOSITION2, DSBCAPS_STICKYFOCUS, and DSBCAPS_GLOBALFOCUS, and a WAVEFORMATEX structure defining the sample format. If creation fails, it copies WAVEFORMATEX to a WAVEFORMATEXTENSIBLE struct and adds a channel mask, KS_SPEAKER_MONO, STEREO, QUAD, or 5POINT1, depending on the number of channels.
kode54 is offline   Reply With Quote
Old Oct 7, 2003, 11:12 PM   #4
kX Project Lead Programmer and Coordinator
 
Join Date: Dec 2002
Posts: 3,106
Rep Power: 73
Eugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud of

>> If creation fails, it copies WAVEFORMATEX to a WAVEFORMATEXTENSIBLE

well, I think it should be done in reversed order...

but, anyway, I've added a 'compatibility' flag in the very recent driver release (3535rc2)
this flag is set by default
you can turn it off by running kxctrl -shw 18 <value>, where:
<value>
|= 0x100 -- clear the flag
0,1,2,3,4 -- preferred spatialization method (0 is the default; 4 - is 8-point -- for headphones)

===

I've double checked all the calls received by the driver -- the multichannel applications don't wish to set-up the volume for any channel>=2 -- and this is strange (according to WinXP DDK)

/E
Eugene Gavrilov is offline   Reply With Quote
Old Oct 8, 2003, 12:39 AM Threadstarter Thread Starter   #5
DriverHeaven Junior Member
 
Join Date: Oct 2002
Posts: 30
Rep Power: 0
kode54 is on a distinguished road

The application I am referring to is Foobar2000's fading DirectSound 2.0 output, which fades out its streams on seek, pause, and stop. A binary version of this output is included with the 0.7.1 beta installer located here. (Directory link in case there's a new beta before you see this.)

Most of the code in the standard DirectSound output is identical to the new output, except for the lack of SetVolume related code, since only the fading actually uses it. The source code to foo_output_std is included with the SDK. You'll have to ask Peter why he opted to try WAVEFORMATEXTENSIBLE after WAVEFORMATEX. Maybe its because its only a fallback, since it shouldn't be necessary for the generic 1/2/4/6 setups supported.

As for supporting >2 channel volume changing, as I said, this user-mode application is calling SetVolume, which only has a volume level parameter. Is the software supposed to create a 2 channel buffer for each pair of channels, and then try to ensure sample-exact synchronization between them all?

Last edited by kode54; Oct 8, 2003 at 12:46 AM.
kode54 is offline   Reply With Quote
Old Oct 8, 2003, 12:53 AM   #6
kX Project Lead Programmer and Coordinator
 
Join Date: Dec 2002
Posts: 3,106
Rep Power: 73
Eugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud of

>> try WAVEFORMATEXTENSIBLE after WAVEFORMATEX

as far as I remember, WAVEFORMATEXTENSIBLE is not required, while WAVEFORMAT(EX) is --
so, the new 'extensible' structure will never be used (since most drivers support EX version)

/E
Eugene Gavrilov is offline   Reply With Quote
Old Oct 8, 2003, 12:57 AM   #7
kX Project Lead Programmer and Coordinator
 
Join Date: Dec 2002
Posts: 3,106
Rep Power: 73
Eugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud of

>> as for supporting >2 channel volume changing, as I said, this user-mode application is calling SetVolume, which only
>> has a volume level parameter

yes, I know
there seems to be either a 'gap' in the DDK (it doesn't mention that the driver should set all the channels), or it is a bug in DirectSound...
or, under 'some-unknown-circumstances' DirectSound changes all the channels... who knows?..

anyway, 3535rc2 supports multichannel volume
(btw, according to the logs, it still receives two calls: one for '0 channel' and another for '1 channel' -- even if there are 5.1 channels opened...)

/Eugene
Eugene Gavrilov is offline   Reply With Quote
Old Oct 9, 2003, 07:13 PM Threadstarter Thread Starter   #8
DriverHeaven Junior Member
 
Join Date: Oct 2002
Posts: 30
Rep Power: 0
kode54 is on a distinguished road

I get this debug info for volume changes on 2 channel buffers:

kx_lib:
!! invalid ch(2) in audio_set_param [vol]
kx_lib:
!! invalid ch(4) in audio_set_param [vol]
kode54 is offline   Reply With Quote
Old Oct 10, 2003, 12:57 AM   #9
kX Project Lead Programmer and Coordinator
 
Join Date: Dec 2002
Posts: 3,106
Rep Power: 73
Eugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud of

ah, ok

I've added a 'hack' but haven't added a special check for 'generic' stereo voices
these messages should not affect anything (they are just warnings)

anyway, the 3535rc2 driver [the present one], even if displaying such messages, should not cause any problems with multichannel playback

/E
Eugene Gavrilov is offline   Reply With Quote
Reply

Bookmarks

Thread Tools