Crackling with ALSA

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

Post Reply
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Crackling with ALSA

Post by lilith »

Hi,

since I use KXStudio 14.04 with my ZOOM R8 interface I experience sporadic crackling (no xruns) when using ALSA (Youtube via Chrome, Spotify client, etc.). With Jack everything is fine!

The seetings in Cadence

Image

Some points, which I find strange:
1. The interface only works fine when set to 48kHz, with 44.1kHz I get A LOT of crackles (under windows it works with all sampling rates)

2. The volume control of alsamixer don't change anything

Ok... Anyway I still experience some sporadic pops when set to 48kHz with ALSA and I thought that maybe the asoundrc configuration is responsible for this (see below). Obviously there's 44.1 kHz everything. Can this be (part of) the problem? I also wonder why the file is so long.

Thanks for your help :P

Code: Select all

# ------------------------------------------------------
# Custom asoundrc file for use with snd-aloop and JACK
#
# use it like this:
# env JACK_SAMPLE_RATE=44100 JACK_PERIOD_SIZE=1024 alsa_in (...)
#

# ------------------------------------------------------
# playback device
pcm.aloopPlayback {
  type dmix
  ipc_key 1
  ipc_key_add_uid true
  slave {
    pcm "hw:Loopback,0,0"
    format S32_LE
    rate {
      @func igetenv
      vars [ JACK_SAMPLE_RATE ]
      default 44100
    }
    period_size {
      @func igetenv
      vars [ JACK_PERIOD_SIZE ]
      default 1024
    }
    buffer_size 4096
  }
}

# capture device
pcm.aloopCapture {
  type dsnoop
  ipc_key 2
  ipc_key_add_uid true
  slave {
    pcm "hw:Loopback,0,1"
    format S32_LE
    rate {
      @func igetenv
      vars [ JACK_SAMPLE_RATE ]
      default 44100
    }
    period_size {
      @func igetenv
      vars [ JACK_PERIOD_SIZE ]
      default 1024
    }
    buffer_size 4096
  }
}

# duplex device
pcm.aloopDuplex {
  type asym
  playback.pcm "aloopPlayback"
  capture.pcm "aloopCapture"
}

# ------------------------------------------------------
# default device
pcm.!default {
  type plug
  slave.pcm "aloopDuplex"
}

# ------------------------------------------------------
# alsa_in -j alsa_in -dcloop -q 1
pcm.cloop {
  type dsnoop
  ipc_key 3
  ipc_key_add_uid true
  slave {
    pcm "hw:Loopback,1,0"
    channels 2
    format S32_LE
    rate {
      @func igetenv
      vars [ JACK_SAMPLE_RATE ]
      default 44100
    }
    period_size {
      @func igetenv
      vars [ JACK_PERIOD_SIZE ]
      default 1024
    }
    buffer_size 32768
  }
}

# ------------------------------------------------------
# alsa_out -j alsa_out -dploop -q 1
pcm.ploop {
  type plug
  slave.pcm "hw:Loopback,1,1"
}
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: Crackling with ALSA

Post by lilith »

Dear falkTX,

thanks. I took the force to 16bit out again but i'm pretty sure that it's also crackling without it. The crackling is sporadic. Sometimes it happens more frequently and sometimes it seems to be gone.
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: Crackling with ALSA

Post by lilith »

Bad news: Xruns stay at 0 usually.
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: Crackling with ALSA

Post by lilith »

I'll check later again. I haven't tried it since a year, but there was also the problem that i couldn't install pulseaudio. Maybe it's time to make a new install of the OS.

viewtopic.php?f=47&t=16593
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: Crackling with ALSA

Post by lilith »

Pulseaudio works now. I will check when crackling with pulseaudio or alsa occurs.
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: Crackling with ALSA

Post by lilith »

@falkTX: Since I use pulseaudio instead of alsa the crackling seems to be gone. :) Do you have a clue how this can be? I thought that pulseaudio is based on alsa?
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: Crackling with ALSA

Post by lilith »

Perfect, thank you!
Post Reply