[alsa-devel] 1010lt (ice1712) asoundrc for 6 virtual mono cards question

Giovanni Maruzzelli gmaruzz.lists at gmail.com
Fri Apr 13 15:55:36 CEST 2007


I applied the first hint from Jaroslav (at the end of this post the
new asound.conf), but the problem seems not gone: one time each 256
seconds I get a very strong cpu load spike, that is maybe related (my
guess) to the usage of plugin (maybe periodic cleaning each 256
secs?). When there is no spike, the cpu load is 0.0% with occasional
0.1% any 60-90 secs.

I ran the latency test code with plughw:0 (I can't use latency.c with
my virtual cards because they can't link the in and out togheter)
using the blocking mode, real time, no poll. Any 256 secs, spike! (a
cpu load for latency.c of 45.00%, for roughly a sec, with the
cumulated cpu time of the latency.c app reported from top -d 1.0
passing from:
0:00.01
to:
0:00.64
to:
0:01.26
etc, any 256 seconds.


latency.c output:

 ./latency -P plughw:0 -C plughw:0 -f S16_LE -c 1 -r 8000  -m 320  -M
960 -s 600 -b
Playback device is plughw:0
Capture device is plughw:0
Parameters are 8000Hz, S16_LE, 1 channels, blocking mode
Wanted tick time: 0us, poll mode: no
Loop limit is 4800000 frames, minimum latency = 320, maximum latency = 960
Plug PCM: Route conversion PCM (sformat=S32_LE)
  Transformation table:
    0 <- 0
    1 <- 0
    2 <- 0
    3 <- 0
    4 <- 0
    5 <- 0
    6 <- 0
    7 <- 0
    8 <- 0
    9 <- 0
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 1
  rate         : 8000
  exact rate   : 8000 (8000/1)
  msbits       : 16
  buffer_size  : 320
  period_size  : 160
  period_time  : 20000
  tick_time    : 10000
  tstamp_mode  : NONE
  period_step  : 1
  sleep_min    : 0
  avail_min    : 160
  xfer_align   : 1
  start_threshold  : 2147483647
  stop_threshold   : 320
  silence_threshold: 0
  silence_size : 0
  boundary     : 1342177280
Slave: Hardware PCM card 0 'M Audio Delta 1010LT' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 10
  rate         : 8000
  exact rate   : 8000 (8000/1)
  msbits       : 24
  buffer_size  : 320
  period_size  : 160
  period_time  : 20000
  tick_time    : 10000
  tstamp_mode  : NONE
  period_step  : 1
  sleep_min    : 0
  avail_min    : 160
  xfer_align   : 1
  start_threshold  : 2147483647
  stop_threshold   : 320
  silence_threshold: 0
  silence_size : 0
  boundary     : 1342177280
Plug PCM: Route conversion PCM (sformat=S32_LE)
  Transformation table:
    0 <- 0*0.0833333 + 1*0.0833333 + 2*0.0833333 + 3*0.0833333 +
4*0.0833333 + 5*0.0833333 + 6*0.0833333 + 7*0.0833333 + 8*0.0833333 +
9*0.0833333 + 10*0.0833333 + 11*0.0833333
Its setup is:
  stream       : CAPTURE
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 1
  rate         : 8000
  exact rate   : 8000 (8000/1)
  msbits       : 16
  buffer_size  : 320
  period_size  : 160
  period_time  : 20000
  tick_time    : 10000
  tstamp_mode  : NONE
  period_step  : 1
  sleep_min    : 0
  avail_min    : 160
  xfer_align   : 1
  start_threshold  : 2147483647
  stop_threshold   : 320
  silence_threshold: 0
  silence_size : 0
  boundary     : 1342177280
Slave: Hardware PCM card 0 'M Audio Delta 1010LT' device 0 subdevice 0
Its setup is:
  stream       : CAPTURE
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 12
  rate         : 8000
  exact rate   : 8000 (8000/1)
  msbits       : 24
  buffer_size  : 320
  period_size  : 160
  period_time  : 20000
  tick_time    : 10000
  tstamp_mode  : NONE
  period_step  : 1
  sleep_min    : 0
  avail_min    : 160
  xfer_align   : 1
  start_threshold  : 2147483647
  stop_threshold   : 320
  silence_threshold: 0
  silence_size : 0
  boundary     : 1342177280
Trying latency 320 frames, 40000.000us, 40.000000ms (25.0000Hz)
Success
Playback:
*** frames = 4800320 ***
  state       : RUNNING
  trigger_time: 1176471431.639255951
  tstamp      : 1176472031.482713139
  delay       : 317
  avail       : 3
  avail_max   : 192
Capture:
*** frames = 4800000 ***
  state       : RUNNING
  trigger_time: 1176471431.639255951
  tstamp      : 1176472031.482757926
  delay       : 1
  avail       : 1
  avail_max   : 189
Maximum read: 160 frames
Maximum read latency: 20000.000us, 20.000000ms (50.0000Hz)
Hardware sync
Playback time = 1176471431.639255, Record time = 1176471431.639255, diff = 0

new asound.conf:

pcm.c3 {
    type dsnoop
    ipc_key 56789
    slave {
        pcm "hw:0,0"
        rate 8000
        period_time 0
        period_size 320
        channels 12
        format S32_LE
    }
    bindings {
        0 2
    }
}
pcm.capt3 {
    type plug
        slave.pcm c3
}

pcm.c4 {
    type dsnoop
    ipc_key 56789
    slave {
        pcm "hw:0,0"
        rate 8000
        period_time 0
        period_size 320
        channels 12
        format S32_LE
    }
    bindings {
        0 3
    }
}
pcm.capt4 {
    type plug
        slave.pcm c4
}


pcm.c5 {
    type dsnoop
    ipc_key 56789
    slave {
        pcm "hw:0,0"
        rate 8000
        period_time 0
        period_size 320
        channels 12
        format S32_LE
    }
    bindings {
        0 4
    }
}
pcm.capt5 {
    type plug
        slave.pcm c5
}


pcm.c6 {
    type dsnoop
    ipc_key 56789
    slave {
        pcm "hw:0,0"
        rate 8000
        period_time 0
        period_size 320
        channels 12
        format S32_LE
    }
    bindings {
        0 5
    }
}
pcm.capt6 {
    type plug
        slave.pcm c6
}

pcm.c7 {
    type dsnoop
    ipc_key 56789
    slave {
        pcm "hw:0,0"
        rate 8000
        period_time 0
        period_size 320
        channels 12
        format S32_LE
    }
    bindings {
        0 6
    }
}
pcm.capt7 {
    type plug
        slave.pcm c7
}


pcm.c8 {
    type dsnoop
    ipc_key 56789
    slave {
        pcm "hw:0,0"
        rate 8000
        period_time 0
        period_size 320
        channels 12
        format S32_LE
    }
    bindings {
        0 7
    }
}
pcm.capt8 {
    type plug
        slave.pcm c8
}

#############################
#############################

pcm.s3 {
    type dshare
    ipc_key 123456789
    slave {
        pcm "hw:0,0"
        rate 8000
        period_time 0
        period_size 320
        channels 10
        format S32_LE
    }
    bindings {
        0 2
    }
}
pcm.play3 {
    type plug
        slave.pcm s3
}

pcm.s4 {
    type dshare
    ipc_key 123456789
    slave {
        pcm "hw:0,0"
        rate 8000
        period_time 0
        period_size 320
        channels 10
        format S32_LE
    }
    bindings {
        0 3
    }
}
pcm.play4 {
    type plug
        slave.pcm s4
}

pcm.s5 {
    type dshare
    ipc_key 123456789
    slave {
        pcm "hw:0,0"
        rate 8000
        period_time 0
        period_size 320
        channels 10
        format S32_LE
    }
    bindings {
        0 4
    }
}
pcm.play5 {
    type plug
        slave.pcm s5
}

pcm.s6 {
    type dshare
    ipc_key 123456789
    slave {
        pcm "hw:0,0"
        rate 8000
        period_time 0
        period_size 320
        channels 10
        format S32_LE
    }
    bindings {
        0 5
    }
}
pcm.play6 {
    type plug
        slave.pcm s6
}

pcm.s7 {
    type dshare
    ipc_key 123456789
    slave {
        pcm "hw:0,0"
        rate 8000
        period_time 0
        period_size 320
        channels 10
        format S32_LE
    }
    bindings {
        0 6
    }
}
pcm.play7 {
    type plug
        slave.pcm s7
}


pcm.s8 {
    type dshare
    ipc_key 123456789
    slave {
        pcm "hw:0,0"
        rate 8000
        period_time 0
        period_size 320
        channels 10
        format S32_LE
    }
    bindings {
        0 7
    }
}
pcm.play8 {
    type plug
        slave.pcm s8
}









On 4/13/07, Giovanni Maruzzelli <gmaruzz.lists at gmail.com> wrote:
> Thanks a lot Jaroslav, I'll apply your suggestions and I'll report here
>
> On 4/13/07, Jaroslav Kysela <perex at suse.cz> wrote:
> > On Fri, 13 Apr 2007, Giovanni Maruzzelli wrote:
> >
> > > Dear Alsa developers,
> > >
> > > I want to use a 1010lt (ice1712 driver) as 6 analog mono duplex cards.
> > >
> > > I want to use the /etc/asound.conf (.asoundrc) to split the card (that
> > > has 8 in and 8 out - but I use just 6 in/out), with minimal latency.
> > >
> > > I mean, I want to record and play (duplex) from/to each virtual card
> > > concurrently and from separate application instances.
> > >
> > > My app works with S16_LE, 8000, mono.
> > >
> > > Is the following asound.conf (.asoundrc) correct and efficient for this?
> >
> > Use dsnoop bindings rather than routing (ttable) for capture too,
> > otherwise alsa-lib works with all channels internally.
> >
> > > I got spikes of cpu load (at 5-6%) on each virtual card any roughly
> > > 256 seconds when using a(play|record) to record or play from/to any
> >
> > aplay|arecord is not very good test. Use latency test code - available in
> > alsa-lib/test directory.
> >
> >                                                 Jaroslav
> >
> > -----
> > Jaroslav Kysela <perex at suse.cz>
> > Linux Kernel Sound Maintainer
> > ALSA Project, SUSE Labs
> >
>


More information about the Alsa-devel mailing list