Re: [linux-audio-user] CSound with 8 ch

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-user] CSound with 8 ch
From: Tommaso Leddi (leddit_AT_libero.it)
Date: Sat May 04 2002 - 14:31:35 EEST


Hi,
thanks Kevin for your email:

> I am trying to do the exact same thing with two boxes I admin, both with
> 9652's and SBLive's for MIDI (and lo-fi audio streams). I would be happy
> to offer whatever assistance I can, but if fact it sounds like you are
> further along than I. I would love to help, as I know linux/alsa pretty
> well at this point.
>
> Would you be willing to post your setup (exact .asoundrc, modules.conf
> perhaps, etc) along with a brief description of how you are routing signal
> to the various channels individually (how does Csound communicate with
> these ouputs?). I know that there are others who would be interested in
> more information on mult-channel with ALSA and the Hammerfall, especially
> with Csound.

Here are the configuration files from our PC

>>> BEGIN ALSA related part of /etc/modules.conf <<<

alias char-major-116 snd
alias snd-card-0 snd-rme9652
alias char-major-14 soundcore
alias sound-slot-0 snd-card-0
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
options snd snd_major=116 snd_cards_limit=2
options snd-rme9652 snd_index=0

alias snd-card-1 snd-emu10k1
alias char-major-14 soundcore
alias sound-slot-1 snd-card-1
alias sound-service-1-0 snd-mixer-oss
alias sound-service-1-1 snd-seq-oss
alias sound-service-1-3 snd-pcm-oss
alias sound-service-1-8 snd-seq-oss
alias sound-service-1-12 snd-pcm-oss
options snd-emu10k1 snd_index=1

>>>ALSA related part of /etc/modules.conf END <<<

>>>BEGIN /usr/share/alsa/alsa.conf <<<
#
# ALSA library configuration file
#

# pre-load the configuration files

@hooks [
        {
                func load
                files [
                        "/etc/asound.conf"
                        "~/.asoundrc"
                ]
                errors false
        }
]

# load card-specific configuration files (on request)

cards._AT_hooks [
        {
                func load
                files [
                        {
                                @func concat
                                strings [
                                        { @func datadir }
                                        "/cards/aliases.conf"
                                ]
                        }
                ]
        }
        {
                func load_for_all_cards
                files [
                        {
                                @func concat
                                strings [
                                        { @func datadir }
                                        "/cards/"
                                        { @func private_string }
                                        ".conf"
                                ]
                        }
                ]
                errors false
        }
]

# defaults

defaults.ctl.card 0
defaults.pcm.card 0
defaults.pcm.device 0
defaults.pcm.subdevice -1
defaults.pcm.front.card defaults.pcm.card
defaults.pcm.front.device defaults.pcm.device
defaults.pcm.rear.card defaults.pcm.card
defaults.pcm.rear.device defaults.pcm.device
defaults.pcm.center_lfe.card defaults.pcm.card
defaults.pcm.center_lfe.device defaults.pcm.device
defaults.pcm.surround40.card defaults.pcm.card
defaults.pcm.surround40.device defaults.pcm.device
defaults.pcm.surround51.card defaults.pcm.card
defaults.pcm.surround51.device defaults.pcm.device
defaults.pcm.iec958.card defaults.pcm.card
defaults.pcm.iec958.device defaults.pcm.device
defaults.rawmidi.card 0
defaults.rawmidi.device 0
defaults.rawmidi.subdevice -1
defaults.hwdep.card 0
defaults.hwdep.device 0
defaults.timer.class 2
defaults.timer.sclass 0
defaults.timer.card 0
defaults.timer.device 0
defaults.timer.subdevice 0

#
# PCM interface
#

pcm.hw {
        @args [ CARD DEV SUBDEV ]
        @args.CARD {
                type string
                default {
                        @func getenv
                        vars [
                                ALSA_PCM_CARD
                                ALSA_CARD
                        ]
                        default {
                                @func refer
                                name defaults.pcm.card
                        }
                }
        }
        @args.DEV {
                type integer
                default {
                        @func igetenv
                        vars [
                                ALSA_PCM_DEVICE
                        ]
                        default {
                                @func refer
                                name defaults.pcm.device
                        }
                }
        }
        @args.SUBDEV {
                type integer
                default {
                        @func refer
                        name defaults.pcm.subdevice
                }
        }
        type hw
        card $CARD
        device $DEV
        subdevice $SUBDEV
}

pcm.plughw {
        @args [ CARD DEV SUBDEV ]
        @args.CARD {
                type string
                default {
                        @func getenv
                        vars [
                                ALSA_PCM_CARD
                                ALSA_CARD
                        ]
                        default {
                                @func refer
                                name defaults.pcm.card
                        }
                }
        }
        @args.DEV {
                type integer
                default {
                        @func igetenv
                        vars [
                                ALSA_PCM_DEVICE
                        ]
                        default {
                                @func refer
                                name defaults.pcm.device
                        }
                }
        }
        @args.SUBDEV {
                type integer
                default {
                        @func refer
                        name defaults.pcm.subdevice
                }
        }
        type plug
        slave.pcm {
                type hw
                card $CARD
                device $DEV
                subdevice $SUBDEV
        }
}

