[linux-audio-dev] Re: [Linuxsampler-devel] buffers, periods, & fragments

From: Garett Shulman <shulmang@email-addr-hidden>
Date: Sun Sep 18 2005 - 23:59:58 EEST

Flo, Thanks for the jack suggestion. I definetly do need to spend some
time working with jack on my system. Also, thanks for the great low
latency documentation on tapas - ugh!. After getting 2.6 setup with |
Preemptible Kernel (Low-Latency Desktop), fiddeling with my hardware to
get the soundcard irq's right, and some tweeking with chrt all I can say
is "wow. WOW!".
I don't think there is anything you can do on a 2.4 kernel to get close
to this level of performance and control. Sweet! I almost giggle as the
entire system temporarily hangs while linuxsampler loads gig files at
outrageous speed. Also, I wanted to let you know that after a bit more
hacking I was able to get dshare working with the ice1712. It's awesome.
I can send linuxsampler out of channels 1-4 and have fluidsynth playing
out of channels 5 & 6, with 2 channels to spare for ecasound or
something... all simultaneously, at very low latency, & hardly any
processor load. I paid for the hardware... might as well take advantage
of it. Besides, this way I can give my processor a break, under-clock
it, & keep fan volume very low. Here is a snippet from asound.conf. -Garett

|pcm_slave.66_slave {
    pcm "hw:1,0"
    channels 8
    rate 44100
    buffer_size 256
    period_size 128
}

pcm.66ch1234_dshare {
    type dshare
    ipc_key 18273645
    slave 66_slave
    bindings.0 0
    bindings.1 1
    bindings.2 2
    gindings.3 3
}

pcm.66ch1234 {
    type plug
    slave.pcm "66ch1234_dshare"
}

pcm.66ch56_dshare {
    type dshare
    ipc_key 18273645
    slave 66_slave
    bindings.0 4
    bindings.1 5
}

pcm.66ch56
    type plug
    slave.pcm "66ch56_dshare"
}

Florian Schmidt wrote:

> On Thu, 15 Sep 2005 22:40:32 -0600
> Garett Shulman <shulmang@email-addr-hidden> wrote:
>
>> Hello, I have been fooling around with my alsa asound.conf in an attempt
>> to take advantage of the hardware mixer in my ice1712 and have multiple
>> apps output to it.
>
>
> The hw mixer on the ice1712 is not doing what one normally refers to as
> hardware mixing with consumer grade cards (i.e. allowing several apps
> concurrent access at the same time). It mixes and routes channels from
> its single 10 in/12 out channel device.
>
> The way to get concurrent access with an ice1712 based card is _software
> mixing_. That is, ALSA needs to do it (or whatever sounddriver you use).
>
> I would urge you to take a very long look at JACK though. LinuxSampler
> has excellent jack support and most apps made for peolpe creating music
> usually have jack support, too. You'll save yourself lots of hassles
> (setting up jackd isn't so tough when you read some docs). It is very
> simple to route specific LS patches to specific output channels on your
> ice based card when using jack.
>
>> In order to acomplish this I need linuxsampler to be
>> able to access devices I setup in asound.conf instead of just hw:x,x
>> devices. This was easy enough to acomplish by nuking all of the '"hw:"
>> +' code from AudioOutputDeviceAlsa.cpp. The next issue relates to the
>> fact that the alsa dshare plugin requires that all of the "virtual
>> devices" that I create from the ice1712 card share the same buffer_size,
>> period_size, periods, & period_time settings. So, linuxsampler crashes
>> when it tries to set buffersize and periods. I figured I would just find
>> out what linuxsampler was trying to use for those values, setup the same
>> values in the asound.conf and then comment the code that sets them in
>> linuxsampler. This seems to work except that when linuxsampler connects
>> to the device I notice click and pops from the device & the output from
>> linuxsampler is rather distorted. I suspect that I'm just not setting
>> the values quite right in asound.conf. However, I guess I also may be
>> just mangleing linuxsampler beyond proper function. :) I was wondering
>> if anywone has any suggestions. When linuxsampler tries to set the
>> buffersize it is using FragmentSize=128 and Fragments=2. So I am
>> interpreting this as period_size=128, periods=2, & buffer_size=256. The
>> slave device in asound.conf looks like this:
>> pcm_slave.66_slave {
>> pcm "hw:0,0'
>> channels 8
>> rate 48000
>> buffer_size 256
>> period_size 128
>> periods 2 #I also tried 1 here... counting from 0...
>> period_time 0
>> }
>> Then I create some dshare devices from this and some plug devices for
>> each dshare device and connect linuxsampler to one of the plug devices.
>> Any suggestions would be greatly appreciated. -Garett
>
>
> dshare still won't allow you to have multiple apps use your ice1712
> card. You'll need dmix for that. Have a look at alsa.opensrc.org if you
> want to go this route. dmix will probably kill latency though.
>
> But better take a look at jackit.sf.net.
>
> Regards,
> Flo
>
Received on Mon Sep 19 04:15:04 2005

This archive was generated by hypermail 2.1.8 : Mon Sep 19 2005 - 04:15:05 EEST