alsa-project / alsa-ucm-conf

ALSA Use Case Manager configuration
BSD 3-Clause "New" or "Revised" License
70 stars 205 forks source link

es8336 HiFi.conf #244

Open junocomp opened 1 year ago

junocomp commented 1 year ago

I believe the current HiFi.conf for es8336 is incorrect and does not enable the require volumes for the speakers.

I have attached my conf file, this enables the speakers from startup, detects the HDMI audio and enables the internal microphone. I have tested this on 3 devices with Debian now and it seems to work. Can other people test it too please. If it works, it will be worth pushing it upstream.

Make sure you backup your /usr/share/alsa/ucm2/Intel/sof-essx8336/HiFi.conf and replace it with the configuration below. Restart your machine to take effect.

SectionVerb {
    EnableSequence [
        #disdevall ""
        # Disable all inputs / outputs
        #   (may be duplicated with disdevall)
        cset "name='Left Headphone Mixer Left DAC Switch' on"
        cset "name='Right Headphone Mixer Right DAC Switch' on"
    ]
}

SectionDevice."Mic" {
        Comment "Analog Microphone"

        EnableSequence [
            cset "name='Internal Mic Switch' on"
            cset "name='Headset Mic Switch' on"
        ]

        DisableSequence [

                ]

        Value {
            CapturePriority 100
            CapturePCM "hw:${CardId}"
            CaptureMixerElem "ADC PGA Gain"
            CaptureMasterElem "ADC"
        }
}

SectionDevice."Speaker" {
    Comment "Speakers"

    ConflictingDevice [
        "Headphones"
    ]

    EnableSequence [
        cset "name='Speaker Switch' on"
        cset "name='Differential Mux' lin1-rin1"
    ]

    DisableSequence [
        cset "name='Speaker Switch' off"
        cset "name='Differential Mux' lin2-rin2"
    ]
    Value {
        PlaybackPriority 100
        PlaybackPCM "hw:${CardId}"
        # The es8316 only has a HP-amp which is muxed to the speaker
        # or to the headpones output
        PlaybackMixerElem "Headphone Mixer"
        PlaybackMasterElem "DAC"
    }
}

SectionDevice."Headphones" {
    Comment "Headphones"

    ConflictingDevice [
        "Speaker"
    ]

    EnableSequence [
                cset "name='Headset Mic Switch' on"
                cset "name='Speaker Switch' off"
                cset "name='Differential Mux' lin2-rin2"
        ]

        DisableSequence [
        cset "name='Differential Mux' lin1-rin1"
    ]

    Value {
        PlaybackPriority 300
        PlaybackPCM "hw:${CardId}"
        PlaybackMixerElem "Headphone Mixer"
        PlaybackMasterElem "DAC"
        JackControl "Headphone Jack"
        JackHWMute "Speaker"
    }
}

Include.hdmi.File "/Intel/sof-essx8336/Hdmi.conf"
perexg commented 1 year ago

It would be better to create a PR (pull request) to see and comment changes. You can point to the raw file (like https://raw.githubusercontent.com/perexg/alsa-ucm-conf/issue/239/ucm2/HDA/DualCodecs/HiFi.conf) in your repo.

junocomp commented 1 year ago

@perexg I am not sure how to do a PR, should I push it to master?

junocomp commented 1 year ago

@perexg can you help me make a PR?

junocomp commented 1 year ago

created

https://github.com/alsa-project/alsa-ucm-conf/pull/246

joakim-tjernlund commented 1 year ago

Looking at https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/772 I wonder if not all EnableSequence/DisableSequence should match ?