Based on this mail on LAU by Nathanael Anderson

Intel-HDA JACK low latency howto

I've seen asked many times on the list how to get intel-hda cards working with low latency, in duplex operation. Here is a full, step by step, on how I got 4ms latency. I'm using a Dell M90 with a Quadro fx 1500, attached to a docking station with a Maudio Delta 66 pci card (secondary card) in it, the binary Nvidia drivers and Compiz. So if you were wondering, it is possible. :)

Kernel

(I'm not going to walk you through how to compile a kernel)

the last kernel before the big kernel lock regression

wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.24.7.tar.bz2
tar xvjf linux-2.6.24.7.tar.bz2
cd linux-2.6.24.7.tar.bz2
wget http://www.kernel.org/pub/linux/kernel/projects/rt/patch-2.6.24.7-rt21.bz2

if you don't see it here look in the projects/rt/older/ directory

bzcat ../patch-2.6.24.7-rt21.bz2

Download this config: config-intel-hda.txt

mv config-intel-hda.txt .config.old
make oldconfig

build and install your kernel

Module Options

Add the following line to the file your distribution has its module options in (in ubuntu it is /etc/modules.d/alsa-base)

options snd-hda-intel model=ref position_fix=1 enable=1 index=0

Mixer Options (VERY IMPORTANT ! ! !)

enable capture/record elements in mixer

without this jack can't play nicely with intel-hda cards

RT Permissions

In most modern distros /etc/security/limits.conf is where realtime permissions are set, I added these 3 lines to it, and added myself to the @audio group in /etc/group

@audio          -       memlock         1024000
@audio          -       nice            -10
@audio          -       rtprio          99

Jack options

I use qjackctl to set these

  • put a check in Realtime
  • Priority 89
  • Frames/Period 64
  • Sample Rate 48000
  • Periods/Buffer 3

Debian (9 sept 2013)

  • Realtime does not have to be compiled anymore into the kernel: it is already by default. I know at least on “Debian 7.1 Wheezy amd64” & latest UbuntuStudio, perhaps more.
  • On Debian the location of the config file is /etc/modprobe.d/alsa-base.conf
  • Further config files are located at ~/.asoundrc (userwide) and /etc/asound.conf (systemwide). Note that ~/.asoundrc works out as /home/CURRENTUSERNAME/.asoundrc so be aware that using ~ while being root (or su in a terminal) works out as /home/root/.asoundrc, which might not be what you want.
  • The 'index=' setting seems to not work properly, and give errors during boot about card not ready for slot or something ( I will try to reproduce later). The solution is to not use the line with 'index=', but instead use 'options snd slots=snd-hda-intel'. This will put snd-hda-intel in slot 0. If you have more cards, like me, you can sum them all up, 'options snd slots=snd-ca0106,snd-hda-intel' will assign my SB Audigy (ca0106) to slot 0, and my motherboard audio (hda-intel) to slot 1. You can also keep slot 0 'open', and only assign slot 1: 'options snd slots=,snd-hda-intel' will put the hda-intel in slot 1, keeping slot 0 open for any takers. Note the comma.
  • The 'nice' option is not needed, it is commented out on my setup.
  • Example of /etc/asound.conf that will capture sound from device 0 on 'CA0106', and playbacks sound to device 1 on 'Intel':

Use 'aplay -l' to list all playback devices, and 'arecord -l' to list all capture devices. Results are like 'card 1: Intel [HDA Intel], device 1: ALC1200 Digital [ALC1200 Digital] ', where the part made bold is the name used. Case sensitive.

pcm.!default {                   # declare the default PCM device
  type asym                      # combine playback and capture devices
  playback.pcm {                 ### Playback object ###
    type plug                    # convert audio to mixer format
    slave.pcm {
      type dmix                  # mix multiple audio streams
      ipc_key 69569              # shared memory key; must be unique, just make one up
      ipc_key_add_uid true       # add UID to shared mem key
      ipc_perm 0600              # shared mem file permissions
      slave {
        pcm {
          type hw                # define the playback hardware
          card "Intel"           # YOUR playback card name
          device 1               # YOUR playback device on that card
        }
        format S32_LE            # YOUR bits per sample format
        rate 48000               # YOUR samples per second
        channels 2               # number of audio channels
      }
    }
  }
  capture.pcm {                  ### Capture object ###
    type plug                    # convert audio format from the hardware
    slave {
      pcm {
        type hw                  # define the capture hardware
        card "CA0106"            # YOUR capture card name 
        device 0                 # YOUR capture device on that card
      }
    }
  }
}

Comments

Please comment here if this guide worked for you or what you had to do to get it working:

!– Comments end here –!

wiki/intel_hda_realtime_howto.txt · Last modified: 2014/03/09 01:28 by j_e_f_f_g