[SOLVED] What should I do to make MX Linux pro audio?

Optimize your system for ultimate performance.

Moderators: khz, MattKingUSA

User avatar
protozone
Established Member
Posts: 181
Joined: Tue May 08, 2018 9:02 pm
Contact:

[SOLVED] What should I do to make MX Linux pro audio?

Postby protozone » Tue May 08, 2018 9:38 pm

Hi guys,

I am running an almost fresh version of MX Linux (17?) and I don't know much about it.
I used to used Ubuntu Studio and Xubuntu and had a heavy handful of tweaks and optimizations for those which worked.
Then I'd run Reaper over wine, and everything was great.

Right now I have just about everything i need installed except that I lost my list of tweaks and optimizations to avoid buffer underruns (xruns). I am pretty much linking to Debian Stretch, but I hardly know Debian except for a little bit of AVLINUX experience and occasionally installing Debian DEBs into the buntus.

Which types of optimizations are best to do for pro audio use?
I will be using the system to record MIDI with VST instruments and render them the WAVpack...
Last edited by protozone on Wed May 30, 2018 5:14 pm, edited 1 time in total.

User avatar
khz
Established Member
Posts: 1244
Joined: Thu Apr 17, 2008 6:29 am
Location: German

Re: What should I do to make MX Linux pro audio?

Postby khz » Wed May 09, 2018 6:54 am

FZ - Does humor belongs in Music?
GNU/LINUX@AUDIO ~ /Wiki $ Howto.Info && GNU/Linux Debian installing >> Linux Audio Workstation LAW
    I don't care about the freedom of speech because I have nothing to say.

Jack Winter
Established Member
Posts: 376
Joined: Sun May 28, 2017 3:52 pm

Re: What should I do to make MX Linux pro audio?

Postby Jack Winter » Wed May 09, 2018 10:37 am

IMO there are normally 2 things that need to be done.

1. Give your user the rights to run realtime threads and to lock memory. This is mostly done by editing a config file in /etc/security.
2. Give the soundcard interrupt a high realtime priority. Look for something like rtirq or udev-rtirq.
Reaper/KDE/Archlinux. i7-2600k/16GB + i7-4700HQ/16GB, RME Multiface/Babyface, Behringer X32, WA273-EQ, 2 x WA-412, ADL-600, Tegeler TRC, etc 8) For REAPER on Linux information: https://wiki.cockos.com/wiki/index.php/REAPER_for_Linux

User avatar
protozone
Established Member
Posts: 181
Joined: Tue May 08, 2018 9:02 pm
Contact:

Re: What should I do to make MX Linux pro audio?

Postby protozone » Thu May 10, 2018 1:00 am

Hey thanks guys! Already very helpful.

@Jack Winter, when you said to search for the rtirq stuff, what did you mean? :?:

Search with what? Search where? I already did the /etc/security thing you mentioned though. Thanks

In the meantime, I will read the other linked areas. Thanks very much. :D

User avatar
khz
Established Member
Posts: 1244
Joined: Thu Apr 17, 2008 6:29 am
Location: German

Re: What should I do to make MX Linux pro audio?

Postby khz » Thu May 10, 2018 6:14 am

protozone wrote:Search with what? Search where? I already did the /etc/security thing you mentioned though. Thanks

mx-package-manager or use Synaptic and with that you search for the packages (rtirq or udev-rtirq) and install them.
FZ - Does humor belongs in Music?
GNU/LINUX@AUDIO ~ /Wiki $ Howto.Info && GNU/Linux Debian installing >> Linux Audio Workstation LAW
    I don't care about the freedom of speech because I have nothing to say.

User avatar
Michael Willis
Established Member
Posts: 917
Joined: Mon Oct 03, 2016 3:27 pm
Location: Rocky Mountains, North America
Contact:

Re: What should I do to make MX Linux pro audio?

Postby Michael Willis » Thu May 10, 2018 3:42 pm

protozone wrote:@Jack Winter, when you said to search for the rtirq stuff, what did you mean? :?:


Learn more about rtirq here: https://wiki.linuxaudio.org/wiki/system_configuration

It may or may not help, depending on whether you have devices competing for IRQ use, and what order they are in.

For me, the best improvement was to use the RT kernel from AVLinux, as discussed here: viewtopic.php?f=27&t=18398 and here: http://bandshed.net/forum/index.php?topic=3719.0

