Jump to content

You're browsing the 2004-2023 VATSIM Forums archive. All content is preserved in a read-only fashion.
For the latest forum posts, please visit https://forum.vatsim.net.

Need to find something? Use the Google search below.

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


Francisco Trigo
 Share

Recommended Posts

Francisco Trigo
Posted
Posted

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:

Quote

Connecting...
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

Quote

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...

Regards

 

Link to comment
Share on other sites

Francisco Trigo
Posted
Posted

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.

Regards.

Link to comment
Share on other sites

Francisco Trigo
Posted
Posted

As I don't know how to fix the XSB, I have changed the client by Swift (https://swift-project.org/). It looks like it works better.

Link to comment
Share on other sites

  • 2 weeks later...
Christopher Collins
Posted
Posted (edited)

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

Francisco Trigo
Posted
Posted

Hy Christopher,

Thank you very much for the detailed explanation. I will review your references and read more about it.

Regards

Link to comment
Share on other sites

 Share