audioDeviceIOCallback bug

And how does one find out which output of the soundcard is at which index?

Let’s say for instance, for this very example with my SiS7012: How do I know that the “Left” called output is at index 2 and the “Right” called output is at index 3?

They’ll be in the same order that they appear in the list of channel names.

Either I am misunderstanding the whole concept or it is simply not fully documented. In the JUCE docs it says:

“The channel data is arranged with the same array indices (comment: indices=indexes) as the channel name array returned by AudioIODevice::getOutputChannelNames(), but those channels that aren’t specified in AudioIODevice::open() will have null pointer for their associated channel, …”.

In my case (only for DirectSound, not ASIO), this is simply no true!
All my output channels are activated. “Left” is at indice (index) 0. “Right” is at indice 1 in the array returned by getChannelNames(), but in the outputChannelData array they strangely appear at indice 2 and indice 3, whereas at indice 0 and 1 (where they should appear, since activated) I have NULL pointers. This is in complete contradiction to the statement in the docs.

Please keep in mind that when I choose ASIO drivers everything’s ok! It’s only DirectSound where the indexes are not correct anymore.

Ok, I’ll take a look at that.

Thanks!

Hi Jules, did you have the time to look at the Directsound problem? Really want to support Directsound too in my app…

Sorry, not had time yet. Might be able to look at it next week.

I am struggling with the same issue now. Directsound on XP consumes 50% on each of my Intel dual core CPUs. On single CPU XP, it takes close to 100%. On Vista with dual core, strangely only one CPU is used, taking close to 100%. On MAC, it is not problem since it don’t use DirectSound. When switching sound output to ASIO or to none, the CPU consumption goes down dramatically.

I think this happend after I added graphics to my program, using the LookAndFeel class. But I am not sure.

Whenever some other program gets focus, the CPU consumption goes down, audio still running.

I’ve never seen a machine struggling like that with DSound, DSound does run a thread to do the processing, but it’s well behaved and shouldn’t hog the cpu. Unless maybe you’ve got a latency set that your card can’t handle, and that’s making it struggle?

As for the channel issue that was the main topic of this thread, I’ve got some updates for that, will check them in shortly.

As far as I remember, this CPU problem also occured on my computer, but rather randomly and not often.