pcm.plug {
        @args [ SLAVE ]
        @args.SLAVE {
                type string
        }
        type plug
        slave.pcm $SLAVE
}

pcm.shm {
        @args [ SOCKET PCM ]
        @args.SOCKET {
                type string
        }
        @args.PCM {
                type string
        }
        type shm
        server $SOCKET
        pcm $PCM
}

pcm.tee {
        @args [ SLAVE FILE FORMAT ]
        @args.SLAVE {
                type string
        }
        @args.FILE {
                type string
        }
        @args.FORMAT {
                type string
                default raw
        }
        type file
        slave.pcm $SLAVE
        file $FILE
        format $FORMAT
}

pcm.file {
        @args [ FILE FORMAT ]
        @args.FILE {
                type string
        }
        @args.FORMAT {
                type string
                default raw
        }
        type file
        slave.pcm null
        file $FILE
        format $FORMAT
}

pcm.null {
        type null
}

pcm.default {
        type plug
        slave.pcm {
                type hw
                card {
                        @func getenv
                        vars [
                                ALSA_PCM_CARD
                                ALSA_CARD
                        ]
                        default {
                                @func refer
                                name defaults.pcm.card
                        }
                }
                device {
                        @func igetenv
                        vars [
                                ALSA_PCM_DEVICE
                        ]
                        default {
                                @func refer
                                name defaults.pcm.device
                        }
                }
                subdevice {
                        @func refer
                        name defaults.pcm.subdevice
                }
        }
}

# redirect to load-on-demand extended pcm definitions
pcm.cards cards.pcm
# some links for easy use
pcm.front cards.pcm.front
pcm.rear cards.pcm.rear
pcm.center_lfe cards.pcm.center_lfe
pcm.surround40 cards.pcm.surround40
pcm.surround51 cards.pcm.surround51
pcm.iec958 cards.pcm.iec958
pcm.spdif cards.pcm.iec958

#
# Control interface
#
        
ctl.hw {
        @args[ CARD ]
        @args.CARD {
                type string
                default {
                        @func getenv
                        vars [
                                ALSA_CTL_CARD
                                ALSA_CARD
                        ]
                        default {
                                @func refer
                                name defaults.ctl.card
                        }
                }
        }
        type hw
        card $CARD
}

ctl.shm {
        @args [ SOCKET CTL ]
        @args.SOCKET {
                type string
        }
        @args.CTL {
                type string
        }
        type shm
        server $SOCKET
        ctl $CTL
}

ctl.default {
        type hw
        card {
                @func getenv
                vars [
                        ALSA_CTL_CARD
                        ALSA_CARD
                ]
                default {
                        @func refer
                        name defaults.ctl.card
                }
        }
}

#
# RawMidi interface
#

rawmidi.hw {
        @args [ CARD DEV SUBDEV ]
        @args.CARD {
                type string
                default {
                        @func getenv
                        vars [
                                ALSA_RAWMIDI_CARD
                                ALSA_CARD
                        ]
                        default {
                                @func refer
                                name defaults.rawmidi.card
                        }
                }
        }
        @args.DEV {
                type integer
                default {
                        @func igetenv
                        vars [
                                ALSA_RAWMIDI_DEVICE
                        ]
                        default {
                                @func refer
                                name defaults.rawmidi.device
                        }
                }
        }
        @args.SUBDEV {
                type integer
                default -1
        }
        type hw
        card $CARD
        device $DEV
        subdevice $SUBDEV
}

rawmidi.default {
        type hw
        card {
                @func getenv
                vars [
                        ALSA_RAWMIDI_CARD
                        ALSA_CARD
                ]
                default {
                        @func refer
                        name defaults.rawmidi.card
                }
        }
        device {
                @func igetenv
                vars [
                        ALSA_RAWMIDI_DEVICE
                ]
                default {
                        @func refer
                        name defaults.rawmidi.device
                }
        }
}

#
# Sequencer interface
#

seq.default {
        type hw
}

seq.hw {
        type hw
}

#
# HwDep interface
#

hwdep.hw {
        @args [ CARD DEV ]
        @args.CARD {
                type string
                default {
                        @func getenv
                        vars [
                                ALSA_HWDEP_CARD
                                ALSA_CARD
                        ]
                        default {
                                @func refer
                                name defaults.hwdep.card
                        }
                }
        }
        @args.DEV {
                type integer
                default {
                        @func igetenv
                        vars [
                                ALSA_HWDEP_DEVICE
                        ]
                        default {
                                @func refer
                                name defaults.hwdep.device
                        }
                }
        }
        type hw
        card $CARD
        device $DEV
}