Again, that depends on your hardware setup.

User avatar
protozone
Established Member
Posts: 181
Joined: Tue May 08, 2018 9:02 pm
Contact:

Seems to be working...

Postby protozone » Thu May 10, 2018 7:53 pm

@all,

Hey guys, thanks very much. I really appreciate the quick and effective help.
I was able to establish the audio group and to install the RT kernel stuff from the AVLINUX repo.

I installed the 4.9.x and the 4.14.x for 32-bit (of the RT kernels). Both seem to be OK for me so far.

Even though the system is MX Linux, it's also based upon Stretch, and it seems to be working fine already.
I was able to do a few of my PulseAudio optimizations for buffering and Reaper is working OK in Wine.
I also set the THREADIRQS kernel parameters for grub.

I don't yet have all the gear I need to test the setup, but so far I'm not getting any xruns while composing using the virtual keyboard in Reaper and with multiple tracks and some VSTs.

This has turned out to be much easier than all the tweaks I used to do for the Ubuntus.
I wasn't able to find the rtiq in Synaptic, but i'll try again later. I might not need it though.

Thanks very much for making this install so decent thus far. :)
If anybody wants to know the PulseAudio buffer settings I used, I will try and post those up later.

Other than that, I was sure to remove a bunch of stuff that I don't want to use. But I didn't disable much stuff at all.

User avatar
protozone
Established Member
Posts: 181
Joined: Tue May 08, 2018 9:02 pm
Contact:

Re: What should I do to make MX Linux pro audio?

Postby protozone » Sun May 13, 2018 4:37 am

OK, so I was able to test MIDI triggering with an M-Audio KeyStation 49es within 32-bit REAPER.
I am using WASAPI mode and PulseAudio manually set to low buffer sizes for Wine.

So far, everything is good. I just downloaded a bunch of freeware VST instruments, so I'll do some more tests.
Also, I will try and implement the HZ (MIDI) kernel tweak if I need to. The OS is MX 17 (32-bit PAE).

I have not installed the KX Studio repos, and I probably won't. But I did manually install a few graphics and sound programs and some other nice system stuff. Keeping a system lean is something I'm proud of.

Anyways, thanks again. You can't know how much time and sweat you saved me from wasting.

User avatar
protozone
Established Member
Posts: 181
Joined: Tue May 08, 2018 9:02 pm
Contact:

PulseAudio manual edits

Postby protozone » Thu May 24, 2018 1:41 am

If anybody is interested, here's what my /etc/pulse/daemon.conf looks like, manually edited for low-latency and some other stuff:

Code: Select all

# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

## Configuration file for the PulseAudio daemon. See pulse-daemon.conf(5) for
## more information. Default values are commented out.  Use either ; or # for
## commenting.

; daemonize = no
; fail = yes
; allow-module-loading = yes
; allow-exit = yes
; use-pid-file = yes
; system-instance = no
; local-server-type = user
; enable-shm = yes
; enable-memfd = yes
shm-size-bytes = 64 # setting this 0 will use the system-default, usually 64 MiB
; lock-memory = no
; cpu-limit = no

; high-priority = yes
; nice-level = -11

; realtime-scheduling = yes
; realtime-priority = 5

; exit-idle-time = 20
; scache-idle-time = 20

; dl-search-path = (depends on architecture)

; load-default-script-file = yes
; default-script-file = /etc/pulse/default.pa

; log-target = auto
; log-level = notice
; log-meta = no
; log-time = no
; log-backtrace = 0

resample-method = speex-float-1
; enable-remixing = yes
; enable-lfe-remixing = no
; lfe-crossover-freq = 0

; flat-volumes = yes

; rlimit-fsize = -1
; rlimit-data = -1
; rlimit-stack = -1
; rlimit-core = -1
; rlimit-as = -1
; rlimit-rss = -1
; rlimit-nproc = -1
; rlimit-nofile = 256
; rlimit-memlock = -1
; rlimit-locks = -1
; rlimit-sigpending = -1
; rlimit-msgqueue = -1
; rlimit-nice = 31
; rlimit-rtprio = 9
; rlimit-rttime = 200000

default-sample-format = s16le
default-sample-rate = 44100
alternate-sample-rate = 48000
default-sample-channels = 2
; default-channel-map = front-left,front-right

