Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sof-bytcht-da7213: initial import #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
185 changes: 185 additions & 0 deletions ucm/sof-bytcht-da7213/HiFi
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
# Use case Configuration for sofbytchtda7213
# alsaucm -c sof-bytcht-da7213 set _verb HiFi set _enadev Headphones
# alsaucm -c sof-bytcht-da7213 set _verb HiFi set _enadev MIC1
# alsaucm -c sof-bytcht-da7213 set _verb HiFi set _enadev MIC2
# alsaucm -c sof-bytcht-da7213 set _verb HiFi set _enadev AUX

SectionVerb {

EnableSequence [
cdev "hw:sofbytchtda7213"


# DA7213 default output routing

# Ensure stream only goes to DAI
cset "name='Mixout Left Mixin Left Switch' off"
cset "name='Mixout Right Mixin Right Switch' off"
cset "name='Mixout Left Aux Left Switch' off"
cset "name='Mixout Right Aux Right Switch' off"

]

DisableSequence [
]

# ALSA PCM
Value {
# ALSA PCM device for HiFi
PlaybackPCM "hw:sofbytchtda7213"
CapturePCM "hw:sofbytchtda7213"
}
}

SectionDevice."MIC1" {
Comment "MIC1 capture - headset"

ConflictingDevice [
"MIC2"
"AUX"
]

EnableSequence [
cdev "hw:sofbytchtda7213"

# cset "name='Mic 1 Amp Source MUX' Differential"
# cset "name='Mic 1 Amp Source MUX' MIC_N"

cset "name='Mic 1 Amp Source MUX' MIC_P"
cset "name='Mic 1 Volume' 6"
cset "name='Mixin PGA Volume' 47%"
cset "name='ADC Volume' 112"

cset "name='Mixin Left Mic 1 Switch' on"
cset "name='Mixin Right Mic 1 Switch' on"
cset "name='Mixin PGA Switch' on"
cset "name='Mic 1 Switch' on"
cset "name='ADC Switch' on"
cset "name='Headset Mic Switch' on"
]

DisableSequence [
cdev "hw:sofbytchtda7213"

cset "name='Headset Mic Switch' off"
cset "name='ADC Switch' off"
cset "name='Mic 1 Switch' off"
cset "name='Mixin PGA Switch' off"
cset "name='Mixin Left Mic 1 Switch' off"
cset "name='Mixin Right Mic 1 Switch' off"
]

Value {
CaptureChannels 2
}
}

SectionDevice."MIC2" {
Comment "MIC2 capture"

ConflictingDevice [
"MIC1"
"AUX"
]

EnableSequence [
cdev "hw:sofbytchtda7213"

# cset "name='Mic 2 Amp Source MUX' Differential"
# cset "name='Mic 2 Amp Source MUX' MIC_N"

cset "name='Mic 2 Amp Source MUX' MIC_P"
cset "name='Mic 2 Volume' 6"
cset "name='Mixin PGA Volume' 47%"
cset "name='ADC Volume' 112"

cset "name='Mixin Left Mic 2 Switch' on"
cset "name='Mixin Right Mic 2 Switch' on"
cset "name='Mixin PGA Switch' on"
cset "name='Mic 2 Switch' on"
cset "name='ADC Switch' on"
cset "name='Mic Switch' on"

]

DisableSequence [
cdev "hw:sofbytchtda7213"

cset "name='Mic Switch' off"
cset "name='ADC Switch' off"
cset "name='Mic 1 Switch' off"
cset "name='Mixin PGA Switch' off"
cset "name='Mixin Left Mic 1 Switch' off"
cset "name='Mixin Right Mic 1 Switch' off"
]

Value {
CaptureChannels 2
}
}

SectionDevice."AUX" {
Comment "AUX capture"

ConflictingDevice [
"MIC1"
"MIC2"
]

EnableSequence [
cdev "hw:sofbytchtda7213"

cset "name='Aux Volume' 78%"
cset "name='ADC Volume' 76%"
cset "name='Mixin PGA Volume' 47%"

cset "name='Mixin Left Aux Left Switch' on"
cset "name='Mixin Right Aux Right Switch' on"
cset "name='Mixin PGA Switch' on"
cset "name='ADC Switch' on"
cset "name='Aux Switch' on"
]

DisableSequence [
cdev "hw:sofbytchtda7213"

cset "name='Aux Switch' off"
cset "name='ADC Switch' off"
cset "name='Mixin PGA Switch' off"
cset "name='Mixin Left Aux Left Switch' off"
cset "name='Mixin Right Aux Right Switch' off"
]

Value {
CaptureChannels 2
}
}

SectionDevice."Headphones" {
Comment "Headphones playback"

EnableSequence [
cdev "hw:sofbytchtda7213"

cset "name='Headphone Volume' 50%"
cset "name='Mixout Left DAC Left Switch' on"
cset "name='Mixout Right DAC Right Switch' on"
cset "name='Headphone Switch' on"
cset "name='Headphone Jack Switch' on"

]

DisableSequence [
cdev "hw:sofbytchtda7213"

cset "name='Headphone Jack Switch' off"
cset "name='Headphone Switch' off"
cset "name='Mixout Left DAC Left Switch' off"
cset "name='Mixout Right DAC Right Switch' off"
]

Value {
PlaybackChannels "2"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need add something like:

PlaybackPCM "hw:sofbytchtda7213, num" 
JackControl "Headphone xxx" \\ for pulse audio to detect headphone

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RanderWang can you check if there is a working platform with this codec in Shanghai?

I don't know if the machine driver reports the jack so it may not be really important. this is mostly a test rig.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@plbossart I checked but didn’t find one. So we don't need to set JackControl now since we can't test it.

}
}

8 changes: 8 additions & 0 deletions ucm/sof-bytcht-da7213/sof-bytcht-da7213.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
SectionUseCase."HiFi" {
File "HiFi"
Comment "Play HiFi quality Music"
}

SectionDefaults [
cdev "hw:bytchtda7213"
]