Jump to content

XSquawkbox / XPlane / Linux audio issues (fix ?)


Recommended Posts

Morning everyone. I'm a developer who is new to VATSIM.

I have had an issue with XSquawkbox connecting ; it would work maybe every other time, sometimes it would connect virtually every time, sometimes it wouldn't at all, sometimes it was either or. No errors appear on the screen or the log, it just fails to work even though it says you have voice capability and it pings (using a different output system I think)

It looks like more than one other person has had issues, so I thought I would put my fix seperately. (I do not know if the Windows problems are the same thing)

I think the problem is related to latency in pulseaudio's alsa plugin. It is described here https://juho.tykkala.fi/Pulseaudio-and-latency and I have raised it as an issue with AFV-Native here https://github.com/xsquawkbox/AFV-Native/issues/2 as my understanding is this code is used in XSquawkbox, Swift etc.

There are two ways to check it. One is to run XPlane in a terminal and try to connect. If there is a line something like "Expression 'PaAlsaStream_WaitForFrames( stream, &framesAvail, &xrun )' failed in 'src/hostapi/alsa/pa_linux_alsa.c'" this indicates this problem. Another is to see the latency by typing "pacctl list sinks | grep Latency" into a terminal, which should display the latency in us. If this is up close to 100,000 this may be the problem.

The solution is to change default-fragments and default-fragment-size-msec in /etc/pulse/daemon.conf (keep a backup copy in case it doesn't work). These are commented out by default on Arch and Ubuntu ; the values I have which seem to work reliably are 3 and 5 respectively (the defaults are 4 and 25 apparently). There doesn't appear to be any knock on effects yet. Slower machines than mine may struggle perhaps. These give a latency on my machine of about 15000us or thereabouts.

Link to post
Share on other sites
  • 1 month later...

I was having the same flaky audio and the `WaitForFrames` error. I did not see high latency in my `pacctl list links | grep Latency`. I applied your suggested changes to daemon.conf anyway, and it worked. Thank you so much!!

(btw, using Ubuntu 20.04 with an external USB audio interface. I select the "pulse" device in xSquawkBox audio config.)

Edited by James Preiss
add note on system
Link to post
Share on other sites

I don't think it matters. AFAICS (Arch Linux) it runs Pulse anyway if you have it installed, it uses the Pulse alsa emulation or Pulse direct.

It might not be the latency, it's not something I'm too knowledgeable about. But if it works :)

Link to post
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...