Syntax 6

SectionDevice."Speaker" {
    Comment "Internal Speaker"

    Value {
        PlaybackChannels "2"
        PlaybackPriority "100"
        PlaybackPCM "hw:RX51,0"
        PlaybackVolume "HP Playback Volume"
        PlaybackSwitch "HP Playback Switch"
    }

    EnableSequence [
        cdev "hw:${CardId}"
        cset "name='Speaker Function' On"
        cset "name='HP Playback Switch' on"
    ]

    DisableSequence [
        cdev "hw:${CardId}"
        cset "name='Speaker Function' Off"
        cset "name='HP Playback Switch' off"
    ]
}

SectionDevice."Headphones" {
    Comment "Headphones"

    Value {
        PlaybackPCM "hw:RX51,0"
        PlaybackChannels "2"
        JackControl "AV Jack"
        PlaybackPriority "300"
        PlaybackVolume "HP Playback Volume"
        PlaybackSwitch "HP Playback Switch"
    }

    EnableSequence [
        cdev "hw:${CardId}"
        cset "name='Jack Function' Headphone"
        cset "name='HP Playback Switch' on"
        cset "name='TPA6130A2 Headphone Playback Volume' 38"
        cset "name='Speaker Function' Off"
    ]

    DisableSequence [
        cdev "hw:${CardId}"
        cset "name='Jack Function' Off"
        cset "name='HP Playback Switch' off"
        cset "name='TPA6130A2 Headphone Playback Volume' 0"
        cset "name='Speaker Function' Off"
    ]
}

