upgraded kxs from 12.04 to 14.04 Midi Latency [Solved]

Unofficial support for the KXStudio Linux distribution and applications.
More info at http://kxstudio.linuxaudio.org/

Moderators: MattKingUSA, khz

Post Reply
ahellquist
Established Member
Posts: 62
Joined: Mon Jul 01, 2013 12:28 am
Has thanked: 4 times

upgraded kxs from 12.04 to 14.04 Midi Latency [Solved]

Post by ahellquist »

Everything seems to work but I now have latency when playing my live software plugins

Before the upgrade I had no x-runs and really low latency so things was perfect.

Now after the upgrade, I have the very same settings (almost sure) for jack, 48k/256/2 and that is usually not noticeable to me at all.
I feel like my problem is more on the midi input side but am not sure.

My setup is:

core i7 laptop using onboard intel soundcard, carla running setBfree and others controlled by an external m-audio oxygen 61 controller via usb cable.

I have tested my old rtirq settings as well as a few other things but could really use a thoughtful suggestion :?:

a realtime quicscan gives the following output

Code: Select all

aht@aht-H710:~/temp/realtimeconfigquickscan$ perl ./realTimeConfigQuickScan.pl
== GUI-enabled checks ==
Checking if you are root... no - good
Checking filesystem 'noatime' parameter... 3.13.0 kernel - good
(relatime is default since 2.6.30)
Checking CPU Governors... CPU 0: 'performance' CPU 1: 'performance' CPU 2: 'performance' CPU 3: 'performance' CPU 4: 'performance' CPU 5: 'performance' CPU 6: 'performance' CPU 7: 'performance'  - good
Checking swappiness... 10 - good
Checking for resource-intensive background processes... none found - good
Checking checking sysctl inotify max_user_watches... >= 524288 - good
Checking access to the high precision event timer... readable - good
Checking access to the real-time clock... readable - good
Checking whether you're in the 'audio' group... yes - good
Checking for multiple 'audio' groups... no - good
Checking the ability to prioritize processes with chrt... yes - good
Checking kernel support for high resolution timers... found - good
Kernel with Real-Time Preemption... not found - not good
Kernel without real-time capabilities found
For more information, see http://wiki.linuxaudio.org/wiki/system_configuration#installing_a_real-time_kernel
Checking if kernel system timer is set to 1000 hz... found - good
Checking kernel support for tickless timer... found - good
== Other checks ==
Checking filesystem types... ok.
not found.
** Warning: no tmpfs partition mounted on /tmp
   For more information, see:
   - http://wiki.linuxaudio.org/wiki/system_configuration#tmpfs
   - http://lowlatency.linuxaudio.org
** Set $SOUND_CARD_IRQ to the IRQ of your soundcard to enable more checks.
   Find your sound card's IRQ by looking at '/proc/interrupts' and lspci.
cat /proc/interrupts

Code: Select all

           CPU0       CPU1       CPU2       CPU3       CPU4       CPU5       CPU6       CPU7       
  0:         33          0          0          0          0          0          0          0  IR-IO-APIC-edge      timer
  1:        445        523        506        547        457        425        437        456  IR-IO-APIC-edge      i8042
  8:          0          0          0          0          0          1          0          0  IR-IO-APIC-edge      rtc0
  9:         45         59         60         61         66         40         38         32  IR-IO-APIC-fasteoi   acpi
 12:      84281     121792     104136      96436      95947      95029      92233      88403  IR-IO-APIC-edge      i8042
 16:          0          5          0          2          0          0          0          0  IR-IO-APIC-fasteoi   mmc0, yenta
 17:         17          7         12         13         11         12         20         12  IR-IO-APIC-fasteoi   snd_hda_intel
 19:          2          1          3          2          0          0          4          1  IR-IO-APIC-fasteoi 
 22:         23         29         28         29         25         34         27         29  IR-IO-APIC-fasteoi   ehci_hcd:usb2
 23:         14         14        854        788        430         63         14          9  IR-IO-APIC-fasteoi   ehci_hcd:usb1
 40:          0          0          0          0          0          0          0          0  DMAR_MSI-edge      dmar0
 42:          0          1          0          0          0          0          0          0  IR-PCI-MSI-edge      xhci_hcd
 43:          0          0          0          0          0          0          0          0  IR-PCI-MSI-edge      xhci_hcd
 44:          0          0          0          0          0          0          0          0  IR-PCI-MSI-edge      xhci_hcd
 45:          0          0          0          0          0          0          0          0  IR-PCI-MSI-edge      xhci_hcd
 46:          0          0          0          0          0          0          0          0  IR-PCI-MSI-edge      xhci_hcd
 47:          0          0          0          0          0          0          0          0  IR-PCI-MSI-edge      xhci_hcd
 48:          0          0          0          0          0          0          0          0  IR-PCI-MSI-edge      xhci_hcd
 49:          0          0          0          0          0          0          0          0  IR-PCI-MSI-edge      xhci_hcd
 50:          4          3          2          4          4          4          5          3  IR-PCI-MSI-edge      rtsx_pci
 51:       4820       3397       8934       6044       4983       3597       8233       5174  IR-PCI-MSI-edge      ahci
 52:          0       2354          0          1          0          2          1          2  IR-PCI-MSI-edge      eth0
 53:          3          1          3          1          2          3          5          5  IR-PCI-MSI-edge      mei_me
 54:     258818         68         60         78         70         71         73         68  IR-PCI-MSI-edge      iwlwifi
 55:     182599     288553     259680     230458     220627     201021     192585     191731  IR-PCI-MSI-edge      snd_hda_intel
 56:      31810      49254      45375      50046      39118      37453      32212      30707  IR-PCI-MSI-edge      nouveau