default-fragments = 4
default-fragment-size-msec = 2

enable-deferred-volume = no
deferred-volume-safety-margin-usec = 8000
deferred-volume-extra-delay-usec = 0


The last few lines are the most important. The default-fragments are multiplied by the default-fragment-size-msec to give the approximate millisecond latency buffer, so mine is set for 8 milliseconds instead of 8 seconds or whatever the default used to be (long and annoying.)

Also, I edit this...

In the default.pa file, I edit this section to include the "tsched=0" parts. This I have heard can help fix transport problems in Reaper and other Windows programs by disabling a type of timing synch scheduling or something. It seems to help a lot. This is at about lines 45 or so. Also, I delete the section for autoloading of bluetooth stuff since I don't use bluetooth at all and always disable it. But you might not have to do that. I also do this type of edit in the system.pa file (both in /etc/pulse/):

Code: Select all

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect tsched=0
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect tsched=0
.endif

User avatar
protozone
Established Member
Posts: 181
Joined: Tue May 08, 2018 9:02 pm
Contact:

Re: [SOLVED] What should I do to make MX Linux pro audio?

Postby protozone » Tue Jun 05, 2018 1:35 am

if your soundcard is 24-bit there's a line above that should probablyl be like this:

Code: Select all

default-sample-format = s24le


instead of this: (16-bit soundcard, such as the Alesis 320 USB)

Code: Select all

default-sample-format = s16le


Sorry about that.
Also, check the settings in your audio programs to see which they prefer.
It's worth it to look at the entries within OpenShot>preferences>audio codecs supported>...
You'll see entries starting with PCM_ (pulse code modulation; which is normal digital audio).

In addition to PCM_s16le and PCM_s24le you'll find a whole bunch of others.
If on a Mac with built-in sound, the "le" should be "be" most likely, but not for sure.

I think floating point (IEEE float, 32-bit floating point) would be this: (NOT TOTALLY SURE ABOUT THIS)

Code: Select all

default-sample-format = f32le


A few of some other entries in OpenShot...: f64be, f32be, s8 (8-bit!), and even alaw (an old non-linear low-tech format)

I know that ALSA complains or fails if it gets mismatched bit resolutions between it and it's in-use audio programs, such as Audacious or DeadBeef. But PulseAudio seems to be able to convert seamless(R)ly.

It's worth installing QasMixer and also using the pavucontrol (pulse audio volume control/config) if they aren't already there.
QasMixer is a lot easier than ALSAmixer and doesn't disrupt JACK nor PulseAudio. I use it to see what all my levels are and to disable or enable them. For what it can't do, PulseAudio's volume control and of course JACK can do the rest.

Also, for MIDI validation, I try and install Patchage so that I can see at a glance if my MIDI keyboard is being recognized and what it's official tech name is.

I hope this is helpful.

User avatar
protozone
Established Member
Posts: 181
Joined: Tue May 08, 2018 9:02 pm
Contact:

PULSE AUDIO MANUAL EDITS FOR LOW-LATENCY

Postby protozone » Tue Jun 05, 2018 1:38 am

protozone wrote:If anybody is interested, here's what my /etc/pulse/daemon.conf looks like, manually edited for low-latency and some other stuff:

EDIT (June 4th, 2018): fixed the bit resolution, 16-bit --> 24-bit

Code: Select all

# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

## Configuration file for the PulseAudio daemon. See pulse-daemon.conf(5) for
## more information. Default values are commented out.  Use either ; or # for
## commenting.

; daemonize = no
; fail = yes
; allow-module-loading = yes
; allow-exit = yes
; use-pid-file = yes
; system-instance = no
; local-server-type = user
; enable-shm = yes
; enable-memfd = yes
shm-size-bytes = 64 # setting this 0 will use the system-default, usually 64 MiB
; lock-memory = no
; cpu-limit = no

; high-priority = yes
; nice-level = -11

; realtime-scheduling = yes
; realtime-priority = 5

; exit-idle-time = 20
; scache-idle-time = 20

; dl-search-path = (depends on architecture)

; load-default-script-file = yes
; default-script-file = /etc/pulse/default.pa

; log-target = auto
; log-level = notice
; log-meta = no
; log-time = no
; log-backtrace = 0

