Possible Bug or Driver Incompatability w/ X-Station drivers


#1

Last night I installed the latest drivers for my Novation X-Station (1.2.1). Audio input for Direct-X mode doesn’t work. In my app, output is broken up, but see below for behavior in Tracktion3. When I looked at audioDeviceIOCallback in the debugger, all of the inputChannelData and outputChannelData pointers are null. This is true whether I broke upon first call or while the app was running awhile.

I tried Tracktion3 with the driver in DirectX mode and input does not work. Output works ok, but I didn’t do a comprehensive test.

The driver in ASIO mode appears to work ok, although I did notice some problems in longer recordings where audioDeviceIOCallback just stopped getting called. However, I’m not sure yet whether this is due to the driver or my code. I’m using the latest version of Juce on Windows XP Professional service pack 2.

I can install the old drivers or use ASIO so there’s a workaround. I’ve also reported the problem to Novation who manufactures the X-Station.


#2

It’s been a long time since I’ve heard of any compatibility problems with the juce audio drivers, so would guess that this is something weird that the driver is doing. The only way to find out more is to step through the code as it opens the driver and see what happens…


#3

I stepped through the code and the driver is opening ok. The reason for the empty pointers and subsequent exception is that my app is assuming that inputBuffers[i] for i=0, 1 is always non-zero. When the driver is opened by default (Primary Sound Device), left and right map to buffers 0 and 1. When explicitly opening X-Station/Direct X mode, left and right map to buffers 2 and 3.

I’ve corrected this in my app, but the problem of no input remains. InputChannelData is always zero for every sample. Input doesn’t work when running Tracktion through this driver as well. Output doesn’t work either. I stated that it worked in Tracktion in the original post, but it doesn’t (maybe I inadvertantly changed drivers?). The output isn’t zero since I’m fetching it from line in and the mixed files, but it sounds like it’s being played back at a sample rate that’s too low. But I checked the sample rate assignment when the driver was opened (in my app of course) and it was set to 44100.0.

I’m pretty sure it’s a bug in the Novation’s code but any other hints for debugging are welcome. I also have a question related to my app’s bug: can I assume that a stereo device will always have two consecutive input or output channels available. In other words, can I assume that if buffer[i] is the first non-zero buffer, then buffer[i+1] is also non-zero? The code in DSoundAudioIODevice::openDevice seems to support this.


#4

hmm - not sure what to suggest there. It’s worth asking novation, I guess.

And yes, it’s fair to assume that stereo channels are arranged in consecutive pairs. Lots of software will make that assumption, anyway.


#5

The problem is that the ASIO driver works but not the DirectX driver, same as the Novation drivers talked about in my earlier posts. Note that the behavior is the same in Tracktion as in my app. Also, just to make sure I wasn’t doing anything funky, I copied Jule’s fancy channel pointer packing code from AudioSourcePlayer instead of my algorithm for skipping null channels during the audio callback and the behavior was exactly the same (my algorithm requires 2 non-zero sequential channels, for example, inputChannelData[i] and inputChannelData[i+1]).

For the Line 6 drivers the problem is intermittent. Sometimes the DirectX driver successfully opens and everything works. Other times it fails when trying to open the DirectX capture device. There doesn’t seem to be any pattern when it fails. Sometimes you can get it to work by trying another driver and switching back or even changing the buffer size. It’s not an illegal buffer size as the same buffer size will work one time and fail the next. Each time it fails, Juce logs the error as “DS error at line 778 - No driver”. At this point in the code (juce_win32_DirectSound.cpp), Juce is trying to open the DirectX capture device which returns the “No driver” error.

I’m trying to stabilize my application and this is a major bug standing in the way. Any suggestions are appreciated.