# Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651

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

SectionDefaults [
	cdev "hw:bytcrrt5651"

	# media mixer settings
	#   compress
	cset "name='media0_in Gain 0 Switch' on"
	cset "name='media0_in Gain 0 Volume' 0"
	#   normal
	cset "name='media1_in Gain 0 Switch' on"
	cset "name='media1_in Gain 0 Volume' 0"
	#   swm loopback
	cset "name='media2_in Gain 0 Switch' off"
	cset "name='media2_in Gain 0 Volume' 0%"
	#   deep buffer
	cset "name='media3_in Gain 0 Switch' on"
	cset "name='media3_in Gain 0 Volume' 0"
	cset "name='media0_out mix 0 media0_in Switch' on"
	cset "name='media0_out mix 0 media1_in Switch' on"
	cset "name='media0_out mix 0 media2_in Switch' off"
	cset "name='media0_out mix 0 media3_in Switch' on"
	cset "name='media1_out mix 0 media0_in Switch' off"
	cset "name='media1_out mix 0 media1_in Switch' off"
	cset "name='media1_out mix 0 media2_in Switch' off"
	cset "name='media1_out mix 0 media3_in Switch' off"
	cset "name='pcm0_in Gain 0 Switch' on"
	cset "name='pcm0_in Gain 0 Volume' 0"
	cset "name='pcm1_in Gain 0 Switch' off"
	cset "name='pcm1_in Gain 0 Volume' 0%"

	# codec0_out settings
	cset "name='codec_out0 mix 0 codec_in0 Switch' off"
	cset "name='codec_out0 mix 0 codec_in1 Switch' off"
	cset "name='codec_out0 mix 0 media_loop1_in Switch' off"
	cset "name='codec_out0 mix 0 media_loop2_in Switch' off"
	cset "name='codec_out0 mix 0 pcm0_in Switch' on"
	cset "name='codec_out0 mix 0 pcm1_in Switch' off"
	cset "name='codec_out0 mix 0 sprot_loop_in Switch' off"
	cset "name='codec_out0 Gain 0 Switch' on"
	cset "name='codec_out0 Gain 0 Volume' 0"

	# input settings
	# pcm1_out settings
	cset "name='codec_in0 Gain 0 Switch' on"
	cset "name='codec_in0 Gain 0 Volume' 0"
	cset "name='pcm1_out mix 0 codec_in0 Switch' on"
	cset "name='pcm1_out mix 0 codec_in1 Switch' off"
	cset "name='pcm1_out mix 0 media_loop1_in Switch' off"
	cset "name='pcm1_out mix 0 media_loop2_in Switch' off"
	cset "name='pcm1_out mix 0 pcm0_in Switch' off"
	cset "name='pcm1_out mix 0 pcm1_in Switch' off"
	cset "name='pcm1_out mix 0 sprot_loop_in Switch' off"
	cset "name='pcm1_out Gain 0 Switch' on"
	cset "name='pcm1_out Gain 0 Volume' 0"

	# disable codec_out1
	cset "name='codec_out1 mix 0 codec_in0 Switch' off"
	cset "name='codec_out1 mix 0 codec_in1 Switch' off"
	cset "name='codec_out1 mix 0 media_loop1_in Switch' off"
	cset "name='codec_out1 mix 0 media_loop2_in Switch' off"
	cset "name='codec_out1 mix 0 pcm0_in Switch' off"
	cset "name='codec_out1 mix 0 pcm1_in Switch' off"
	cset "name='codec_out1 mix 0 sprot_loop_in Switch' off"
	cset "name='codec_out1 Gain 0 Switch' off"
	cset "name='codec_out1 Gain 0 Volume' 0%"

	# disable codec_in1
	cset "name='codec_in1 Gain 0 Switch' off"
	cset "name='codec_in1 Gain 0 Volume' 0%"

	# disable all loops
	cset "name='media_loop1_out mix 0 codec_in0 Switch' off"
	cset "name='media_loop1_out mix 0 codec_in1 Switch' off"
	cset "name='media_loop1_out mix 0 media_loop1_in Switch' off"
	cset "name='media_loop1_out mix 0 media_loop2_in Switch' off"
	cset "name='media_loop1_out mix 0 pcm0_in Switch' off"
	cset "name='media_loop1_out mix 0 pcm1_in Switch' off"
	cset "name='media_loop1_out mix 0 sprot_loop_in Switch' off"
	cset "name='media_loop2_out mix 0 codec_in0 Switch' off"
	cset "name='media_loop2_out mix 0 codec_in1 Switch' off"
	cset "name='media_loop2_out mix 0 media_loop1_in Switch' off"
	cset "name='media_loop2_out mix 0 media_loop2_in Switch' off"
	cset "name='media_loop2_out mix 0 pcm0_in Switch' off"
	cset "name='media_loop2_out mix 0 pcm1_in Switch' off"
	cset "name='media_loop2_out mix 0 sprot_loop_in Switch' off"
	cset "name='sprot_loop_out mix 0 codec_in0 Switch' off"
	cset "name='sprot_loop_out mix 0 codec_in1 Switch' off"
	cset "name='sprot_loop_out mix 0 media_loop1_in Switch' off"
	cset "name='sprot_loop_out mix 0 media_loop2_in Switch' off"
	cset "name='sprot_loop_out mix 0 pcm0_in Switch' off"
	cset "name='sprot_loop_out mix 0 pcm1_in Switch' off"
	cset "name='sprot_loop_out mix 0 sprot_loop_in Switch' off"

	# default state
	cset "name='ADC Capture Volume' 126"
	cset "name='HP Playback Volume' 0"
	cset "name='HPO L Playback Switch' off"
	cset "name='HPO MIX DAC1 Switch' on"
	cset "name='HPO MIX HPVOL Switch' on"
	cset "name='HPO R Playback Switch' off"
	cset "name='HPOVOL L Switch' on"
	cset "name='HPOVOL R Switch' on"
	cset "name='IF1 ASRC Switch' on"
	cset "name='IN Capture Volume' 27"
	cset "name='IN2 Boost' 1"
	cset "name='IN1 Boost' 1"
	cset "name='LOUT L Playback Switch' on"
	cset "name='LOUT MIX DAC L1 Switch' on"
	cset "name='LOUT MIX DAC R1 Switch' on"
	cset "name='LOUT R Playback Switch' on"
	cset "name='OUT Playback Volume' 33"
	cset "name='Stereo DAC MIXL DAC L1 Switch' on"
	cset "name='Stereo DAC MIXR DAC R1 Switch' on"
	cset "name='Stereo1 ADC MIXR ADC1 Switch' on"
	cset "name='Stereo1 ADC MIXR ADC2 Switch' on"
	cset "name='Stereo2 ADC MIXL ADC1 Switch' on"
	cset "name='Stereo2 ADC MIXL ADC2 Switch' on"
	cset "name='Stereo2 ADC MIXR ADC1 Switch' on"
	cset "name='Stereo2 ADC MIXR ADC2 Switch' on"
	cset "name='Headphone Switch' off"
	cset "name='Speaker Switch' off"

	# input
	cset "name='Stereo1 ADC L1 Mux' ADC"
	cset "name='Stereo1 ADC R1 Mux' ADC"
	cset "name='Stereo1 ADC MIXL ADC1 Switch' on"
	cset "name='Stereo1 ADC MIXR ADC1 Switch' on"
	cset "name='RECMIXL BST1 Switch' off"
	cset "name='RECMIXR BST1 Switch' off"
	cset "name='RECMIXL BST3 Switch' off"
	cset "name='RECMIXR BST3 Switch' off"
	cset "name='RECMIXL BST2 Switch' off"
	cset "name='RECMIXR BST2 Switch' off"
]
