JACK xruns because of Wifi - Any workarounds?

Talk about your MIDI interfaces, microphones, keyboards...

Moderators: MattKingUSA, khz

Post Reply
TheAxeMan
Established Member
Posts: 3
Joined: Wed Jan 31, 2018 10:10 pm

JACK xruns because of Wifi - Any workarounds?

Post by TheAxeMan »

Hi everyone,

I've recently been running into a bad problem with xruns since I moved. Unfortunately, I can't connect my desktop PC via cable any more, so I got myself a wireless PCI card: TL-WN851ND (Atheros AR9227 chipset). Other than that, I'm using Ubuntu Studio 16.04 and a small M-Audio M-Track USB interface. The card seems to work fine, but whenever I have the network activated, I get a few (audible) xruns every couple of minutes. Needless to say, playing back any audio is rather irritating at this point.

For recording, I could disable my WiFi-card. However, I also use JACK for system playback, since I need the JACKRack EQ to tune my speakers, as they are very bass-heavy, otherwise.

Is there any way to make JACK and my WiFi-card work together, so that I can play back audio and be connected to the internet at the same time, without getting periodic sound glitches? Or is there another model I could get? (Although I wouldn't like getting yet another card, but if it works, that's fine.)

I'm grateful for any suggestions or tips on what can be done in this case. Thanks in advance!


Kind regards :)
Brynildsen
Established Member
Posts: 29
Joined: Tue Nov 28, 2017 12:30 pm

Re: JACK xruns because of Wifi - Any workarounds?

Post by Brynildsen »

I have an old linksys wrt54GL I got for free. I have flashed the firmware in it with openWRT, in order to make it do some more advanced stuff that has been disabled by the manufacturer. One of these things is to make its wireless connect to the main wifi on the ISP/router in the other end of the house.

To describe it simple: My pc is connected to the hacked router sitting about 6 feet away from the computer with just a standard lan cable. The hacked router takes care of all the wifi from there.

Lots of routers can be flashed, lots of older routers are dirt cheap. This way you can avoid having any wifi cards on your machine, avoid firmware/driver issues breaking on updates, connection failing on heavy load etc.. but still "use wifi". This is the most stable "wifi" connection I have ever had. :)

There are alternatives to openwrt, like dd-wrt, tomato, LEDE etc.. look it up, it won't cost much. But make sure you find a router that is compatible and can run its own tiny linux distro. And read description carefully so you don't brick it when performing the flashing of it.
"Arch/i3-wm/Bitwig/Renoise/Guitarix/Airwave/a couple of winVST's"
"i7-6700K 4ghz, gtx910ti, 16gb ram" + "X201s-i7-640LM 2.13ghz, 8gb ram"
"Presonus 22vsl + Scarlett 2i2 2.gen."
gimmeapill
Established Member
Posts: 564
Joined: Thu Mar 12, 2015 8:41 am
Has thanked: 44 times
Been thanked: 8 times

Re: JACK xruns because of Wifi - Any workarounds?

Post by gimmeapill »

Some ideas that do not involve extra HW:

- Tweak your IRQ priorities.
Make sure you have IRQ Threading enabled, and that jack + audio interface priorities are higher than that of your wireless interface (use rtirq if necessary).
Linuxaudio being down at the moment (due to being compromised over the week end), I cannot post a link to the wiki, but you should find a few related posts on this forum. This will probably not eliminate, but should at least reduce the dropouts.

- I have the feeling that people complain about wifi performance when they have in fact an issue with NetworkManager performance.
This thing is slow as hell and is a resource hog (although to be fair, it seems to have improved a bit over the years).
I would recommend Intel's Connman as a lighter and faster network management daemon: https://01.org/connman
& If you really need a GUI, I've had good experience with cmst: (https://github.com/andrew-bibb/cmst)

I have this setup on two machines with the aforementioned IRQ threading / priority (= common audio performance tuning), and no particular issue with wifi scanning even at low latency.
The problem is that NetworkManager is the de facto standard on most distros and might not be easy to replace on *buntu, but you get the idea...
User avatar
magicalex
Established Member
Posts: 193
Joined: Sun Jan 24, 2016 6:34 pm
Has thanked: 130 times
Been thanked: 7 times
Contact:

Re: JACK xruns because of Wifi - Any workarounds?

Post by magicalex »

I've had this problem on many different setups and have found that it's sufficient to stop networkmanager from periodically scanning for networks by running

Code: Select all

sudo killall -STOP NetworkManager
(after the initial connection has been made)
fraslo
Established Member
Posts: 57
Joined: Sun Jun 28, 2015 2:51 pm
Has thanked: 2 times
Been thanked: 8 times

Re: JACK xruns because of Wifi - Any workarounds?

Post by fraslo »

Hi,

you can try buying a cheap router which is able to act as a "wireless bridge". You can connect your router with your WLAN and connect your PC with the router.

The Edimax BR-6428nS V4 can act as a wireless bridge.

Frank
TheAxeMan
Established Member
Posts: 3
Joined: Wed Jan 31, 2018 10:10 pm

Re: JACK xruns because of Wifi - Any workarounds?

Post by TheAxeMan »

Hey guys,

thank you for your suggestions! I had to remove the WiFi-adapter again, because it raised my CPU frequency by 500 MHz for whatever reason and I went with an access point instead of a hacked router, which works fine.

It might actually have been an issue with the Ubuntu network manager, I wasn't able to find out, as the WiFi card was thermal-throttling my CPU quickly and I had to remove it asap.

The router was a great idea though and that access point does the job, as well. Another lesson learned, I suppose.
Post Reply