Basic setup in Linux

Ok so long story short, I installed a new ssd today for the express purpose of installing linux on, so I still have my old windows install I can go back to without having to partition drives and whatnot. I’m trying to get Renoise setup and I am just really failing here. I’m struggling pretty hard to wrap my head around Jack and ALSA and the seemingly endless configuration software for them.

I have:

-One install of Linux Mint 17.1 Cinnamon

-One audio interface (Scarlett 2i2)

-One midi keyboard M-Audio KeyRig 49

What I have accomplished so far:

-Renoise installed

-Midi keyboard works

-Can get sound out of Renoise

What I am having trouble with:

-Recording input

-Crackles unless I set a stupidly high buffer

-Sometimes sound stops working, not even any meter action

-Plugins, but then, I’ll leave plugins for another day.

In Preferences, the Device type options are ALSA and Jack. If I choose ALSA it bitches at me about RT threads, but it lists my audio interface. Ultimately no sound. But if I choose Jack, it won’t let me select my audio interface. But sometimes I get sound. Well, it will work at first (with crackles) and then inexplicably stop working until I log off and on.

I followed the instructions in the wiki for editing limits.conf and

As I type this I went back and that folder after relogging has a bunch of shit it in now whereas before it was just the limit.conf file, and the contents of that file are completely different, so I added the instructed lines and I’m going to relog again to see if that fixes it BRB

______________________________________________________________________________________________

Ok partial success. It no longer bitches at me about RT threads, crackles are gone (I think, for now at least), and line input works. So now my problem is, and now I have almost no idea where to begin troubleshooting this, is that the input sucks. It’s has this digital distortion on top of it.

Ok so that gets better if I play with the buffer and periods… is there a trick for balancing these for optimal latency, or do you just kind of have to guess and play with it until it’s as good as you can get it?

edit: Ok, so, changing the buffer and periods seems to be completely random. Sometimes increasing the buffer increases the distortion, sometimes it decreases it, toggling a period back and forth can end up with completely different results in distortion amount…

edit: Ok everything is having the bitcrushing style distortion now after trying to adjust the buffer and periods. Honestly I have no idea what to do here, changing these settings does change the distortion, but it’s really inconsistent. A setting of 64 and 3 can sound almost completely perfect except for some light hissy crackle (that I definitely still want to get rid of) and then I try to adjust it from there and horrific bitcrushing distortion is back. Change it back to 64 and 3 which sounded better before, but that sounds terrible now, nothing but digital noise. I can’t find any kind of pattern to this…

edit: Ok I feel like I’m in a horror film. Line input works on Jack now, and so far no crackles. I have no idea why it works now.

edit: My… sound no longer works at all, I literally don’t have a speaker icon anymore?

edit: Relogged, no speaker icon still, all my sound devices are missing from sound settings window now. I have absolutely no idea. I had previously launched, recorded a riff, then closed Ardour without saving, then tried to use Festige, and opened Renoise and that’s when I noticed my sound had just, gone away.

edit: I ran the command that checks if alsa is running and that fixed it for some reason.

edit: Spoke too soon. Sound works in Renoise, and nothing else. But speaker icon is back, and it lists my devices, just, no sound (except in Renoise).

edit: and midi keyboard no longer works.

I recommend adding the kxstudio repos and installing cadence, it makes dealing with jack a lot easier. It also gives you a nice graphic way to see your connections all in one place.

Jack is exclusive, like asio in windows, so if it is running you won’t hear other things from the system. However, you can bridge alsa and pulseaudio to jack so you can run jack all the time if you like and your internet browser, media player, renoise will all play all at once without you messing around connecting and starting audio servers. Again, cadence makes this a breeze, it’s not so easy with qjackctl from what I’ve seen.

64/3 might be a bit ambitious, depending on your hardware and what you want to do. Raise 64 to 256 or even higher for the moment, you need to eliminate causes of the problems you’re having. Once you get a stable sound coming out then start to lower your settings. Leave the periods/buffer on 2 or 3, it is the buffer size that you should look at first.

Lastly, there are a number of quite important tweaks you can make to your system, I think the arch wiki has good information on this area. Make sure you are in the audio group, things like that.

If you’re not too attached to your current install you could just install the kxstudio or avlinux distros, all settings will be ideal for you and things should just work. If not, I think kxstudio has a package called kxstudio-settings or something that will make some important tweaks.

If you need some real time help then try the #opensourcemusicians irc channel on freenode, you’ll get help there with this.

I actually did install the kx repositories. Just don’t really understand Jack and alsa and pulseaudio and everything. I did try kxstudio the other day and I just really disliked the desktop environment.

Anyways in my quest to fix my nonrenoise sound I followed some instructions I found to reinstall Pulseaudio. I rebooted afterwards and somehow this absolutely fucked my install. I wish I can remember the name of the mode it said it was going into, but it was like a black desktop that showed some icons but didn’t display them properly, and I couldn’t access anything, no menus, it was really weird. I reinstalled Mint and somehow now I can’t boot back into Windows (I could prior to reinstalling mint). I don’t know wtf I did, when I open the drive with windows on it, everything is clearly still there, but when I try to boot that disk it goes into grub rescue.

edit: Posted to Mint forums to see if they could help with that but since it’s my first post it has to be approved by a mod before it’ll even post. Not Renoise related but if anyone knows anything about this I’m going to copy paste here:

I’ve searched the forum and found similar issues, but nothing quite exactly what I’m getting. So here’s what I’ve done:

  • Installed a new SSD specifically for LInux Mint, so I can keep my windows install completely intact on its own harddrive.

  • I now have 4 internal harddrives and 2 external USB, only 2 of the internal are SSD’s.

  • Installed Mint for the first time on the new SSD. Everything went fine. Could boot into windows or Mint. Version was 17.1 Cinnamon.

  • Was trying to configure various things regarding sound, and botched the entire install somehow after installing Pulseaudio. When I booted into mint, everything was dark black, could see desktop icons, couldn’t access anything, it looked really screwed up. Decided to just reinstall from scratch.

  • Reinstalled from scratch, told it write over the existing Mint Rebecca install, on the correct SSD.

Now I’m sure somehow I did something wrong to cause this, maybe I should have deleted the partitions the installer made the first time I installed Mint before reinstalling, or chose a different install option. I don’t feel very confident with setting up partitions for Linux installs yet, I really don’t quite know what I’m doing and always follow guides step by step. Now what is happening is:

I choose my SSD with Windows on it from the boot menu, and it gives me a black screen that says:

Error: no such device: 43047b95-8029-481d-befd-c93cd93a6460
Entering rescue mode...
grub rescue> _

Now I’m in Mint right now, and it is working fine. But I really need to be able to get into Windows. I can see that drive from Mint, and everything is still on it, but maybe some stuff is on it that shouldn’t be? I’ve attached a screenshot of the contents of that drive.

I didn’t recognize some of nonfolders in there, like bootmgr and swapfile.sys, which sounds like Linux stuff. So I tried moving those into a folder and booting from the drive. It didn’t work so I moved them back.

Also another oddity, in the boot menu (when I press F11 on boot to get the drive list) selecting the drive with Mint on it ALSO goes to grub rescue thing, but I have a listing I didn’t have before called “ubuntu” and selecting it boots me into Mint.

So in short, I kind of feel like it might be as simple as deleting some files from the Windows drive, but I don’t really know.

I did try searching the forums, as is the custom, but seems like everyone else is dualbooting on a single partitioned physical harddrive, and I don’t know if their woes are related to my woes. I browsed some of the topics, and couldn’t find a fix for me, but maybe my problem is that I just don’t know what to search for.

I can’t imagine what you could’ve done but I suspect your booting in to windows issue will be easy to solve, you probably just need to do something with grub. I have no experience with that though.

Why were you reinstalling pulseaudio? As far as I know pulseaudio is required by Cinnamon so you shouldn’t have been able to uninstall it through your package manager. To be honest, it sounds like you’re making things a lot more complicated than they need to be. If/when you’re ready screenshot cadence settings and say which bridges you have enabled, if any.

My sound wasn’t working outside of Renoise even with Renoise closed, and a random suggestion from a google search said to reinstall pulse audio, so that’s why I tried.

I think I found an answer to boot problem, but I have to wait for these updates to finish to try it. Once I get windows working again (and stop panicing) I’ll give configuring Linux audio another go. I entered the commands on KX’s website to install the repositories, but I didn’t see any of the things it was supposed to install listed under my apps, so I don’t know maybe I just don’t understand what those commands were supposed to do. So I installed several apps individually from KX’s website. I don’t know if that screwed something up? I don’t know, but starting over with a fresh install now. BRB gonna see if this thing fixes my windows boot problem

edit:

Did not work. Instructions were on the grub menu to input this:

set boot=(hd0,msdos6)
set prefix=(hd0,msdos6)/boot/grub
insmod normal
normal

But when I put in insmod normal it says error: no such partition.

If you have a Windows install disk it should see the win partition and you could try to fix boot and mbr from there.see this (https://help.ubuntu.com/community/RestoreUbuntu/XP/Vista/7Bootloader)
When logged back into windows install a little program called easy bcd and set your flags right.
You should have a working system after that!

I actually tried the bootrec thing already and it added “Windows Boot Manager” to the list of bootable items, but selecting it does nothing, it just refreshes the list.

edit: Gonna try it with the ubuntu disk. Downloading it now, and, guess it’s time to look up how to prep a flash drive on linux.

edit: Oh, I just have something called USB Image Writer installed already. That’s convenient.

edit:

Oh thank Linus god of Linux boot-repair from ubuntu worked, I am typing this from my windows installation, everything intact.

Thank you very much Belzrebuth!

I need to preface this by saying that I have no experience with using audio interfaces with Linux, so some of the things I’ll say may or may not apply to you.

First things first. I’d suggest reading this very illuminating article on the way audio works in Linux: http://tuxradar.com/content/how-it-works-linux-audio-explained.

Basically, audio in Linux is comprised of several layers. The first layer is ALSA, the backbone of all Linux audio. The second layer can be PulseAudio or Jack. PulseAudio was not designed for audio production and has high latency, and in fact, most DAW’s won’t even allow you to use it. Jack, on the other hand, has great latency and contains various pro audio features, such as audio redirection.

A couple of things to note here. While Jack gives you great latency, it’s still siting on top of ALSA, which means that it can’t give you better latency than you’d get when using ALSA directly. If you don’t need Jack’s features, it’s perfectly fine to use ALSA.

Another thing to note, is that Jack and PulseAudio can work together, so you don’t necessarily have to forfeit one to use the other… in theory. In practice, there are several ways you can go about doing this, but none of them have worked for me personally. (here are some methods you can try:Link 1,Link 2)

The seemingly easiest way to do it, is to install and use Cadance, a Jack control program that is supposed to be able to bridge Jack and PulseAudio. Unfortunately, a couple of months ago, when I tried using it in my Ubuntu 14.04 installation, Cadance suffered from a bug which disabled PulseAudio altogether. If that’s still an issue, I suspect it might be the reason why you lost your audio. If you really need Jack, then perhaps it might be a good idea to install QJackCtl, which is another Jack control program (you should be able to find it in your software center).

Another possible reason why you lost your audio might be because Jack was still running in the background. If Jack and PulseAudio are not bridged, then Jack will assume full control over ALSA, and therefore over your soundcard, whenever you start it. The way you stop Jack from running is by opening a terminal and typing “killall jackd”.

Next, I strongly suggest installing a low latency kernel. This is pretty much going to take care of your sound crackling situation, and it’s going to allow you to use Renoise at a decently low buffer.

OnUbuntu-based distros (such as Linux Mint), it’s pretty simple. You can read a guide on how to do ithere. There’s a lot that’s written in that guide, but really, all you need to do is to open a terminal and type: “sudo apt-get install linux-lowlatency linux-headers-lowlatency”. After that’s done, restart, boot into Linux Mint, open a terminal again, and type “uname -r”, which should confirm that you’re using the low latency kernel. And that’s it!

Hope you’ve found some of this useful.

Thank you very much, that is some fantastic information. That does sound like why I probably lost my sound. I guess my main problem was that because I didn’t really understand ALSA and Jack I tried to do too many things at once. I think first things first is to install the low latency kernal and run Renoise with just ALSA.

Then I guess, the way I’m understanding it now, is that in order to run some plugins, and things like VST hosts, which seem to run externally and pipe their audio, I would need Jack for that.

I don’t really need any instrument plugins. I feel like I can easily do everything I need to do with samples (including recording my guitars into the sampler). But I’m almost definitely at some point going to want to get some windows VST effects running just for amp sims and cab impulse loading. I think Renoise’s convolver is ok for reverbs but cab impulses really sound straight up bad in it.

But then, I also might just start recording my amp, and then I’d really just need a good way to process my bass to replace my beloved SHB-1.

Thank you very much, that is some fantastic information. That does sound like why I probably lost my sound. I guess my main problem was that because I didn’t really understand ALSA and Jack I tried to do too many things at once. I think first things first is to install the low latency kernal and run Renoise with just ALSA.

Then I guess, the way I’m understanding it now, is that in order to run some plugins, and things like VST hosts, which seem to run externally and pipe their audio, I would need Jack for that.

I totally forgot to cover plugins.

First of all, what you need to know is that you can’t use Windows or Mac plugins in Linux. You can only use plugins that are packaged specifically for Linux. So, a Windows VST, for instance, is not going to work. You would need a VST that is packaged for Linux. Here’s a list of such plugins.

Second of all, in Linux, telling Renoise where your plugins are located is a different process than it is in Windows. By default, Renoise searches several locations in Linux for plugins that it can use, and you can input your own location via a command in the terminal if you want to. You can read about that here. One of the default locations that Renoise looks in is “home/.vst”, which I think is the most convenient to use. The Renoise FAQ claims that you need to create a folder for each type of plugin (.vst, and .ladspa), but in my experience, that doesn’t seem to be the case. I’ve put non-VST plugins in the .vst folder and they worked fine.

Also, note that in Ubuntu (and I’m assuming Linux Mint), folders that start with “.” are hidden, so if you can’t see the “.vst” folder after you’ve created it, just tell your file manager to show hidden files.

Lastly, you do not need Jack in order to use plugins in Renoise. However, if you plan to use Renoise along with things like external instruments and audio tools that can’t be used as plugins, then yes, you’d need Jack in order to make use of the multiple audio streams. In theory, ALSA should be capable of doing that as well, but I haven’t figured out how to do it.

Oh that reminds, Uhe plugins are in beta for Linux! Gonna load up Zebra tonight.

As far as Windows VSTs go, it was my understanding that these worked with wine to make that possible:

http://www.joebutton.co.uk/fst/

http://breakfastquay.com/dssi-vst/

http://festige.sourceforge.net/

I only ever tried dssi-vst before and never could get it to work, but that was a long time ago when I didn’t even fully understand the concept of distros.

edit: Oh yeah, forgot, those require the vst sdk don’t they… that’s probably why I gave up on it last time.

try this http://www.kvraudio.com/forum/viewtopic.php?f=259&t=415929&sid=e7c68378675e60e55f719363fc2bbb86

I got Renoise reinstalled, installed the low latency kernal, did the limit.conf edit in the renoise manual, and after playing around with buffer settings found a combo with almost zero latency (despite the high ms renoise claimed it should be). Then I added a large .xrni and suddenly, everything is bitcrushed again. Went back into preferences and did nothing but somehow, that fixed it. Weird.

Thanks for the link, I’ll definitely check that out.

Try to have either low latency or stable sound with high cpu loads, you’re not going to get both at once. On an OS it is a trade of between these two things.

You can have some settings for mixing and other settings for playing live.

Oh that reminds, Uhe plugins are in beta for Linux! Gonna load up Zebra tonight.

As far as Windows VSTs go, it was my understanding that these worked with wine to make that possible:

http://www.joebutton.co.uk/fst/

http://breakfastquay.com/dssi-vst/

http://festige.sourceforge.net/

Sorry, I don’t have any experience with running plugins via Wine.

I got Renoise reinstalled, installed the low latency kernal, did the limit.conf edit in the renoise manual, and after playing around with buffer settings found a combo with almost zero latency (despite the high ms renoise claimed it should be). Then I added a large .xrni and suddenly, everything is bitcrushed again. Went back into preferences and did nothing but somehow, that fixed it. Weird.

The truth of it is that low latency is not exactly the strong point of Linux. Even with all the tweaks we’ve done so far, you still have to be a bit careful when choosing the buffer you want to use. You may be thinking that you’ve stumbled on to the perfect buffer for you, only to find that your audio turns to bitcrushed mess when you try to work on a bigger project. You have to prepare for that in advance. A good way to do that, is to load a project that has a lot of tracks or a lot of instruments playing at the same time, play it, and try different buffer values, until you find one that can handle the project.

Hey man, I dig your pain. I’ve been there (audio setup in linux) quite a while before, too. Can be real pain to get it working.

As you’re still fidgety & eager to get it working, I can only recommend you NOT to follow every xyz “tutorial” you find in the internet in some blogs or whatever - lots of people spread uninformed stuff there. Also linux evolves quickly, so much stuff that’s older than a year or whatever might not be relevant any more, outdated.

You’re using an usb-device? Your main problem is that “bitcrush” distortion you say? How exactly is it like, more like fast stutter or more like a real bitcrusher discretizing the sound? Does jack actually show x-runs when you try to use it? What would jack or dmesg logs spit out in such situations? I generally use jack instead of direct alsa access in audio apps, because it can be configured in better ways that most apps provide, you can easily interconnect and record audio apps, you can combine multiple audio interfaces if you know how to and can live with resampling, and there’s possibiliy of sharing audio for the browser or mp3-player or whatever. Maybe with more info someone who knows a bit of the buissiness can come up with a solution.

Realtime/lowlatency kernels can be quite nice to get things stable, and have better midi timing. I remember having to use it, and configure softirq-thread priorities to counter issues with proprietary graphics card drivers, and other devices. Don’t try to aim for ultra low latencies when using stuff like renoise, I mean you’re trying to use an audio daw and not to analyse radar signals. Like with many soundcards roughly around 5ms might be enough for example monitoring a microphone or guitar with software effects while singing/playing it the same time, or to have responsive feel when playing softsynths on a keyboard. If you don’t monitor something you’re actively producing at the same time with software chains in between, I’d alway choose higher latency for stability. Low latency always means higher cpu load and more chances for dropouts at a certain load, even when the system is halfways made realtime/lowlatency capable. It can depend a bit on the whole actual hardware it’s running on, from the sound interface, to the port it’s connected with, the chipset on the mobo etc.

Other than that I’ve often heard from recording people that linux can actually be tuned better for realtime and be made much more stable than windows. But sometimes Hardware irks around, and just won’t fit right. Remember, in windows you’ll have drivers directly from each manufacturer of the device, while linux is often bound to “generic” drivers, stuff that has been reverse engineered, or stuff that’s based on datasheets that don’t contain a relevant irk or two that might be important. Not too many manufacturers release datasheets or contribute to driver projects, other than stuff that’s university bound or generics being used in offices where linux is used in buisiness-manner. Realtime audio is not such a niche.

Man, been thinking… I don’t think what I like is Linux, I think I just really like Cinnamon. God I love this desktop. Anyways for now everything seems to be working fairly well, so I’m not going to rock the boat for a bit. Just gonna dig in and record some guitar and arrange some drums.

^^ All good advice. What would be cool is if an interface maker started supporting Linux like Nvidia did. I’d definitely throw my money at them.

Also to use windows vst on Linux, you can have a look to:

I feel like it’s just completely random, when I launch Renoise in Linux, whether it’s just going to work, or if it’s going to have crackles again for no apparent reason.

Make sure you go to /etc/pulse/ and edit the file client.conf…

set the “autospawn = no”… the line probably needs to be unqouted. save the file.

the easy way now is to reboot…

ALWAYS remember that you need to start up jack first, your window manager and all the soundapplets probably loads up pulseaudio by it self, which is okay, but if autospawn isn’t set to no, you cant kill pulseaudio, because it constantly respawns itself, which is great for situations where pulseaudio crashes. But what is even more great is being able to have full control over it…

My workflow when using jack is following. I let the qjackctl interface load up the jack server, you have to set it in qjackctl’s options, and also set it to kill the jackserver on exit. When I have loaded up jack and qjackctl I restart pulseaudio, and everything works…

On a commandline it would look like:

qjackctl &

pulseaudio -k

pulseaudio --start

you should now see a Pulseaudio Jack Sink being added in the qjackctl interface…

If you have had anything such as browsers opened before you loaded the jack server and restarted pulseaudio you need to restart these programs.

Remember that there are multiple versions of jack, such as jack, jack2 jack2dbus… if you’re on a linux system which uses systemd, which most of them does, I recommend installing the jack2dbus version… Remember to go to qjackctl’s options and make sure it knows to use the dbus option.

You can also use jack from commandline, play around with commands like jack_control status, jack_control start etc etc… you learn a lot from it… the qjackctl interface is just a lot easier.

Remember Jack is just a “server” handling sound…

Remember to add your user to the audio group edit the /etc/group file

Remember Jack needs to be started as the first thing, before anything else… It’s always running on my computer, even if I’m gaming or watching movies…

The interface for pulseaudio/general sound is called “pavucontrol”, the sound applet on your taskbar most likely links to it.

Hope this helps…