When you play in a band, you have to rehearse somewhere. Let's try at home to collect your mixer with the effects of what is at hand. And on hand I have a 2-core computer with built-in and 2 additional sound cards, ESI Juli @ and C-Media CM8738. Total 6 channels to record.
If 2 channels are enough, then you can no longer read, because as 2 channels can be mixed through Reaper under Windows with asio4all (or native drivers), it will play without problems. The whole complexity begins when you want to make one virtual and multi-channel from 3 cards. Through asio4all, the recording of 6 channels simultaneously at an acceptable level of quality (even for rehearsals) did not work out (due to the different clock source on the cards, and also because of rare slowdowns), so I had to go through such a difficult path.
We will all run under Linux with a realtime kernel. A realtime patch is desirable, but not necessary, it will also work without it, except with a longer delay and not so stable. The distribution will be Debian, not RemixOS, because, firstly, I want to understand what is happening, whether something can be twisted and nothing will break, secondly, it will be necessary to patch a little wineasio, and thirdly, remixos has a terrible desktop . I will not tell you how to install Debian, a lot has already been written on this topic. So, we have a freshly installed Debian 6.0.3 with a desktop. It will look almost like this, except that there will be no icons on the desktop:

First of all, upgrade (if Debian was not installed with netinstall). In the root console (Applications-> Standard-> Root Terminal)
Now we put the already compiled realtime core of pengutronix, again in the root console:
Reboot to it, see what uname says:
root@debian:/home/vasiliy
Then you do not have to delete the update-notifier (or turn it off somehow):
Now we put the necessary packages. First, it is the JACK daemon. Audio applications will be connected to it. And he, in turn, through ALSA connects to the sound card.
Audacity, for checks
Packages to assemble wineasio
And Wine to run the Reaper. Wine can be delivered from repositories, and you can also collect it yourself with an rt-patch. The patch is needed so that the wine can give realtime priorities to the right threads. Those. with regular wine, all reaper-a streams will be in sched_other, regardless of how the application you want to run (or all in sched_fifo, if you run the entire wine through schedtool), and with the patch, the reper will tell you which streams are critical (which are the sound processing) , and which threads are not (this is a graphical interface and everything else). In short, the class and priority can be determined from the scheduler’s thread. The class is sched_fifo, sched_rr, sched_other (aka sched_normal), sched_batch, and others. There are two interesting things from the point of view of sound, this is normal (sched_other) and real time (sched_fifo). A thread that runs with the sched_fifo class cannot be interrupted by the thread with the sched_other class. Those. all sched_other will fail while some sched_fifo have something to do. It's good that most of the time sched_fifo streams are waiting for something, a signal from the equipment, for example. In our case, the audio streams (sched_fifo) will wait until the incoming audio buffer is full, as a signal comes that the buffer is ready to quickly process it, put the result into the outgoing buffer and wait again. And during these breaks a graphical interface will be drawn, and so on.
So, option 1, put the usual wine (not desirable):
And option 2, we collect wine 1.2.3 with a patch (I’ll say right away that this is not a valid debian-way, you really need to build a package and install it, but this is just a bit more complicated):

Since we will run Reaper, jackd and others not from the root, but from our user, we need to fix the limits, otherwise the operating system will not allow to run so much software, eat a lot of memory and get realtime priorities. Rule /etc/security/limits.conf
and write there (of course, instead of vasiliy you need to put your login in the system)
vasiliy - memlock unlimited vasiliy - rtprio 99 vasiliy - nice -20
In order for the limits to apply, you need to log in or reboot. We check that everything is ok with limits:
vasiliy@debian:~$ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 40 file size (blocks, -f) unlimited pending signals (-i) 16382 max locked memory (kbytes, -l) unlimited max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 99 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) unlimited virtual memory (kbytes, -v) unlimited file locks (-x) unlimited vasiliy@debian:~$
We look that max locked memory unlimited and we go further. Now we will configure and check ALSA and JACK. It is logical to start with ALSA, run Audacity, go to settings:

Choose ALSA, let Audacity write, see what works, listen to what happened (here I just touched the jack with my finger):

If something does not work, for example, it plays, but does not write (you can import any mp3-sound in Audacity), or write with big noises, then you need to look at the ALSA settings, System-> Options-> Sound. On my Juli @, everything worked right away, but with the built-in and c-media cards it was a mess:
C-Media Electronics Inc CM8738 (rev 10)




Integrated Intel Corporation 82801JI (ICH10 Family) HD Audio Controller




