USB audio/MIDI devices


#1

Hi Jules,

My questions are specifically related to USB Audio/MIDI devices that use the generic OS drivers.

  1. Is it possible to get notification from the AudioDeviceManager when the audio/MIDI device list changes? In the situation I’m working with, it’s conceivable that the user will add or remove USB audio devices on the fly. I’ve thought of periodically polling the device names and detecting a change that way. This will not be foolproof though, since the device names are generic - “USB Audio Device” (in Windows anyway). The user could switch devices in between polls, and the names would look the same.

  2. Related to the above; if my application enables a USB MIDI device, and then at some point the user decides to unplug the device, juce continually generates asserts (the call to midiInAddBuffer in MidiInThread::writeBlock() fails). How should the application recover from this situation?

  3. My application is only concerned with MIDI, so I’m calling AudioDeviceManager::initialise() with 0 input and 0 output channels. This worked in version 1.46, but now in 1.50 an error is returned: “Can’t open the audio device! This may be because another application is currently using the same device - if so, you should close any other applications and try again!”. Ignoring the error does not seem to have any ill effects. Is it no longer valid to specify 0 I/O channels?


#2

Better notification of device changes is on my to-do-list…

And TBH I don’t think I’ve ever tried it with 0 ins and outs, so it might just be something simple that needs tweaking to allow it. There’s no reason why it should fail. Thanks - I’ll take a look at that soon.


#3

What is the current state of automatic MIDI device updating? Just wondering if we can avoid having to set up a separate poller thread which repeatedly calls MidiInput::getDevices() waiting for a change. We came across the MidiNotificationhttp://xmidi.com/docs/coremidi80.html class in CoreMIDI and assume there’s something similar in Windows, but were wondering what your plans were in terms of adding this kind of functionality into JUCE? Thanks!

J


#4

I may be working on a project shortly for which I’ll need to know about midi device removals, so will probably need to implement that…


#5

:smiley: