1. Please do not install macOS 10.15 Catalina yet, as Native Instruments software and hardware products are not supported under macOS 10.15 yet. For more info, please go HERE!
    Dismiss Notice

Traktor3, Wine and Linux

Discussion in 'TRAKTOR 3' started by SilenceOfTheAss, Jun 8, 2010.

Thread Status:
Not open for further replies.
  1. SilenceOfTheAss

    SilenceOfTheAss New Member

    Lo all,

    Thought I'd detail how I got Traktor working under Linux for anyone else that is interested in giving it a try.

    The latest versions of Traktor are a no-go I'm afraid - here I am talking about Traktor (Traktor3_330_Win.zip was the source of the install).

    It's been a pet project for about six months playing with various versions and debugging the various layers, too.

    It works very nicely with almost full functionality (F keys don't work... that's about all I've found.).

    I'm using the BCD3000 from Behringer as my control surface and getting 1.3ms latency on Core 2 Duo without xruns (according to Jack).

    Jack gives excellent latency to audio hardware - Wine seems to be the bottle neck in terms of latency - when I attempt to go too low with latency Jack complains that Traktor isn't feeding it enough data - it looks like this is in part due to the multiple threads and mutexes used in wineasio to feed the data from a Windows thread into a native Jack thread and then onto the Jack server.

    It's not for the faint of heart, and I had to use specific versions of
    "stuff" to get it up and running.

    I'm not going to support anyone attempting this - it's intended as a
    starting point and also to show that it's possible to get Traktor working
    smoothly under Linux.

    If you're not familiar with compiling and launching things from the
    command line, I'd skip it.

    You may / may not have luck getting it working on another distro - but the
    versions listed below should give you a starting point if you are on Ubuntu
    or something else.

    Basic Setup:

    "Standard" Linux kernel (not low-latency, just the desktop pre-emptive kernel - might have better latencies with RT kernel but I'm happy as it is)
    Recent(ish) version of Jack
    Recent Wine
    Wineasio as bridge from Wine to Jack

    Process Flow:

    Traktor on Wine -> WineAsio + ALSA -> jackd + Jack midi -> Alsa Driver

    Software Versions:

    Desktop Gentoo 32 bit (I originally started with mixed 64/32 environment but it's a world of pain)
    Jack Audio Connection kit 1.9.5 *(1)
    Qjackctl 0.3.3 (use this after you've got everything working)
    Wine 1.1.42 with Alsa and Jack support built in *(2)
    Wineasio 0.7.5 *(3)
    Traktor *(4)

    (1) This version of jack seemed important in getting wineasio to play nice in opening and closing the jack ports
    (2) I'm not sure if the Jack support is strictly necessary - might be for "midi" device access
    (3) Requires building due to needed asio.h file from Steinberg
    (4) The version here is important, too - later Traktor installers crash during the install

    Kernel Notes:

    * Version 2.6.32-gentoo-r7 (I suspect any newer versions should be good to go, too)
    * Tickless
    * High res timer (in the alsa section make sure HT timer backend support is in there)
    * 1000hz
    * Low-Latency Desktop pre-emption model
    * Use performance CPU scaling governor
    * No usb suspend support (selective suspend resume it's called)
    * /etc/sysctl.conf - add a line like the following:
    dev.hpet.max-user-freq = 1024

    Jack Notes:

    * 1.9.5
    * used the -classic switch when compiling it - this lets us launch jackd on the command line without their more recent jackdbus stuff which I'm not a fan of
    * I've seen problems with Jack when attempting to use playback and capture on the device at the same time - only using the device for playback eliminated a lot of xrun problems for me and gives fantastic latency. I suspect this is the USB device and hardware interrupts.
    * I have to launch jackd in synchronous mode - forcing a round robin fetching of audio data from audio clients

    The command I use to launch jackd:

    /usr/bin/jackd -R -P89 -dalsa -dhw:1 -r192000 -p256 -n4 -io -o4 -Xseq -S -P

    Getting up and running:

    * Get the right kernel compiled, configured and in place

    * Check correct ALSA connectivity to your wave and midi devices

    * Get Jack compiled and find a comfortable configuration for your output device in terms of latency - use a program that can output to jack directly to test this (audacity, for example)
    You may get some problems here with xruns - this is where you look into Alsa / Jack how tos and stuff :)
    Make sure the user you are running stuff as is in the audio group and has realtime rights etc.
    Close this stuff when you are done.

    * Get Wine installed / configured - make sure you have support for Alsa and Jack built in - do an audio test over Alsa and also Jack. Close when done.

    * Stop Jack - we come back to it later.

    * Set Wine to use the alsa sound backend using winecfg - make sure nothing else is checked in the sound config. Close it when done.

    * Run the Traktor installer .exe file under wine and make sure everything is installed and happy. Close it when done.

    * If it didn't auto-launch - launch the NI Service Center executable with wine - when it says there is a newer service center version - don't let it update. Click cancel and go into the service to register your version of Traktor. Close it when done.

    * Copy three files from a windows install into the Program Files\Traktor directory:

    * After Service Center tells you Traktor is registered - now you can launch Traktor - we are looking to make sure the program launches ok and it can find the Alsa audio device. Try playing a track in one of the decks - if no movement in the wave display - theres a problem. Close it when done.

    * Compile the wineasio layer - as mentioned you need the header file from Steinberg for this. After you've built it you will need to copy it into /usr/lib/wine/ and then register it for the user you will be running Traktor as (regsvr wineasio.dll)

    * Launch Jackd

    * Now re-run winecfg from the command line and verify it's ok by clicking on test sound (check the terminal for any obvious error output). Close it when done.

    * Launch Traktor and see if it finds the wineasio device / midi devices. Close it when done.

    * In the terminal you are launching wine traktor in, write the following (assuming bash shell):
    export ASIO_OUTPUTS=4
    (or indeed how many outputs you want)

    * Relaunch Traktor from this terminal / command prompt (one line):

    wine ~/.wine/drive_c/Program\ Files/Native\ Instruments/Traktor\ DJ\ Studio\ 3/TraktorDJStudio3.exe

    * Check you've got enough outputs and that your midi devices are showing up correctly.

    * Launch qjackctl to allow you to check how the output routing is done (by default it maps to the four outputs on my machine - not sure how it might work on other machines)

    * Play a track - make sure you are routed to an output port you'll be able to hear and see if you have sound.

    * Rejoice.

    * It up to you how you get things "comfortable" now :) - For reference the ASIO_OUTPUTS stuff can be put into a file on disk .wineasiocfg

    * As a bonus, backing up / restoring a Traktor environment is now dead easy - rsync is your friend.

    Getting debugging output from wineasio:

    You can get some trace information about what wineasio is doing by launching wine in the following way (all one line):

    WINEDEBUG=+trace,+winealsa,+asio wine ~/.wine/drive_c/Program\ Files/Native\ Instruments/Traktor\ DJ\ Studio\ 3/TraktorDJStudio3.exe

    Good luck to anyone brave enough :)

Thread Status:
Not open for further replies.