Author Topic: Microphone goes missing?  (Read 6291 times)

FearNaBoinne

  • Guest
Microphone goes missing?
« on: January 05, 2017, 07:23:41 AM »
Sometimes (usually after I've left VA running overnight for some reason) I return to find VA no longer listening.

It turns out it then has a 'No audio device detected' message in the log and a red microphone icon in the titlebar, even though I changed nothing compared to the night before, when I left.

The microphone is USB connected, and sometimes I hear a USB disconnect sound when I am not at my machine, but happen to be within earshot. Whenever that happens, I can almost be certain I'll have the problem next morning.

I am surmising that for some reason the PC does a USB disconnect/reconnect (I'm sure it does a reconnect because the microphone *will* be on and working, despite VA not seeing it), and VA not picking up on it...

The only way to make it work again then is to go in to the settings and press the change now button for the default audio recording device...

Would it be possible to build somekind of trigger for that and automatically reset it? Or a priority list for it to use, so it can always try and set the topmost *available* device to default?

Will it always use the system default recording device or the system default communications recording device?
(I assume it has to be the default device because you're using the MS Windows voice engine?)

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2826
Re: Microphone goes missing?
« Reply #1 on: January 05, 2017, 09:11:06 AM »
Hi, there.  I had just moved this into, 'Ex-issues', but it's similar to your situation:

http://voiceattack.com/smf/index.php?topic=657.0

VoiceAttack uses the Windows speech engine which normally works with your default recording device.  There's no plan to have VA figure out what your preferred device would be, as that would mean it would have to monitor whether or not the device that Windows has designated, 'default' is currently your, 'preferred device'... and then, I guess, tell Windows to change the device automatically.  Probably would not ever work right and I would guess that it would frustrate more than help.  You'll probably want to do what's indicated in that thread and set up a hotkey to execute a command that changes the default recording device.

Hope that helps!

FearNaBoinne

  • Guest
Re: Microphone goes missing?
« Reply #2 on: January 06, 2017, 02:14:11 AM »
I was just going to test that (As it was down again) after I checked the Windows default recording device in the Sound control panel applet. As I was creating a new command with the set audio device action, it suddenly said "Default audio recording device detected." and is back to working as expected.

Is there a way to detect *when* it thinks there is no microphone anymore? I mean: you post a message and set an icon when that happens, so VA must know about that state...

It'd be great if we could:
  • Get the current playback and recording devices (something like {VA_CURRENT_PLAYBACK_DEVICE} & {VA_CURRENT_RECORDING_DEVICE})
    Check VA's current recording status (a {VA_MICROPHONE_AVAILABLE} perhaps)
    Set the current playback and recording devices by name (using {VA_CURRENT_PLAYBACK_DEVICE} & {VA_CURRENT_RECORDING_DEVICE} to reconfirm the current one)

IDK the codebase (And I *obviously* don't know how busy you are) but the first two should be somewhat trivial*... The third one would require a significant change in the existing function, I assume...

Another thing I was thinking, due to the alternative solution for the switching issue (which you so quickly and effectively fixed) where we needed to load a looping command to do the switching for us, was that it would be great if we could indicate whether we want the auto-run function to run only when it's profile is loaded directly, or always (ie also when it is somewhere in a chain of 'Include commands from another profile'), as that would have allowed me to start the switcher function from it's own profile, without me having to create an auto-execute function in each profile I loaded**... This again may or may not be trivial, depending on how the current code for that is written.

* I used to be a developer once, and know C/C++/C#/VB/VB.NET/PERL/etc pretty well, so I know about the (im)possibilities and pitfalls of coding...  ;)
** Just thought: even nicer would be an extra setting to allow us to chose the function to run on inclusion separately. That way we can chose the same function if we want, or a different one if we'd need to...

gawain

  • Guest
Re: Microphone goes missing?
« Reply #3 on: January 06, 2017, 08:11:08 AM »
I'm experiencing the same problem, though in my case it's happening as I'm using voice attack.
If I'm quiet for too long without giving commands (haven't clocked it but it feels like a minute) it will start telling me that there is no mic.

I had a virtual audio cable installed, and disabling that made it so that after a while it will activate the mic again, but usually I have to go in to setting and activate the mic as the default one again.

I'm also experiencing voice attack muting my entire computer for a few seconds when this is happening, but it turns the audio on again when it detects the mic.

I haven't used voice attack in a few years, and never with this headset (Logitech g430), but needless to say it is impossible to use the program while this bug exists.

Sincerely
Gawain

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2826
Re: Microphone goes missing?
« Reply #4 on: January 06, 2017, 10:03:44 AM »
VA uses the Windows speech engine to do it's thing.  That is the only interaction with the recording device.  In the beginning, if you unplugged your headset, VA would crash outright, as the speech engine would cause it to do so (no default device exception or whatever).  Then, a try/catch was put around that exception and a message would pop up in the log that would indicate that your recording device was no longer available.  You would then have to restart VA if you plugged your headset in.  Well, that's ok, but it's not ideal.  You find out that a lot of people actually switch recording devices while using the software (tabletop mic to headset, webcam to headset, headset to tabletop, etc).  So, VA now detects if your device is detached and keeps the speech engine from blowing up until Windows says, 'hey... there's a recording device'.  VA doesn't make any decisions at this point, because that device can be anything.  The speech engine is then allowed to continue with the attached device (which may or may not be the same). 

If the mic is dropping out and causing VA to stop responding, this is an atypical behavior and is rooted in your hardware/driver/windows configuration and is something you are going to need to work on.  VoiceAttack works with what Windows is telling it to do, and is set up to, 'handle' more common anomalies and is not set up to figure out individual situations.  Side note:  I've used the Logitech G series headsets for development (and my son continues to use them) with VoiceAttack without issue. 

There are tokens for checking the current audio devices... '{STATE_DEFAULTRECORDING}' and '{STATE_DEFAULTPLAYBACK}'.  There are also actions that can be used Other > Windows > Change Default Audio Devices to change your system default devices, plus there are options in the audio tab for setting devices, *and* there are command line parameters that can be used with VA that can either affect the running instance *or* be run without VA even being launched (use with a desktop shortcut or something like Slickrun...  added for my own use).  So, somewhere between the tokens and the actions and command line, you should be able to drum up a solution for your situations.  I'm not sure I want to add any more to this, as I think it's kind of over-engineered already for this context o_O

Hope that helps!

gawain

  • Guest
Re: Microphone goes missing?
« Reply #5 on: January 06, 2017, 11:16:25 AM »
Well, I assume that in my case it has todo with the headset automuting itself when there is no input. I have only one input and output device enabled on my computer so it's not that it's switching between anything.
Tried to google to see if there was some setting I could do in windows or within the logitech software to turn that feature off but I was unable to find anything. Possible that it's something else going on with my computer too, but I didn't experience any problems with the audio/mic until I used VA today.

Too bad there's no fix for it. I did enjoy VA when it was working.

Edit: my problem seems to have with to elite dangerous and my specific headset todo. It's strange though cause everything worked dandy yesterday, but now for some reason the problem started appearing. Seems like I'm not the only one.

But at the very least my problems seems to not be linked to FearNaBoinnes problems.

//Gawain
« Last Edit: January 06, 2017, 03:20:23 PM by gawain »

FearNaBoinne

  • Guest
Re: Microphone goes missing?
« Reply #6 on: January 09, 2017, 03:34:38 AM »
VA uses the Windows speech engine to do it's thing.  That is the only interaction with the recording device.  In the beginning, if you unplugged your headset, VA would crash outright, as the speech engine would cause it to do so (no default device exception or whatever).  Then, a try/catch was put around that exception and a message would pop up in the log that would indicate that your recording device was no longer available.  You would then have to restart VA if you plugged your headset in.  Well, that's ok, but it's not ideal.  You find out that a lot of people actually switch recording devices while using the software (tabletop mic to headset, webcam to headset, headset to tabletop, etc).  So, VA now detects if your device is detached and keeps the speech engine from blowing up until Windows says, 'hey... there's a recording device'.  VA doesn't make any decisions at this point, because that device can be anything.  The speech engine is then allowed to continue with the attached device (which may or may not be the same). 

If the mic is dropping out and causing VA to stop responding, this is an atypical behavior and is rooted in your hardware/driver/windows configuration and is something you are going to need to work on.  VoiceAttack works with what Windows is telling it to do, and is set up to, 'handle' more common anomalies and is not set up to figure out individual situations.  Side note:  I've used the Logitech G series headsets for development (and my son continues to use them) with VoiceAttack without issue. 

There are tokens for checking the current audio devices... '{STATE_DEFAULTRECORDING}' and '{STATE_DEFAULTPLAYBACK}'.  There are also actions that can be used Other > Windows > Change Default Audio Devices to change your system default devices, plus there are options in the audio tab for setting devices, *and* there are command line parameters that can be used with VA that can either affect the running instance *or* be run without VA even being launched (use with a desktop shortcut or something like Slickrun...  added for my own use).  So, somewhere between the tokens and the actions and command line, you should be able to drum up a solution for your situations.  I'm not sure I want to add any more to this, as I think it's kind of over-engineered already for this context o_O

Hope that helps!
I think it mostly will! Thanks so much!!!

I went through the existing tokens, but thought that these just represented the configured default devices, and not the actual default devices currently in use... Now I reread the descriptions I realize it misread the text. (Just not too thrilled about the memory leak warning <G>)

The only challenge now will be to figure out when it is in the 'no voice engine' state...
However since I posted this I have replaced the short USB lead between USB hub (generic) and USB microphone (SB Omni Surround) to a long USB lead directly to a USB port on my computer, and it's been rock solid since (although VA did crash on me today when executing a command, it did at least recognise it and try to execute it! :P )

I'm not sure I am willing to go back, just to test a solution for a problem I hope to not encounter again!  ;)

That leaves just the option to autoexecute a selected command of an included profile from my entire list of ideas...  ::)