Interestingly, even the built-in card on the linear input gives a fairly good signal. The only thing is that it should be powerful enough, otherwise it makes noise. The volume on the "Capture" tab "Record" HDA Intel specifically stands at 25%, so I have the least noise. An electric guitar, for example, is not very good at writing, but if you pass the same guitar through some preamp (in my case it's an ART Tube MP), then you get very much nothing, you can even turn on the distortion.
')
Now we will configure JACK. We start qjackctl through Applications-> Audio and video-> JACK Control (or in the terminal qjackctl), click "Parameters":

We choose the main interface, I have it juli @, it is on hw: 2 (the list of cards and what numbers they received can be found in / proc / asound / cards

The sound card number is not always saved after a reboot, even if all the cards are pci). Turn on real time mode, set buffer size, sample rate, run jackd,

and through Audacity we check what works (in the Audacity settings, do not forget to switch to JACK). It is also desirable to check the recording (and audio output) on other cards through JACK.
And now the interesting part begins. We will connect the remaining audio interfaces to the main one. We still run qjackctl, start and write in a separate terminal:
$alsa_in -d hw:0 -j hda-intel -p 512 -n 2
hw: 0 is a built-in card, hda-intel is just a tag, it is possible without it, 512 is the buffer size, 2 is their number. Buffer size and quantity are selected minimally working (normally working means that alsa_in does not constantly display the inscription “delay = <something>”), ​​in my case it turned out 512 (and then 128) samples and two buffers, not bad. For the rest (the rest) sound is the same.

You can check that everything works through jackeq (Applications-> Audio and video-> JackEq or, like me, in the jackeq terminal). We select the input ports, output ports, raise the channel volume, master volume, watch and listen. In this step, you can experiment with the sizes of the JACK and alsa_in buffers (you will have to restart jackeq).

Actually, some kind of simple mixer is already there. But you want more, a lot of effects, vst-plugins and so on. You can put Ardor, you can rebuild ardor with support for windows VST plug-ins, you can put Mixbus. All this is DAW (Digital Audio Workstation), through them it is quite possible to mix for rehearsals. I preferred the Reaper because, firstly, it’s more familiar to me, secondly, it has built-in good effects, thirdly, it has a convenient mixer, you can put the effect settings knobs on the main mixer, fourthly, you can configure hotkeys in the mixer almost everything, fifthly, it works with VST; sixthly, the Reaper is a living software, constantly evolving.
Download and install from
reaper.fm , you can trial version. The Reaper itself is too early to launch, we do not have a jack-asio bundle. You need to download, patch, compile and install wineasio (http://sourceforge.net/projects/wineasio/). You can download the stable version (0.9.0), or you can, and development, with git. The version that lies in git is not much different from the stable version, but it started with a JACK buffer of 32 samples, so it’s better to download it:
git clone git://wineasio.git.sourceforge.net/gitroot/wineasio/wineasio
In order to build a wineasio, you need the file asio.h, which is contained in the Steinberg ASIO SDK. Unfortunately, Steinberg prohibits the distribution of this file, so we download it on our own from the Steinberg website (http://www.steinberg.net/en/company/developer.html), and put it in the folder with the unpacked wineasio. Now you need to patch asio.c:
This->jack_input_ports = jack_get_ports(This->jack_client, NULL, NULL, JackPortIsPhysical | JackPortIsOutput); This->jack_input_ports = jack_get_ports(This->jack_client, NULL, NULL, JackPortIsOutput); This->jack_output_ports = jack_get_ports(This->jack_client, NULL, NULL, JackPortIsPhysical | JackPortIsInput); This->jack_output_ports = jack_get_ports(This->jack_client, NULL, NULL, JackPortIsInput);

In this patch, we remove the JackPortIsPhysical flag so that the wineasio connects immediately to all the JACK ports, including the virtual ones that we created via alsa_in.
Compile, install:
$make $su

Test run Reaper, check that the wineasio has appeared:

wineasio is configured through the registry:
$wine regedit

Of the interesting settings here, only the Number of inputs / ouputs, you can put some more similar to the reality number. Fixed buffersize should be left at “1”, so that the buffer size determines JACK.
Run the Reaper again, depending on whether the launch command is patched with a wine or not:
$wine 'c:\program files\reaper\reaper.exe'
We configure it for the best work under wine:
Remove the check mark from “Preferences-> Buffering-> Use native events for syncronizing”, and in “Preferences-> Appearances-> UI updates” select “Lazy always”.


And now it remains only to add the necessary number of tracks to Reaper, turn them on to record and monitor, add effects and play:


Successful to you rehearsals!
PS:
- Under this version of wine 1.0.1, I only started the 3rd Guitar Rig, the 4th and 5th are not installed. Although rehearsal and third enough. With GuitarRig you need to be more careful somehow, if you quickly switch presets, it flies out along with the ripper. I would like to find some more stable alternative working under wine.
Under the version of wine 1.2.3 Guitar Rig 5 is set, works fine, does not crash.
- With wineasio 0.9.0, the delays on the main card with buffer 256 turned out to be about 20 ms, for an additional about 30 (corrected, thanks to egorinsk ).
But on the git version of wineasio and smaller sizes work, now here on the main card the size of the buffer is 32, which gives a delay of 1.4 ms, and on the alsa_in buffer 128, i.e. On additional cards it turned out 6 ms.
- In four cards also works, I connected the EMU-0202 USB.
- I did not find the VST suppressor of feedback, it is necessary to press the whistling frequencies manually through the equalizer.
- I do not know how to put the nvidia driver on the realtime kernel humanly.
- In Reaper, there is a peculiarity that it hangs up priorities on streams not during launch, but as soon as playback / recording begins. Those. if you make a project with a mixer, after opening it you have to press play / stop. You can see what thread there is, what class and priority they have in
ps -emo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm

Here you can see that reaper.exe has 3 FF (sched_fifo) streams, one with priority 5 (this is the one that jack created for it, this priority can be configured via qjackctl), and two (I have two cores) with priority 20, this effects streams, their Reaper requested with priority THREAD_PRIORITY_HIGHEST.
In general, do not be lazy to put a realtime kernel, a wine with a realtime patch, and a wineasio version with git. The results should be very good.
References:
debian.orgpengutronix.de/software/linux-rt/debian_en.htmlreaper.fmsourceforge.net/projects/wineasiowww.steinberg.net/en/company/developer.htmlwiki.cockos.com/wiki/index.php/How_to_run_Reaper_in_Wine_on_Linux