resample-method = speex-float-1
; enable-remixing = yes
; enable-lfe-remixing = no
; lfe-crossover-freq = 0

; flat-volumes = yes

; rlimit-fsize = -1
; rlimit-data = -1
; rlimit-stack = -1
; rlimit-core = -1
; rlimit-as = -1
; rlimit-rss = -1
; rlimit-nproc = -1
; rlimit-nofile = 256
; rlimit-memlock = -1
; rlimit-locks = -1
; rlimit-sigpending = -1
; rlimit-msgqueue = -1
; rlimit-nice = 31
; rlimit-rtprio = 9
; rlimit-rttime = 200000

default-sample-format = s24le
default-sample-rate = 44100
alternate-sample-rate = 48000
default-sample-channels = 2
; default-channel-map = front-left,front-right

default-fragments = 4
default-fragment-size-msec = 2

enable-deferred-volume = no
deferred-volume-safety-margin-usec = 8000
deferred-volume-extra-delay-usec = 0


The last few lines are the most important. The default-fragments are multiplied by the default-fragment-size-msec to give the approximate millisecond latency buffer, so mine is set for 8 milliseconds instead of 8 seconds or whatever the default used to be (long and annoying.)

Also, I edit this...

In the default.pa file, I edit this section to include the "tsched=0" parts. This I have heard can help fix transport problems in Reaper and other Windows programs by disabling a type of timing synch scheduling or something. It seems to help a lot. This is at about lines 45 or so. Also, I delete the section for autoloading of bluetooth stuff since I don't use bluetooth at all and always disable it. But you might not have to do that. I also do this type of edit in the system.pa file (both in /etc/pulse/):

Code: Select all

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect tsched=0
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect tsched=0
.endif

User avatar
protozone
Established Member
Posts: 181
Joined: Tue May 08, 2018 9:02 pm
Contact:

Re: PULSE AUDIO MANUAL EDITS FOR LOW-LATENCY

Postby protozone » Tue Jun 05, 2018 1:42 am

Ooops, sorry about the wierd posting format. I was trying to fix some typos.

EDIT (June 4th, 2018): fixed the bit resolution, 16-bit --> 24-bit

By the way,

Code: Select all

resample-method = speex-float-1
was tested by some audio gurus guy a few years ago against other resample methods in terms of CPU benchmarks and audible sound quality. This is apparently already the fastest high quality one, so it shouldn't be changed to anything else unless you are just experimenting or have some other special use.

protozone wrote:
protozone wrote:If anybody is interested, here's what my /etc/pulse/daemon.conf looks like, manually edited for low-latency and some other stuff:

EDIT (June 4th, 2018): fixed the bit resolution, 16-bit --> 24-bit

Code: Select all

# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

## Configuration file for the PulseAudio daemon. See pulse-daemon.conf(5) for
## more information. Default values are commented out.  Use either ; or # for
## commenting.

; daemonize = no
; fail = yes
; allow-module-loading = yes
; allow-exit = yes
; use-pid-file = yes
; system-instance = no
; local-server-type = user
; enable-shm = yes
; enable-memfd = yes
shm-size-bytes = 64 # setting this 0 will use the system-default, usually 64 MiB
; lock-memory = no
; cpu-limit = no

; high-priority = yes
; nice-level = -11

; realtime-scheduling = yes
; realtime-priority = 5

; exit-idle-time = 20
; scache-idle-time = 20

; dl-search-path = (depends on architecture)

; load-default-script-file = yes
; default-script-file = /etc/pulse/default.pa

; log-target = auto
; log-level = notice
; log-meta = no
; log-time = no
; log-backtrace = 0

resample-method = speex-float-1
; enable-remixing = yes
; enable-lfe-remixing = no
; lfe-crossover-freq = 0

; flat-volumes = yes

; rlimit-fsize = -1
; rlimit-data = -1
; rlimit-stack = -1
; rlimit-core = -1
; rlimit-as = -1
; rlimit-rss = -1
; rlimit-nproc = -1
; rlimit-nofile = 256
; rlimit-memlock = -1
; rlimit-locks = -1
; rlimit-sigpending = -1
; rlimit-msgqueue = -1
; rlimit-nice = 31
; rlimit-rtprio = 9
; rlimit-rttime = 200000