NMI:         48         23         46         24         44         25         49         34   Non-maskable interrupts
LOC:    1100084    1205511     948734    1187576     939756     389806    1124952     548673   Local timer interrupts
SPU:          0          0          0          0          0          0          0          0   Spurious interrupts
PMI:         48         23         46         24         44         25         49         34   Performance monitoring interrupts
IWI:      31062       4744      32254       6827      32952       9027      33719       7748   IRQ work interrupts
RTR:          0          0          0          0          0          0          0          0   APIC ICR read retries
RES:     165997     144717     244972     127525     168324     105750     145830      92543   Rescheduling interrupts
CAL:      30302      31324      27502      32999      27055      32963      28927      33757   Function call interrupts
TLB:      18793      13071      19141      13405      20689      16903      17951      14868   TLB shootdowns
TRM:          0          0          0          0          0          0          0          0   Thermal event interrupts
THR:          0          0          0          0          0          0          0          0   Threshold APIC interrupts
MCE:          0          0          0          0          0          0          0          0   Machine check exceptions
MCP:         17         17         17         17         17         17         17         17   Machine check polls
ERR:          0
MIS:
lsusb -t

Code: Select all

aht@aht-H710:~/temp/realtimeconfigquickscan$ lsusb -t
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 5000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/3p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/8p, 480M
        |__ Port 3: Dev 3, If 0, Class=Hub, Driver=hub/4p, 12M
            |__ Port 2: Dev 5, If 0, Class=Chip/SmartCard, Driver=, 12M
        |__ Port 4: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M
        |__ Port 4: Dev 4, If 1, Class=Wireless, Driver=btusb, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/3p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M
        |__ Port 2: Dev 5, If 0, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 2: Dev 5, If 1, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 6: Dev 4, If 0, Class=Video, Driver=uvcvideo, 480M
        |__ Port 6: Dev 4, If 1, Class=Video, Driver=uvcvideo, 480M

Last edited by ahellquist on Fri Jan 01, 2016 5:48 pm, edited 1 time in total.
asbak
Established Member
Posts: 897
Joined: Thu Sep 11, 2014 3:04 pm
Has thanked: 71 times
Been thanked: 64 times

Re: upgraded kxs from 12.04 to 14.04

Post by asbak »

What is output of uname -a
Some Focal / 20.04 audio packages and resources https://midistudio.groups.io/g/linuxaudio
ahellquist
Established Member
Posts: 62
Joined: Mon Jul 01, 2013 12:28 am
Has thanked: 4 times

Re: upgraded kxs from 12.04 to 14.04

Post by ahellquist »

uname -a

3.13.0-74-lowlatency #118-Ubuntu SMP PREEMPT Thu Dec 17 23:46:00 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
ahellquist
Established Member
Posts: 62
Joined: Mon Jul 01, 2013 12:28 am
Has thanked: 4 times

Re: upgraded kxs from 12.04 to 14.04

Post by ahellquist »

To give a little perspective:

It used to work just like any of my hardware synths or keyboards with absolutely no detectable latency but now there is a small but obvious latency that is at least really annoying. It is possible to play live but I need to fix this and I appreciate the questions and suggestions so far and upcoming ones too.

I will download avlinux and check if there is a difference in midi latency or not. I hope to find the cause and help others avoid this lag.

I have an other box i my studio that runs the same kx 14.04 that have the exact same noticeable lag even with imho good jack buffer settings but that box has never been used with other versions ov kx or audio distros so this upgrade nade me believe that there is something regressing the low latency behaviour on the usb or midi side.. since i dont expect x-runs I do not think it is the audio device performance that is the problem.
asbak
Established Member
Posts: 897
Joined: Thu Sep 11, 2014 3:04 pm
Has thanked: 71 times
Been thanked: 64 times

Re: upgraded kxs from 12.04 to 14.04

Post by asbak »

I don't use KX,

So all I can suggest is to try starting jack from terminal or with qjackctl (instead of using the KX related stuff like Cadence, jackdbus etc) and see if that makes any difference.
I'm on Mint 17 (basically Ubuntu 14.04) and have no latency issues running at 48K/128/3 with a USB interface.

If it still doesn't work well, the next thing I would try (after disabling jackdbus etc) is to install the latest version of jack2 from github and to run that instead of whatever version of jack is currently installed.
Some Focal / 20.04 audio packages and resources https://midistudio.groups.io/g/linuxaudio
ahellquist
Established Member
Posts: 62
Joined: Mon Jul 01, 2013 12:28 am
Has thanked: 4 times

Re: upgraded kxs from 12.04 to 14.04 Midi Latency [Solved]

Post by ahellquist »

Found the problem and the solution..

I wish I posted this anonymously but anyways, here is what's happend..'
Sometime between my different kxstudios someone somehow happend to mess with the Onkyo Reciever in the living room (or rehearsal room as I call it) and changed the AUX Direct mode to AUX Stereo or AUX Pure Audio.
One of those modes apparently use some dsp magic that introduces just enough latency to make my life miserable (ok, a bit exaggerated) but my live gig life worse.
Fiddling with avlinux did of course not change the latency but changing a few things on the receiver did.

Anyway, thanks for your suggestions.

Happy 2016

/Anders
Post Reply