hwdep.default {
        type hw
        card {
                @func getenv
                vars [
                        ALSA_HWDEP_CARD
                        ALSA_CARD
                ]
                default {
                        @func refer
                        name defaults.hwdep.card
                }
        }
        device {
                @func igetenv
                vars [
                        ALSA_HWDEP_DEVICE
                ]
                default {
                        @func refer
                        name defaults.hwdep.device
                }
        }
}

#
# Timer interface
#

timer_query.hw {
        type hw
}

timer_query.default {
        type hw
}

timer.hw {
        @args [ CLASS SCLASS CARD DEV SUBDEV ]
        @args.CLASS {
                type integer
                default {
                        @func refer
                        name defaults.timer.class
                }
        }
        @args.SCLASS {
                type integer
                default {
                        @func refer
                        name defaults.timer.sclass
                }
        }
        @args.CARD {
                type string
                default {
                        @func refer
                        name defaults.timer.card
                }
        }
        @args.DEV {
                type integer
                default {
                        @func refer
                        name defaults.timer.device
                }
        }
        @args.SUBDEV {
                type integer
                default {
                        @func refer
                        name defaults.timer.subdevice
                }
        }
        type hw
        class $CLASS
        sclass $SCLASS
        card $CARD
        device $DEV
        subdevice $SUBDEV
}

timer.default {
        type hw
        class {
                @func refer
                name defaults.timer.class
        }
        sclass {
                @func refer
                name defaults.timer.sclass
        }
        card {
                @func refer
                name defaults.timer.card
        }
        device {
                @func refer
                name defaults.timer.device
        }
        subdevice {
                @func refer
                name defaults.timer.subdevice
        }
}
>>>/usr/share/alsa/alsa.conf END<<<

Files /etc/asound.conf and /~/.asoundrc are not present here (SuSE 8.0).

> By the way, you and others can correct me if I am wrong, but I believe
> Csound 4.13 had a number of nasty bugs in it (and real multi-channel was
> pretty new). You might consider updating to 4.18 or so, which seems to have
> ironed out most of the kinks.
>
> Kevin
>
> --- Tommaso Leddi <leddit_AT_libero.it> wrote:
> > Hi all,
> > I'm trying to use the RME 9652 audio board with CSound. On the same pc we
> > use
> >
> > a SBLive!to get MIDI communication.
> > The borads are properly configured under alsa-0.9.0_cvs20020320-12.
> > I've successfully used 4 channels simultaneously (using "outq"), but I
> > can't use all the eight board channels (using "outo"). I get this error
> > message: "rtaudio:
> > illegal dsize". I'm using Unofficial Linux Csound Version v4.13.0.0a (Jun
> > 19 2001) (floats are floats).
> > I don't know if this is a ALSA or Csound related problem. Have you got
> > any hints or ideas to avoid the problem?
> >
> > ciao,
> > Tommaso Leddi
> >
> > I include the csound source files and the error message log.
> >
> > --- ERROR MESSAAGE ---
> >
> > claudio:/home/claudio/Tom/Boulanger # csound -odevaudio mytoot3.orc
> > mytoot3.sco
> > Using csound.txt
> > Unofficial Linux Csound Version v4.13.0.0a (Jun 19 2001)(floats are
> > floats) BEWARE: this is not the canonical version! (caveat emptor)
> > Please report bugs of this version to
> > http://www.ilogic.com.au/cgi-bin/csound-bugs
> > Can't open /root/.csoundrc
> > orchname: mytoot3.orc
> > scorename: mytoot3.sco
> > sorting score ...
> > ... done
> > ....orch compiler:
> > 11 lines read
> > instr 3
> > Unofficial Linux Csound Version v4.13.0.0a (Jun 19 2001)(floats are
> > floats) orch now loaded
> > audio buffered in 1024 sample-frame blocks
> > hardware buffers set to 2048 bytes
> > rtaudio: illegal dsize
> >
> > --- CSOUND .ORC ---
> >
> > sr = 44100
> > kr = 4410
> > ksmps = 10
> > nchnls = 8
> >
> > instr 3 ; p3=duration of note
> > k1 linen p4, p6, p3, p7 ; p4=amp
> > a1 oscil k1, p5, 1 ; p5=freq
> > outo a1, a1*0.01, a1*0.01, a1*0.01, a1*0.01, a1*0.01,
> > a1*0.01, a1*0.01 ; p6=attack time
> > endin
> >
> > --- CSOUND .SCO ---
> >
> > f1 0 4096 10 1 ; sine wave
> >
> > ; ins strt dur amp(p4) freq(p5) attack(p6)
> > release(p7) i3 0 1000 10000 440 5
> > .7 i3 1.5 1000 10000 440 .9 .1 i3
> > 3 1000 5000 880 .02 .99 i3 4.5
> > 7000 5000 880 0 5 i3 6 2000
> > 20000 220 .5 .5 e
>
> =====
> Kevin Ernste
> kevine_AT_ecmc.rochester.edu
> http://www.esm.rochester.edu/kevine
>
> "An eye for an eye makes the whole world blind." -MLK
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> http://health.yahoo.com


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Sat May 04 2002 - 14:19:40 EEST