default-sample-format = s24le
default-sample-rate = 44100
alternate-sample-rate = 48000
default-sample-channels = 2
; default-channel-map = front-left,front-right

default-fragments = 4
default-fragment-size-msec = 2

enable-deferred-volume = no
deferred-volume-safety-margin-usec = 8000
deferred-volume-extra-delay-usec = 0


The last few lines are the most important. The default-fragments are multiplied by the default-fragment-size-msec to give the approximate millisecond latency buffer, so mine is set for 8 milliseconds instead of 8 seconds or whatever the default used to be (long and annoying.)

Also, I edit this...

In the default.pa file, I edit this section to include the "tsched=0" parts. This I have heard can help fix transport problems in Reaper and other Windows programs by disabling a type of timing synch scheduling or something. It seems to help a lot. This is at about lines 45 or so. Also, I delete the section for autoloading of bluetooth stuff since I don't use bluetooth at all and always disable it. But you might not have to do that. I also do this type of edit in the system.pa file (both in /etc/pulse/):

Code: Select all

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect tsched=0
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect tsched=0
.endif

ubuntuuser
Established Member
Posts: 277
Joined: Mon Jan 02, 2017 9:46 am

Re: [SOLVED] What should I do to make MX Linux pro audio?

Postby ubuntuuser » Wed Jun 06, 2018 4:56 am

Liquorix Kernel

Debian install instructions work for MX Linux

https://liquorix.net/

https://forum.mxlinux.org/viewtopic.php?t=43202

User avatar
protozone
Established Member
Posts: 181
Joined: Tue May 08, 2018 9:02 pm
Contact:

Re: [SOLVED] What should I do to make MX Linux pro audio?

Postby protozone » Mon Jun 18, 2018 1:43 am

ubuntuuser wrote:Liquorix Kernel
Debian install instructions work for MX Linux
https://liquorix.net/
https://forum.mxlinux.org/viewtopic.php?t=43202


Wow thanks!
I've been OK with the AVLINUX RT kernel, but I'll give that one a try too! :mrgreen:

I appreciate the direct and concise help.

If anybody else is interested, I am in the early steps of writing an E-Book on implementing a Linux DAW from nearly scratch.
It won't be pro-grade, but should be helpful still since I will try to include every DAW tweak I ever implemented on my own Linux systems, hopefully almost step by step. So far it's kinda hard to write this documentation, but I have a rough outline and I will try to improve it after I get the first draft made.

I just downloaded "Sigil", the E-Book editor authoring program today, so the final format will be easier to read. I'll try to make a PDF version too, and an HTML archive version too, and maybe an XPS and probably an MHT version.

The goal is to give everyone on the internet my full list of techniques I used to go from Windows crashing on a used computer to installing a Linux distro to making it a DAW to deleting Windows to optimizing the Linux DAW.

Originally, I was just going to upload a tutorial on PulseAudio. But I realised that part of what makes WINE programs possible for Pro Audio use is the several other DAW optimizations/tweaks. So I decided I might as well just write this stuff down and upload all of it publicly and make it public domain. I got most of the tweaks from other public domain publishers anyhow.

It probably won't be ready till the end of the summer, but I will be happier when it's done because I don't like the idea of a bunch of very useful tools going unused simply because there's not a centralised manual while the info is "out there".

Till then, Peace, and thanks to everybody on this site and similar sites who has made my Linux Musician life possible!

User avatar
Michael Willis
Established Member
Posts: 917
Joined: Mon Oct 03, 2016 3:27 pm
Location: Rocky Mountains, North America
Contact:

Re: [SOLVED] What should I do to make MX Linux pro audio?

Postby Michael Willis » Mon Jun 18, 2018 5:44 pm

protozone wrote:I am in the early steps of writing an E-Book on implementing a Linux DAW from nearly scratch.

Wow, that's ambitious! If you're willing, please share early drafts as you go. I think you'll have better results if you incorporate feedback early and often. I'm willing to at least read through your material and share my opinions.

Since there are so many ways to go about producing music on Linux, everybody kind of finds their own way of doing things. To write a book, you have to decide if you want to write about how to explore the many options, or more like "this is how I did it and what works for me", or a hybrid approach. One way can cover a lot of breadth, the other can have more focus and depth.


Return to “System Tuning and Configuration”

Who is online

Users browsing this forum: No registered users and 2 guests