[WT-support] Contest recorder: recording from USB device

dl2alf dl2alf at arcor.de
Tue Sep 25 22:44:05 CEST 2012


Hi,
 
Our contest crew is running several portable configurations of Win-Test
together with USB sound cards for recording RX audio (V4.7.0 + Microkeyer +
USB sound cards).
Configuration of the contest recorder within Win-Test is proved, most of the
24 contest hours everything is running fine. 
For some reason the connection to the USB sound card is lost for a moment.
This might be caused by EMI, driver problems or if someone diconnects the
USB cable by mistake.
If that happens you will get the following behavior:

- recording stops without error message (neither from Win-Test nor from
operating system)
- the MP3 output file is not written anymore
- beside recording, Win-Test is fully operational that time, so this might
be unnoticed for a long time (you will loose hours of RX recordings that
way!)
- the situation won't change if the USB sound card is back again
- if you try to stop capturing, Win-Test hangs and must be closed via Task
Manager

To reproduce this just do the following:

- connect an USB sound card to your PC (can be a Microkeyer internal USB
sound card as well)
- start Win-Test
- open contest recorder window and go to the MP3 configuration menu
- set the recording sound device to that USB sound card input, don't care
about the other options
- start recording
- disconnect the USB sound card while recording
- (optional: connect the USB sound card again)
- try to stop recording 

--> Win-Test hangs as a result

I did some investigations to find out what's going on there. For that, I was
writing some software for audio capturing based on C# and .NET and using
Microsoft DirectSound and Lame as an audio compressor. ( it's just a "proof
of concept", the source code is available on request). I guess that this is
basically the same idea as used in Win-Test. 
Here is what I could find out so far:

- the above mentioned behavior is NOT depending on the operating system
(tested on WinXP and Win7)
- the above mentioned bevavior is NOT depending on Win-Test version (tested
up to V4.7.0)
- it seems, that the Microsoft DirectSound subsystem simply stops working,
when the USB sound card is disconnected -->  you won't get any software
exception as a notification
- any thread in the software layers above consuming kind of "Audio data
available" event just hangs in an infinite loop
- while trying to stop audio capture, a software exception is generated
called "NoDriverException" (which is too late and is probably not handled by
Win-Test)

To aivod this and to get a more robust software, I'd suggest the following
improvements in Win-Test:

- periodically check the increasing length of the MP3 output file while
recording
- if the length is not increasing anymore, something is wrong with the audio
source (it might be lost or disconnected), so do:
- stop recording asynchronously and handle the upcoming "NoDriverException"
properly
- periodically check for the previosly selected audio device is present
again, if yes:
- resume recording


I'd like to know if somebody else has experienced the same and likes to get
into a discussion on that topic. Any answer is highly appreciated.

Best regards,

Frank, DL2ALF at DL0GTH



More information about the Support mailing list