Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER for Linux

Reply
 
Thread Tools Display Modes
Old 07-27-2018, 10:40 AM   #1
vitaminx
Human being with feelings
 
vitaminx's Avatar
 
Join Date: Jul 2018
Posts: 52
Default Focusrite Scarlett 18i20 audio interface

Hi, I own a Focusrite Scarlett 18i20 2nd Gen audio interface which works pretty well with jack - and therefor Reaper.

But there are a few things missing from alsa drivers, namely direct zero latency monitoring and sample rate selection.

Is there any chance Reaper would support this hardware directly, so we could set these parameters from within Reaper no matter if it's implemented with alsa or not?
vitaminx is offline   Reply With Quote
Old 07-27-2018, 01:05 PM   #2
JamesPeters
Human being with feelings
 
Join Date: Aug 2011
Location: Near a big lake
Posts: 3,943
Default

That seems very unlikely to happen. The software for your audio device is written specifically for how that device functions. This varies from device to device. What you're effectively asking for is that Cockos make audio device software for all audio devices (because why just single out that one interface, and have everyone else complain they're being ignored).

Some good news: direct hardware monitoring isn't necessary if your latency is low enough. I have an audio card (Asus Xonar DX) which has hardware monitoring...but its own hardware monitoring has terrible latency in Windows for some reason! (It's at least 200ms or more.) Since its ASIO drivers allow for around 10ms round-trip latency with no problems, I tried monitoring through Reaper instead...and I don't notice that 10ms of latency for monitoring. That surprised me, since I thought it would be noticeable (I'm used to "zero latency" hardware monitoring of other audio devices). So I'd recommend trying monitoring through Reaper with your latency set as low as reasonably possible and see if it's acceptable to you.

(Note: Asus Xonar DX input monitoring does work properly in Linux.)

As for sample rate switching of the audio device, thankfully that's something which is not often done during a project. Hopefully it's not something you consider necessary.

Last edited by JamesPeters; 11-09-2018 at 08:22 AM.
JamesPeters is offline   Reply With Quote
Old 07-27-2018, 02:04 PM   #3
vitaminx
Human being with feelings
 
vitaminx's Avatar
 
Join Date: Jul 2018
Posts: 52
Default

Quote:
Originally Posted by JamesPeters View Post
So I'd recommend trying monitoring through Reaper with your latency set as low as reasonably possible and see if it's acceptable to you.
I was testing this extensively with Renoise before and I am able to set jack to as low as 64 periods for recording.

This is what jack says when starting:

Code:
creating alsa driver ... hw:2|hw:2|64|3|48000|0|0|nomon|swmeter|-|32bit
configuring for 48000Hz, period = 64 frames (1.3 ms), buffer = 3 periods
Is 1.3 ms my total roundtrip latency when recording?
That seems really low to me.

I could record several tracks, but as soon as I add some DSP, VSTs or whatever effect, I get stutter and depending on the load and amount of DSPs I have to increase up to 256 periods.

I have not tested this with Reaper though, I can't wait to find out how it behaves

Quote:
Originally Posted by JamesPeters View Post
As for sample rate switching of the audio device, thankfully that's something which is not often done during a project.
Yes that's true. And it defaults to 48k so this is a good value I guess.

Quote:
Originally Posted by JamesPeters View Post
Hopefully it's not something you consider necessary.
I would probably always set my projects to 48k anyways. So it's not a big deal. I was aware that this is not configurable yet with Linux and I decided anyways to buy the Focusrite because it seemed minor to me.

The more important feature for me is direct monitoring, which I took to the alsa mailing list, lets see if I can get something going there.
vitaminx is offline   Reply With Quote
Old 07-27-2018, 02:15 PM   #4
JamesPeters
Human being with feelings
 
Join Date: Aug 2011
Location: Near a big lake
Posts: 3,943
Default

I don't know what that all means since it doesn't qualify what it's doing (and I have no experience with how you're testing it) but I'd have to at least assume it's 1.3ms x3 = 3.9ms and that's probably only the input or output latency being reported, not both combined (which is likely 2x that, at 7.8ms).

If you can't hear the latency while monitoring, problem solved.

Last edited by JamesPeters; 11-09-2018 at 08:23 AM.
JamesPeters is offline   Reply With Quote
Old 07-27-2018, 02:37 PM   #5
vitaminx
Human being with feelings
 
vitaminx's Avatar
 
Join Date: Jul 2018
Posts: 52
Default

OK so I did some quick tests and Reaper seems by far more performant than Renoise.

Here is what I get:

Setting jack to 16 periods: I can overdub over 5 mono audio tracks with Reaper without xruns, dropouts or stutter, at the 6th track or so I start noticing xruns. With 16 periods Renoise can't even record a single channel without tons of xruns to the point that jack drops the Renoise jack client entirely.

Setting jack to 32 periods: I can overdub over 10 mono audio tracks or so with Reaper and I get occasional xruns. Renoise can't handle 32 periods either, jack still throws out Renoise client.

Setting jack to 64 periods: I stopped testing when playing back 16 tracks and recording a mono track at the same time. I get almost no xruns, the very few I get is probably due to my kernel not being RT, who knows.
With 64 periods I am unable to notice any monitoring delay while recording, so this value is absolutely fine with me.

I still have to test with some FX, VST, etc.

*EDIT* I'm not trying to make Renoise look bad - it is an awesome DAW too and I made tons of music with it.
vitaminx is offline   Reply With Quote
Old 07-27-2018, 07:23 PM   #6
vitaminx
Human being with feelings
 
vitaminx's Avatar
 
Join Date: Jul 2018
Posts: 52
Default

I did some exact measurements with jack_delay.

Here are the results for full roundtrip latency for the Focusrite Scarlett 18i20.

Settings:

- jack backend: alsa
- nperiods: 3
- sample rate: 48000
- sample format: 32 bit

Code:
  16 periods:  172.763 frames,  3.599 ms (no audible latency)
  32 periods:  296.763 frames,  6.183 ms (no audible latency)
  64 periods:  544.763 frames, 11.349 ms (no audible latency)
 128 periods: 1052.763 frames, 21.933 ms (very slight latency)
 256 periods: 1558.763 frames, 32.474 ms (audible latency)
 512 periods: 2654.763 frames, 55.308 ms (audible latency)
1024 periods: 4696.763 frames, 97.849 ms (audible latency)
*EDIT* just tried a realtime Linux kernel for Debian (package "linux-image-rt-amd64") which improves matters even further. Means I get fewer xruns with lower period settings. No occasional xruns anymore.

*EDITEDIT* now I really need some sleep...

Last edited by vitaminx; 07-27-2018 at 08:45 PM.
vitaminx is offline   Reply With Quote
Old 07-28-2018, 02:13 AM   #7
David Else
Human being with feelings
 
Join Date: Mar 2012
Posts: 610
Default

Quote:
Originally Posted by vitaminx View Post
But there are a few things missing from alsa drivers, namely direct zero latency monitoring and sample rate selection.
I have Scarlett 6i6 2nd gen and it is working great in Linux with Reaper.

I am a bit confused by you missing sample rate selection in ALSA. It is in the audio device settings in 5.84 pre7 for me in a drop down menu.

The zero latency monitoring setup was a little more complex. You need to use the PC software that comes with the card to set up which channels you want this on. I only need it one way and am happy to never change, so I booted the card on a PC, made the changes and have now formatted the PC to Linux, so have the zero latency monitoring set how I want it.

Unfortunately the software does not work on Wine or it would be happy days. People have been talking about creating Linux software to config, and a guy from Red Hat recently told me about this project:

https://github.com/fulup-bzh/AlsaJsonMixer
https://vimeo.com/125275339

It is made for your card

I have not had time to look into this or test it yet, so use at your own risk as it might change settings you can't access easily.
__________________
----------> Debian Linux Distribution = Computing Joy & Freedom <----------
David Else is offline   Reply With Quote
Old 07-28-2018, 07:21 AM   #8
vitaminx
Human being with feelings
 
vitaminx's Avatar
 
Join Date: Jul 2018
Posts: 52
Default

Quote:
Originally Posted by David Else View Post
I am a bit confused by you missing sample rate selection in ALSA. It is in the audio device settings in 5.84 pre7 for me in a drop down menu.
You're right, when I switch to alsa I see all the options - there's even a dropdown to chose sample format, 16, 24 or 32 bit.

As I am using jack, and not alsa directly, I guess I just have to figure out how to set all this within jack.

Quote:
Originally Posted by David Else View Post
I booted the card on a PC, made the changes and have now formatted the PC to Linux, so have the zero latency monitoring set how I want it.
That's a good idea, we have a Mac at home, I'll try to configure zero latency patching with that one.

Quote:
Originally Posted by David Else View Post
a guy from Red Hat recently told me about this project:

https://github.com/fulup-bzh/AlsaJsonMixer
https://vimeo.com/125275339

It is made for your card
Unfortunately this software only works for the first generation of the 18i20, but I have the 2nd gen. which is not compatible.
Anyways, AlsaJsonMixer relies on alsa, means as long as alsa doesn't support these settings, AlsaJsonMixer won't either.
vitaminx is offline   Reply With Quote
Old 07-28-2018, 09:33 AM   #9
David Else
Human being with feelings
 
Join Date: Mar 2012
Posts: 610
Default

vitaminx, you can set jack like this in preferences:

tick the auto-start jackd box and paste in the commands you want and location, for example:

/usr/bin/jackd -dalsa -dhw:USB -r96000 -p128 -n3 -Xseq
__________________
----------> Debian Linux Distribution = Computing Joy & Freedom <----------
David Else is offline   Reply With Quote
Old 07-29-2018, 11:34 AM   #10
vitaminx
Human being with feelings
 
vitaminx's Avatar
 
Join Date: Jul 2018
Posts: 52
Default

Quote:
Originally Posted by David Else View Post
/usr/bin/jackd -dalsa -dhw:USB -r96000 -p128 -n3 -Xseq
Ok now I'm a little confused. When using alsa audio driver in Reaper it also shows me ridiculously high sample rates as an option for my laptop internal sound card, e.g. 192000 Hz.

I'm pretty sure that my laptop soundcard is not capable of that sample rate.

So, when I set my internal soundcard or the Focusrite to 192000 Hz - does it really record such a high sample rate, or does alsa or jack record with 44.1k or 48k and resample it to 192000 Hz?

Does someone know how this works?

Last edited by vitaminx; 07-29-2018 at 11:40 AM.
vitaminx is offline   Reply With Quote
Old 07-29-2018, 01:29 PM   #11
David Else
Human being with feelings
 
Join Date: Mar 2012
Posts: 610
Default

Quote:
Originally Posted by vitaminx View Post
Ok now I'm a little confused. When using alsa audio driver in Reaper it also shows me ridiculously high sample rates as an option for my laptop internal sound card, e.g. 192000 Hz.

I'm pretty sure that my laptop soundcard is not capable of that sample rate.

So, when I set my internal soundcard or the Focusrite to 192000 Hz - does it really record such a high sample rate, or does alsa or jack record with 44.1k or 48k and resample it to 192000 Hz?

Does someone know how this works?
alsa and jack should correctly detect what your sound card can do and it should work. it is not really reaper deciding this, the sound card driver is inside the Linux kernel and tells alsa about your sound card.

I had a crack at describing this stuff in a blog post, is this any help?

https://www.learndigitalaudio.com/ho...ows-audio-2017

Why not just mess about and see it if works at 192, and then 96, and then 44.1. You will soon find out what the machine can do and if there are any bugs or errors.

If you sound card can't do 192, maybe updating the kernel would correct things. Often a kernel update will fix hardware driver errors.

My Scarlett 6i6 says it can do 192, but i get no sound when I select it. I have not bothered to chase up on this as it does not affect me.
__________________
----------> Debian Linux Distribution = Computing Joy & Freedom <----------
David Else is offline   Reply With Quote
Old 07-30-2018, 06:26 AM   #12
vitaminx
Human being with feelings
 
vitaminx's Avatar
 
Join Date: Jul 2018
Posts: 52
Default

