diff --git a/ucm2/NXP/iMX8/Librem_5/HiFi.conf b/ucm2/NXP/iMX8/Librem_5/HiFi.conf index 55eabe32..449eac9c 100644 --- a/ucm2/NXP/iMX8/Librem_5/HiFi.conf +++ b/ucm2/NXP/iMX8/Librem_5/HiFi.conf @@ -1,12 +1,38 @@ SectionVerb { EnableSequence [ disdevall "" + cset "name='Speaker Mixer Switch' off,off" + cset "name='Headphone Mixer Switch' off,off" + cset "name='DAC Monomix Switch' off" + cset "name='ADC Monomix Switch' off" + cset "name='DAC L/R Swap Switch' off" + cset "name='ADC L/R Swap Switch' off" + cset "name='INPGAL IN1L Switch' off" + cset "name='INPGAL IN2L Switch' off" + cset "name='INPGAL IN3L Switch' off" + cset "name='INPGAL IN4L Switch' off" + cset "name='INPGAR IN1R Switch' off" + cset "name='INPGAR IN2R Switch' off" + cset "name='INPGAR IN3R Switch' off" + cset "name='INPGAR IN4R Switch' off" + cset "name='MIXINL IN2L Switch' off" + cset "name='MIXINL IN3L Switch' off" + cset "name='MIXINL PGA Switch' off" + cset "name='MIXINR IN2R Switch' off" + cset "name='MIXINR IN3R Switch' off" + cset "name='MIXINR PGA Switch' off" + cset "name='Input Mixer Switch' off,off" + cset "name='SPKOUTL PGA' Mixer" + cset "name='SPKOUTR PGA' Mixer" + cset "name='HPOUTL PGA' Mixer" + cset "name='HPOUTR PGA' Mixer" ] - Value.TQ "HiFi" + DisableSequence [ + ] } -SectionDevice."Handset" { +SectionDevice."Handset1" { Comment "Handset" ConflictingDevice [ @@ -15,24 +41,17 @@ SectionDevice."Handset" { ] EnableSequence [ - cset "name='Speaker Switch' off,on" - cset "name='DAC L/R Swap Switch' on" cset "name='DAC Monomix Switch' on" cset "name='SPKOUTR PGA' DAC" - cset "name='Speaker Boost Volume' 2" ] DisableSequence [ - cset "name='Speaker Switch' off,off" - cset "name='DAC L/R Swap Switch' off" - cset "name='DAC Monomix Switch' off" cset "name='SPKOUTR PGA' Mixer" + cset "name='DAC Monomix Switch' off" ] Value { PlaybackPriority "100" - PlaybackVolume "name='Speaker Volume'" - PlaybackSwitch "name='Speaker Switch'" PlaybackMixerElem "Speaker" PlaybackPCM "hw:${CardId}" } @@ -42,27 +61,30 @@ SectionDevice."Speaker" { Comment "Speaker" ConflictingDevice [ - "Handset" + "Handset1" "Headphones" ] EnableSequence [ - cset "name='Speaker Switch' on,off" - cset "name='DAC Monomix Switch' on" - cset "name='SPKOUTL PGA' DAC" - cset "name='Speaker Boost Volume' 6" + cset "name='SPKOUTL Mixer DACL Switch' on" + cset "name='SPKOUTL Mixer DACR Switch' on" + cset "name='SPKOUTR Mixer DACL Switch' on" + cset "name='SPKOUTR Mixer DACR Switch' on" + cset "name='HD Bass Switch' on" + cset "name='Speaker Mixer Switch' on,on" ] DisableSequence [ - cset "name='Speaker Switch' off,off" - cset "name='DAC Monomix Switch' off" - cset "name='SPKOUTL PGA' Mixer" + cset "name='Speaker Mixer Switch' off,off" + cset "name='SPKOUTL Mixer DACL Switch' off" + cset "name='SPKOUTL Mixer DACR Switch' off" + cset "name='SPKOUTR Mixer DACL Switch' off" + cset "name='SPKOUTR Mixer DACR Switch' off" + cset "name='HD Bass Switch' off" ] Value { PlaybackPriority "500" - PlaybackVolume "name='Speaker Volume'" - PlaybackSwitch "name='Speaker Switch'" PlaybackMixerElem "Speaker" PlaybackPCM "hw:${CardId}" } @@ -72,36 +94,58 @@ SectionDevice."Headphones" { Comment "Headphones" ConflictingDevice [ - "Handset" + "Handset1" "Speaker" ] EnableSequence [ - cset "name='Headphone Switch' on,on" - cset "name='HPOUTL PGA' 0 unmute" - cset "name='HPOUTR PGA' 0 unmute" + cset "name='HPOUTL PGA' DAC" + cset "name='HPOUTR PGA' DAC" ] DisableSequence [ - cset "name='Headphone Switch' off off" - cset "name='HPOUTL PGA' 0 mute" - cset "name='HPOUTR PGA' 0 mute" + cset "name='HPOUTL PGA' Mixer" + cset "name='HPOUTR PGA' Mixer" ] Value { PlaybackPriority "1000" - PlaybackVolume "name='Headphone Volume'" - PlaybackSwitch "name='Headphone Switch'" PlaybackMixerElem "Headphone" PlaybackPCM "hw:${CardId}" JackControl "Headphones Jack" } } +SectionDevice."Handset2" { + Comment "Handset Microphone" + + ConflictingDevice [ + "Mic" + "Headset" + ] + + EnableSequence [ + cset "name='3D Switch' on" + cset "name='3D Coefficients' 0x00,0x00,0xf8,0x00,0x00,0x00,0x07,0xc0" # duplicates left channel + cset "name='Input Mode' Digital" + ] + + DisableSequence [ + cset "name='3D Switch' off" + ] + + Value { + CapturePriority "500" + CaptureMixerElem "Digital" + CapturePCM "hw:${CardId}" + } +} + SectionDevice."Mic" { - Comment "Internal Microphone" + Comment "Stereo Microphones" ConflictingDevice [ + "Handset2" "Headset" ] @@ -115,8 +159,7 @@ SectionDevice."Mic" { ] Value { - CapturePriority "500" - CaptureVolume "name='Digital Capture Volume'" + CapturePriority "100" CaptureMixerElem "Digital" CapturePCM "hw:${CardId}" } @@ -127,25 +170,29 @@ SectionDevice."Headset" { ConflictingDevice [ "Mic" + "Handset2" ] EnableSequence [ + cset "name='MIXINR IN3R Switch' on" + cset "name='MIXINL IN3L Switch' on" # forces ADCL on, so 3D can work + cset "name='3D Switch' on" + cset "name='3D Coefficients' 0x00,0x00,0x07,0xc0,0x00,0x00,0xf8,0x00" # duplicates right channel cset "name='Input Mode' Analog" - cset "name='MIXINR PGA Switch' on,on" - cset "name='Capture Switch' on,on" + cset "name='Input Mixer Switch' off,on" ] DisableSequence [ - cset "name='Capture Switch' off,off" - cset "name='MIXINR PGA Switch' off,off" - cset "name='Input Mode' Digital" + cset "name='Input Mixer Switch' off,off" + cset "name='MIXINL IN3L Switch' off" + cset "name='MIXINR IN3R Switch' off" + cset "name='3D Switch' off" ] Value { - CapturePriority "100" - CaptureVolume "name='Capture Volume'" - CaptureMixerElem "Capture" + CapturePriority "1000" + CaptureMixerElem "Digital" CapturePCM "hw:${CardId}" - JackControl "Headphones Jack" + JackControl "Headset Mic Jack" } } diff --git a/ucm2/NXP/iMX8/Librem_5/Librem 5.conf b/ucm2/NXP/iMX8/Librem_5/Librem 5.conf index 4d7dbd65..eb60100b 100644 --- a/ucm2/NXP/iMX8/Librem_5/Librem 5.conf +++ b/ucm2/NXP/iMX8/Librem_5/Librem 5.conf @@ -1,25 +1,40 @@ -Syntax 2 +Syntax 3 + +Comment "Librem 5 Built-in Audio" + +BootSequence [ + cset "name='Digital Playback Volume' 96,96" # 0dB + cset "name='Digital Capture Volume' 96,96" # 0dB + cset "name='Speaker Volume' 121,121" # 0dB + cset "name='Speaker Boost Volume' 2" # 3dB + cset "name='Headphone Volume' 121,121" # 0dB + cset "name='Headphone Aux Volume' 1" # -6dB + cset "name='Capture Volume' 31,31" # 0dB + cset "name='MIXINL PGA Volume' 0" # 0dB + cset "name='SPKOUTL Mixer DACL Volume' 1" # -6dB + cset "name='SPKOUTL Mixer DACR Volume' 1" # -6dB + cset "name='SPKOUTR Mixer DACL Volume' 1" # -6dB + cset "name='SPKOUTR Mixer DACR Volume' 1" # -6dB + cset "name='Speaker ZC Switch' on" + cset "name='Headphone ZC Switch' on" + cset "name='Capture ZC Switch' on" + cset "name='Capture HPF Switch' on" + cset "name='Capture HPF Mode' Hi-fi" + cset "name='DAC High Performance Switch' on" + cset "name='ADC High Performance Switch' on" + cset "name='HPF1 Switch' on" + cset "name='HPF2 Switch' on" + cset "name='DRC Switch' on" + # DRC1: noise gate, quick-release, anti-clip, ADC path + # DRC2: attack: 1.45ms, decay: 743ms, mingain: -18dB, maxgain: 18dB + # DRC3: NG mingain: -36dB, QR threshold: 12dB, QR decay: 0.725ms, NG slope: 1 + # comp slope upper: 1/16, comp slope lower: 1/8 + # DRC4: knee input level: -3dB, knee output level: -8.25dB + # DRC5: NG knee2 input level: -36dB, NG knee2 output level: -30dB + cset "name='DRC Coefficients' 0x00,0x8d,0x09,0x29,0x00,0x23,0x00,0x8b,0x00,0x00" +] SectionUseCase."HiFi" { File "HiFi.conf" Comment "Default" } - -BootSequence [ - cset "name='Digital Playback Volume' 100,100" - cset "name='MIXINL IN2L Switch' off" - cset "name='MIXINL IN3L Switch' off" - cset "name='MIXINR IN2R Switch' off" - cset "name='MIXINR IN3R Switch' off" - cset "name='INPGAR IN1R Switch' off" - cset "name='INPGAR IN2R Switch' off" - cset "name='INPGAR IN3R Switch' on" - cset "name='INPGAR IN4R Switch' off" - cset "name='INPGAL IN1L Switch' off" - cset "name='INPGAL IN2L Switch' off" - cset "name='INPGAL IN3L Switch' off" - cset "name='INPGAL IN4L Switch' off" - cset "name='Input Mixer Switch' off,on" - cset "name='SPKOUTL PGA' Mixer" - cset "name='SPKOUTR PGA' Mixer" -]