.asoundrc howto. (was Re: [linux-audio-user] SBLive mailing list?)

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

Subject: .asoundrc howto. (was Re: [linux-audio-user] SBLive mailing list?)
From: Patrick Shirkey (pshirkey_AT_boosthardware.com)
Date: Fri Sep 21 2001 - 13:29:03 EEST


Frank Barknecht wrote:

> One thing missing in the ALSA docs is a clear explanation of the
> asoundrc-system. A Howto for all those plughw, plug, front, surround5,
> you-name-it thingies would be nice. Any takers?

Paul Davis mentioned that he would like to but also said he doesn't have
the time. It seems like there aren't that many people who fully
understand it.

Here's what I have collected so far:

-------
.asoundrc

you only need a .asoundrc file if (for example):

    1) you want to use specific names for your cards, OR
    2) you want to use alsa-lib's ability to create "fake" PCM devices
          with various specific characteristics
======
**The second is the most interesting but how to go about taking
advantage of it is anyones guess ;-)
=======
---------

/usr/share/alsa/alsa.conf drives everything. This means that with
default content also /etc/asound.conf and ~/.asoundrc are loaded

---------

    the primary benefit of this system is a centralized location for
    defining which ALSA devices to use. it will also help me personally,
    because as I move back and forth between the studio and home, the
card
    number of the hammerfall changes.

    !!!!!!!!!!
    KEEP IN MIND THAT THE EXACT SYNTAX OF THE .asoundrc FILE WILL LIKELY
    BE MODIFIED BY ALSA OVER TIME
    !!!!!!!!!!

    --p (Abstraction is our friend :)

    -- /proc/asound/cards ----------------------------------------
    0 [Tropez+ ]: Tropez+ - Turtle Beach Tropez+
                         Tropez+ PCM 0x530 irq 5 dma 1&0 SYNTH 0x200 irq
15
    1 [4D ]: 4DWave - Trident 4DWave PCI
                         Trident 4DWaveNX at 0xe400, irq 7
    2 [Hammerfall ]: Hammerfall - RME Digi9652 (Rev 1.5)
                         RME Digi9652 (Rev 1.5) at 0xfd000000, irq 11
    3 [card4 ]: Hammerfall - RME Digi9652 (Rev G)
                         RME Digi9652 (Rev G) at 0xfc000000, irq 9

    -- ~/.asoundrc -------------------------------------------------

    ctltype.hw {
            open _snd_ctl_hw_open
    }

    pcm.tropez {
            type hw
            card Tropez+
            device 0
    }

    ctl.tropez {
            type hw
            card 0
    }

    pcm.trident {
            type hw
            card 4D
    }

    ctl.trident {
            type hw
            card 1
    }

    pcm.hammerfall {
            type hw
            card Hammerfall
    }

    ctl.hammerfall {
            type hw
            card 2
    }

    pcm.hammerfall2 {
            type hw
            card 3
    }

    ctl.hammerfall2 {
            type hw
            name card4
    }
-------------

ttable

ttable means routing table between source (hardware) and destination
(arecord). The two numbers means the channel number and the one means
the
gain (0 - 1.0). Unassigned values defaults to 0 (silence).

So, the plughw uses:

ttable.0.0 1
ttable.1.1 1

etc..

---------
> > BTW, while i'm here, what is the difference between "plug" and
> > "plughw" ?
>
> Wish I knew... maybe Abramo can clarify?

In brief plughw slave is always an hw PCM while plug can have whatever
kind of slave PCM.

See /usr/share/alsa/alsa.conf for the definition (I think you'll find
interesting the definitions inside this files).

-------

-- 
Patrick Shirkey - Manager Boost Hardware
Limited.                                                                                           
http://www.boosthardware.com - For the discerning hardware connoisseur.
http://www.boosthardware.com/LAU/Linux_Audio_Users_Guide/
=======================================================================


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

This archive was generated by hypermail 2b28 : Fri Sep 21 2001 - 13:16:09 EEST