Quote:
Originally Posted by David Else View Post
Why not just mess about and see it if works at 192, and then 96, and then 44.1.
OK I tried all options, and anything above 48k doesn't work at all. Jack starts without errors, but nothing is recorded.

Well, seems that the audio driver is really not supporting switching the sample rate.
vitaminx is offline   Reply With Quote
Old 11-08-2018, 10:08 PM   #13
s wave
Human being with feelings
 
Join Date: Sep 2018
Location: Colorado
Posts: 429
Default Don't forget there are 2 different JACKs... JACK1 and JACK2

some info from github...
...'Here is a feature listing/comparison of the different jack implementations. Note that this list does not include tschack, Torben Hohn's experimental branch of Jack 1.
Feature Jack 1 Jack 2
Implements the JACK C API Yes Yes
Supports multiple processors (SMP) No Yes(1)
Allows apps to connect/disconnect without disrupting audioNo Yes
Interacts with PulseAudio on Linux to share soundcard No(6) Yes
Has (optional) DBUS support(2) No(6) Yes
Can be used with WalkThrough_Dev_NetOne Yes Yes
Can be used with WalkThrough_User_NetJack2 No Yes
Is under active development Yes Yes
Supports Linux/*nix/POSIX OS's Yes Yes
Supports OS X Yes Yes(4)
Supports Windows No Yes(5)
Supports Solaris/OpenSolaris Yes? Yes
Has builtin support for >1 soundcard on Linux Yes No
Supports metadata API Yes No
Has builtin integration with Linux MIDI Yes No
Has builtin integration with CoreMIDI (OS X) No Yes

(1) Jack2 can run in 2 different modes : "asynchronous" when the server does not wait for graph end for a given cycle but just write the outputs computed at the previous cycle. In this case an extra period of latency is added. Jack 2 can also be run in "synchronous" mode, when the server waits for the graph activation end in a given cycle, in which case it works like Jack 1.
(2) DBUS support helps in integrating with PulseAudio and LADI.
(3) It's not that netjack2 is exclusively for Jack2, it's just that nobody has ported the protocol to Jack1.
(4) Integrated with JackOSX which allows CoreAudio clients become Jack clients (thanks to the JackRouter CoreAudio/Jack virtual audio device)
(5) ASIO clients can become Jack clients (thanks to the JackRouter ASIO/Jack bridge)
(6) DBUS and PulseAudio interaction support for jack1 is available through patch. Currently distributed as a modified jack1 tarball.

Other differences that don't lend themselves to feature tables:

Jack 2 is more forgiving of misbehaving audio apps, whereas Jack 1 is not very tolerant (zombifying the client). (This behavior can be configured for both, but this is the default behavior.)
Both will lock its memory to keep the kernel from moving it to the swap space on the hard disk (virtual memory). This helps avoid critical delays (xruns). Jack 1 locks all critical data (shared memory), process data, and executable code. Jack 2 locks all critical data (shared memory) on systems that support it (Linux, OS X and Windows).
Jack 1 uses less RAM than Jack 2.
SMP support is not always as valuable as you would think. If your applications are chained INPUT --> A --> B --> C --> OUTPUT, then it will not be able to utilize multiple processors. However, if you applications are independently generating audio to the OUTPUT, that is when "parallel" sub-graph exist in the global graph, then they can be.
Jack 2 allocates 2 threads on the client side, one for real-time computation (the one that calls the "Process" callback) and one to handle all non real-time notifications (server context changes). Jack 1 only use 1 thread for real-time computation and notification handling.
Jack 2 uses a large, fixed sized buffer for MIDI; Jack 1 defaults to a smaller size but allows the size to be set at run time.'

I have also found some answers in the ALSA / PULSE configurations...(like installing some GUIs like "ALSAMIXER" ?) gl
s wave is offline   Reply With Quote
Old 11-26-2018, 12:11 PM   #14
bobmarlex
Human being with feelings
 
bobmarlex's Avatar
 
Join Date: Nov 2018
Location: Luebeck, Germany
Posts: 4
Default Focusrite Scarlett 18i20 and other usb audio interfaces

hi

would you recommend the Focusrite Scarlett (series/2ndgen) for the use with linux? Looking for a desktop solution that fits in place..

the ordered Alesis Multimix 8 FX USB is fully unsupported. No out, related as 'CODEC' 2in2out, no routing, no hwmix, no nothing

the Alesis Multimix 16 Firewire works, had one of them in 2011 w ubu12.04 all channels availbe, in out ok.
..gathered one these days, will be testing ..

now i'm looking at the scarlette series, which in my opinion has too less knobs....
cheers bob
bobmarlex is offline   Reply With Quote
Old 11-28-2018, 04:52 AM   #15
vitaminx
Human being with feelings
 
vitaminx's Avatar
 
Join Date: Jul 2018
Posts: 52
Default

Quote:
Originally Posted by bobmarlex View Post
would you recommend the Focusrite Scarlett (series/2ndgen) for the use with linux?
I don't know, maybe someone else uses it and can share some experience?
__________________
Soundcloud
YouTube
vitaminx is offline   Reply With Quote
Old 12-06-2018, 01:18 PM   #16
bobmarlex
Human being with feelings
 
bobmarlex's Avatar
 
Join Date: Nov 2018
Location: Luebeck, Germany
Posts: 4
Default

Quote:
Originally Posted by vitaminx View Post
I don't know, maybe someone else uses it and can share some experience?
hello my name is someone else and i got a focusrite scarlett 6i6 2nd since yesterday.
playing around with it in ustudio14.04 -the only daw-distro where i was able to fire up my good old alesis16 firewire (newer kernels all failed)- it felt good.
shows all IOs are accessable in patchage/catia as 'system' 6x capture, 6x playback and the midi ports: "Scarlett 6i6 USB" and "Midi Through". Very nice..)
setup in a windows7-64b env (for enabling or disabling inst/pad) might not be neccassary, but for overall control at first beginning..
48000/64/3 wo any xruns, DSP Load ~8%
this saturday we will checkout live-performance-capabilities and so will do further testing.

Regards
bob
bobmarlex is offline   Reply With Quote
Old 12-06-2018, 05:02 PM   #17
JamesPeters
Human being with feelings
 
Join Date: Aug 2011
Location: Near a big lake
Posts: 3,943
Default

You might want to find a way to use a newer kernel with the driver for your firewire device. Older kernels won't have the Spectre/Meltdown fixes.
JamesPeters is offline   Reply With Quote
Old 12-08-2018, 03:49 AM   #18
bobmarlex
Human being with feelings
 
bobmarlex's Avatar
 
Join Date: Nov 2018
Location: Luebeck, Germany
Posts: 4
Default

yes, you are absolutely right, for now it's just a workaround to get things work..
At this time i'm really thrilled about the scarlett 6i6. Most things work like a charm except the 'basic setup' you'll have to do in win like mentioned above.
What really turns me on is the ability to 'extend' the scarlett by plugging in a hardware-mixer (in my case a wharfedale connect 802) into LINE 3+4 wo to much loss of soundquality. Certainly it seems like it's only a mono-sum routed to the mains.
We'll see...
bobmarlex is offline   Reply With Quote
Old 12-12-2018, 01:57 PM   #19
bobmarlex
Human being with feelings
 
bobmarlex's Avatar
 
Join Date: Nov 2018
Location: Luebeck, Germany
Posts: 4
Default

this is it..
that shit works,...i am almost happy (and dont know how to paste content...)
Attached Images
File Type: png Screenshot - 12.12.2018 - 21:43:23.png (63.3 KB, 271 views)

Last edited by bobmarlex; 12-12-2018 at 02:14 PM.
bobmarlex is offline   Reply With Quote
Old 12-12-2018, 03:44 PM   #20
JamesPeters
Human being with feelings
 
Join Date: Aug 2011
Location: Near a big lake
Posts: 3,943
Default

I'm glad it's working!

In case you weren't aware, Reaper doesn't require JACK. You can use ALSA. So if you're not connecting Reaper to other applications, the audio setup is quite simple.
JamesPeters is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:11 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.