[alsa-devel] UCM files for tegra-wm8903 on seaboard

Stephen Warren swarren at nvidia.com
Thu May 19 00:40:38 CEST 2011


Liam,

I've come up with a basic set of UCM files for Tegra Seaboard, included
below. I briefly tested parts of them with alsaucm.

I do have a few questions on UCM and how to write these files before I
go too far:

Some of the answers may depend on, or be impacted by, policy decisions
by the user of UCM; general desktop PulseAudio may have different
requirements to a more tightly controlled ChromeOS configuration. I'm
not sure how much that impacts the UCM files themselves, or whether the
UCM files are supposed to be fully general and hence the same for all
OSs and policy setups.

1) Can multiple verbs be active at once? In other words, I have cases
defined for HiFi (playback) and Record (capture). Should these be merged
together such that both playback and capture can operate at once, or can
an application just active both verbs at once when it wants to do
multiple things?

2) In the ChromeOS kernel, there's a separate PCM for playback to WM8903
and playback to the SPDIF controller, and hence on to HDMI. Since these
use different values for PlaybackPCM, I defined separate use-cases for
analog and HDMI/SPDIF playback. Is this the typical way of splitting
things up, or would one typically have a unified use-case with the
PlaybackPCM Value being part of the SectionDevice?

3) For the HiFi case, there are a couple of volume controls in serial;
i.e. "Digital Playback Volume" affects both speaker/headphone output
whereas "Speaker Volume" and "Headphone Volume" affect just one of the
devices. I've defined a PlaybackVolume Value for the overall verb and
the same Value for each device. Are applications able to query the
Value separately for verb and devices, or will using the same name
cause conflicts? Is there any kind of (de-facto) standard for how to
represent this situation?

Thanks very much for any feedback.

------------------
tegra-wm8903-seaboard.conf:

# UCM configuration for Tegra WM8903 driver for Seaboard

SectionUseCase."Record" {
    File "record"
    Comment "Record"
}

SectionUseCase."HiFi" {
    File "hifi"
    Comment "Play HiFi quality Music"
}

SectionUseCase."HiFi HDMI" {
    File "hdmi"
    Comment "Play HiFi quality Music over HDMI"
}

SectionDefaults [
    cdev "hw:0"

    cset "name='Headphone Switch' off,off"
    cset "name='Left Output Mixer DACL Switch' on"
    cset "name='Left Output Mixer DACR Switch' off"
    cset "name='Left Output Mixer Left Bypass Switch' off"
    cset "name='Left Output Mixer Right Bypass Switch' off"
    cset "name='Right Output Mixer DACL Switch' off"
    cset "name='Right Output Mixer DACR Switch' on"
    cset "name='Right Output Mixer Left Bypass Switch' off"
    cset "name='Right Output Mixer Right Bypass Switch' off"

    cset "name='Int Spk Switch' off"
    cset "name='Speaker Switch' off,off"
    cset "name='Left Speaker Mixer DACL Switch' on"
    cset "name='Left Speaker Mixer DACR Switch' off"
    cset "name='Left Speaker Mixer Left Bypass Switch' off"
    cset "name='Left Speaker Mixer Right Bypass Switch' off"
    cset "name='Right Speaker Mixer DACL Switch' off"
    cset "name='Right Speaker Mixer DACR Switch' on"
    cset "name='Right Speaker Mixer Left Bypass Switch' off"
    cset "name='Right Speaker Mixer Right Bypass Switch' off"

    cset "name='Left Input PGA Switch' off"
    cset "name='Right Input PGA Switch' off"
    cset "name='Right Inverting Input Mux' 'IN2R'"
]

------------------
hifi:

SectionVerb {
    Value {
        PlaybackPCM "hw:0,0"
        PlaybackVolume "Digital Playback Volume"
    }
}

SectionDevice."Speakers".0 {
    Comment "Internal Speakers"

    EnableSequence [
        cdev "hw:0"
        cset "name='Speaker Switch' on,on"
        cset "name='Int Spk Switch' on"
    ]

    DisableSequence [
        cdev "hw:0"
        cset "name='Speaker Switch' off,off"
        cset "name='Int Spk Switch' off"
    ]

    Value {
        PlaybackVolume "Speaker Volume"
        PlaybackSwitch "Speaker Switch"
    }
}

SectionDevice."Headphones".0 {
    Comment "Headphone Jack"

    EnableSequence [
        cdev "hw:0"
        cset "name='Headphone Switch' on,on"
    ]

    DisableSequence [
        cdev "hw:0"
        cset "name='Headphone Switch' off,off"
    ]

    Value {
        PlaybackVolume "Headphone Volume"
        PlaybackSwitch "Headphone Switch"
    }
}

------------------
hifi-hdmi:

SectionVerb {
    Value {
        PlaybackPCM "hw:0,1"
    }
}

SectionDevice."HDMI".0 {
    Comment "HDMI"
}

------------------
record:

SectionVerb {
    Value {
        CapturePCM "hw:0,0"
        CaptureVolume "Digital Capture Volume"
    }
}

SectionDevice."AMIC".0 {
    Comment "Analog Microphone Jack"

    EnableSequence [
        cdev "hw:0"
        cset "name='ADC Input' 'ADC'"
        cset "name='Left Capture Mux' 'Right'"
        cset "name='Right Capture Mux' 'Right'"
    ]

    Value {
        CaptureVolume "Right Input PGA Volume"
    }
}

SectionDevice."DMIC".0 {
    Comment "Internal Digital Microphone"

    EnableSequence [
        cdev "hw:0"
        cset "name='ADC Input' 'DMIC'"
        cset "name='Left Capture Mux' 'Left'"
        cset "name='Right Capture Mux' 'Right'"
    ]

    Value {
    }
}

-- 
nvpublic



More information about the Alsa-devel mailing list