Jump to content

Ups! "failed to open audio device: Device unavailable" on Linux

Francisco Trigo

Recommended Posts

Hello chaps!

I am really exited that on the last XSquawkBox release there is no need a separate voice client, marvelous!

Well, after updating accordingly the software to the latest... I run the sim... I am in the cabin... set my radios... and... nothing is heard!!! nooooo!

Something fishy is going on, I can read in a window inside the sim the audio is connected:


Connecting to Voice.
 server (pvt): Welcome back to VATSIM! Our new voice technology is now live - if you have any questions or need support visit vats.im/audio for required downloads, instructions and tutorial videos. If you need further support visit the Audio for VATSIM forums at vats.im/afv

After trying different outputs configurations (all of them) it was time to take a look in the logs...

So in the logs I could see that there is an issue with the sound... although it does not clarify if it is with the input or the output. Anyway the following lines can be found in the log.txt


XSB-AFV-Native: Sat Aug 15 18:07:26 2020: APISession: API Token Expires in 3600 seconds
XSB-AFV-Native: Sat Aug 15 18:07:26 2020: afv_native::Client: Connected to AFV API Server
XSB-AFV-Native: Sat Aug 15 18:07:26 2020: afv::Client: Voice Session Connected
XSB-AFV-Native: Sat Aug 15 18:07:26 2020: afv::Client: Initialising Audio...
XSB-AFV-Native: Sat Aug 15 18:07:29 2020: AudioDevice: Opening 1 Channel, 48000Hz Sampling Rate, 960 samples per frame
XSB-AFV-Native: Sat Aug 15 18:07:30 2020: AudioDevice: failed to open audio device: Device unavailable
XSB-AFV-Native: Sat Aug 15 18:07:30 2020: afv::Client: Unable to open audio device.
XSB-Console: Voice Connected.
XSB-AFV-Native: Sat Aug 15 18:07:30 2020: APISession: got 76 station aliases.

It's funny that although it has an issue, the output in the window says "Voice Connected".

After trying many different things, I run out of ideas... maybe it is due to permissions issues, or there is another dependency I do not know...



Link to comment
Share on other sites

I have been doing more testing.

I've noticed that when my microphone is disconnected I can hear the communications! I can also change freqs using all my radios. But if by any reason I disconnect XSB and connect it again I cannot hear anything. The only fix is to exit the sim, boot it again and connect to XSB... now I can hear communications again.

So I think I may found two different issues here.

- When my USB microphone is connected all TX and RX are broken. I cannot hear anything and in the logs I can see the trace "Unable to open audio device."

- Without the microphone connected I can hear the cooms only the first time I am connected to XSB. If by any reason I am disconnected, once I connect XSB back again I cannot hear any communications. The only solution I have found to fix that is to reboot the sim.


Link to comment
Share on other sites

  • 2 weeks later...

The log told you everything we know:  For whatever reason, in that attempt, Portaudio can't open your devices - because we're using the portaudio API to do synchronised full-duplex audio, we don't actually get told which device failed by the API.  (see the source at https://github.com/xsquawkbox/AFV-Native/blob/master/src/audio/PortAudioAudioDevice.cpp#L89 - we do a single open for both paths and report what we get told by the portaudio interface)

Ultimately, this is not an XSB or AFV-Native bug, something in your config just doesn't like the parameters we're using or you're trying to bypass an audio server if you have one configured and the device is not being yielded.

Without knowing how you configured your audio devices inside XSB, and what sound servers you may have running, there's nothing more to say.

If you don't know how Linux audio works, you should be using the default ALSA target (usually pulse) and using the Pulseaudio controls in your windowing environment to map which devices you want to use. 

Please also be aware that there's an known issue with Ubuntu's pulseaudio config that another user reported that requires some minor config changes for reliable operation.  I've not yet verified this, so it's not in any documentation yet.

Edited by Christopher Collins

XSquawkBox - Developer/Maintainer


Please post any support related questions to the XSquawkBox support forum rather than private messaging me, thanks.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

  • Create New...