Android-x86
Fork
捐款

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-alsa-ucm-conf: 提交

external/alsa-ucm-conf


Commit MetaInfo

修訂4884ef82c2ea27942a51411d0606f5f0866dcd2e (tree)
時間2021-05-27 17:14:01
作者Jaroslav Kysela <perex@pere...>
CommiterJaroslav Kysela

Log Message

rt5640 / bytcr-rt5640: cleanups

- merge HaveAif1 and HaveAif2 to HaveAif with values 1 and 2
- HaveSpeaker identifies stereo and mono (values 2 and 1)
- HaveInternalMic identifies internal mic input (dmic, in1, in3)
- rewrite (unify) bytcr-rt5640 components detection

BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/92
Signed-off-by: Jaroslav Kysela <perex@perex.cz>

Change Summary

差異

--- a/ucm2/Tegra/rt5640/ASUS Google Nexus 7 ALC5642.conf
+++ b/ucm2/Tegra/rt5640/ASUS Google Nexus 7 ALC5642.conf
@@ -1,10 +1,9 @@
11 # Use case Configuration for ASUS Google Nexus 7 (2012)
22
3-Define.HaveAif1 "yes"
4-Define.HaveAif2 ""
5-Define.HaveSpeaker "yes"
3+Define.HaveAif "1"
4+Define.HaveSpeaker "2"
65 Define.HaveHeadsetMic ""
7-Define.HaveInternalMic "yes"
6+Define.HaveInternalMic "dmic1"
87
98 Include.hp.File "/codecs/rt5640/HeadPhones.conf"
109 Include.mspk.File "/codecs/rt5640/Speaker.conf"
--- a/ucm2/bytcr-rt5640/HiFi-Components.conf
+++ b/ucm2/bytcr-rt5640/HiFi-Components.conf
@@ -1,27 +1,10 @@
1-Define.HaveSpeaker ""
2-Define.HaveHeadsetMic ""
3-Define.HaveInternalMic ""
4-
51 If.spk {
62 Condition {
73 Type String
84 Haystack "${CardComponents}"
95 Needle "cfg-spk:2"
106 }
11- True {
12- Include.spk.File "/codecs/rt5640/Speaker.conf"
13- Define.HaveSpeaker "yes"
14-
15- SectionDevice."Speaker" {
16- EnableSequence [
17- cset "name='Speaker Switch' on"
18- ]
19-
20- DisableSequence [
21- cset "name='Speaker Switch' off"
22- ]
23- }
24- }
7+ True.Define.HaveSpeaker "2"
258 }
269
2710 If.mono {
@@ -30,35 +13,7 @@ If.mono {
3013 Haystack "${CardComponents}"
3114 Needle "cfg-spk:1"
3215 }
33- True {
34- Include.mspk.File "/codecs/rt5640/MonoSpeaker.conf"
35- Define.HaveSpeaker "yes"
36-
37- SectionDevice."Speaker" {
38- EnableSequence [
39- cset "name='Speaker Switch' on"
40- ]
41-
42- DisableSequence [
43- cset "name='Speaker Switch' off"
44- ]
45- }
46- }
47-}
48-
49-If.hp {
50- Condition { Type String Empty "" }
51- True.Include.hs.File "/codecs/rt5640/HeadPhones.conf"
52-
53- SectionDevice."Headphones" {
54- EnableSequence [
55- cset "name='Headphone Switch' on"
56- ]
57-
58- DisableSequence [
59- cset "name='Headphone Switch' off"
60- ]
61- }
16+ True.Define.HaveSpeaker "1"
6217 }
6318
6419 If.dmic1 {
@@ -67,20 +22,7 @@ If.dmic1 {
6722 Haystack "${CardComponents}"
6823 Needle "cfg-mic:dmic1"
6924 }
70- True {
71- Include.dmic.File "/codecs/rt5640/DigitalMics.conf"
72- Define.HaveInternalMic "yes"
73-
74- SectionDevice."Mic" {
75- EnableSequence [
76- cset "name='Internal Mic Switch' on"
77- ]
78-
79- DisableSequence [
80- cset "name='Internal Mic Switch' off"
81- ]
82- }
83- }
25+ True.Define.HaveInternalMic "dmic1"
8426 }
8527
8628 If.in1 {
@@ -89,20 +31,7 @@ If.in1 {
8931 Haystack "${CardComponents}"
9032 Needle "cfg-mic:in1"
9133 }
92- True {
93- Include.mic1.File "/codecs/rt5640/IN1-InternalMic.conf"
94- Define.HaveInternalMic "yes"
95-
96- SectionDevice."Mic" {
97- EnableSequence [
98- cset "name='Internal Mic Switch' on"
99- ]
100-
101- DisableSequence [
102- cset "name='Internal Mic Switch' off"
103- ]
104- }
105- }
34+ True.Define.HaveInternalMic "in1"
10635 }
10736
10837 If.in3 {
@@ -111,34 +40,5 @@ If.in3 {
11140 Haystack "${CardComponents}"
11241 Needle "cfg-mic:in3"
11342 }
114- True {
115- Include.mic3.File "/codecs/rt5640/IN3-InternalMic.conf"
116- Define.HaveInternalMic "yes"
117-
118- SectionDevice."Mic" {
119- EnableSequence [
120- cset "name='Internal Mic Switch' on"
121- ]
122-
123- DisableSequence [
124- cset "name='Internal Mic Switch' off"
125- ]
126- }
127- }
128-}
129-
130-If.hsmic {
131- Condition { Type String Empty "" }
132- True.Include.hsmic.File "/codecs/rt5640/HeadsetMic.conf"
133- Define.HaveHeadsetMic "yes"
134-
135- SectionDevice."Headset" {
136- EnableSequence [
137- cset "name='Headset Mic Switch' on"
138- ]
139-
140- DisableSequence [
141- cset "name='Headset Mic Switch' off"
142- ]
143- }
43+ True.Define.HaveInternalMic "in3"
14444 }
--- a/ucm2/bytcr-rt5640/HiFi-LongName.conf
+++ b/ucm2/bytcr-rt5640/HiFi-LongName.conf
@@ -1,27 +1,10 @@
1-Define.HaveSpeaker ""
2-Define.HaveHeadsetMic ""
3-Define.HaveInternalMic ""
4-
51 If.spk {
62 Condition {
73 Type String
84 Haystack "${CardLongName}"
95 Needle "-stereo-spk"
106 }
11- True {
12- Include.spk.File "/codecs/rt5640/Speaker.conf"
13- Define.HaveSpeaker "yes"
14-
15- SectionDevice."Speaker" {
16- EnableSequence [
17- cset "name='Speaker Switch' on"
18- ]
19-
20- DisableSequence [
21- cset "name='Speaker Switch' off"
22- ]
23- }
24- }
7+ True.Define.HaveSpeaker "2"
258 }
269
2710 If.mono {
@@ -30,35 +13,7 @@ If.mono {
3013 Haystack "${CardLongName}"
3114 Needle "-mono-spk"
3215 }
33- True {
34- Include.mspk.File "/codecs/rt5640/MonoSpeaker.conf"
35- Define.HaveSpeaker "yes"
36-
37- SectionDevice."Speaker" {
38- EnableSequence [
39- cset "name='Speaker Switch' on"
40- ]
41-
42- DisableSequence [
43- cset "name='Speaker Switch' off"
44- ]
45- }
46- }
47-}
48-
49-If.hp {
50- Condition { Type String Empty "" }
51- True.Include.hs.File "/codecs/rt5640/HeadPhones.conf"
52-
53- SectionDevice."Headphones" {
54- EnableSequence [
55- cset "name='Headphone Switch' on"
56- ]
57-
58- DisableSequence [
59- cset "name='Headphone Switch' off"
60- ]
61- }
16+ True.Define.HaveSpeaker "1"
6217 }
6318
6419 If.dmic1 {
@@ -67,20 +22,7 @@ If.dmic1 {
6722 Haystack "${CardLongName}"
6823 Needle "-dmic1-mic"
6924 }
70- True {
71- Include.dmic.File "/codecs/rt5640/DigitalMics.conf"
72- Define.HaveInternalMic "yes"
73-
74- SectionDevice."Mic" {
75- EnableSequence [
76- cset "name='Internal Mic Switch' on"
77- ]
78-
79- DisableSequence [
80- cset "name='Internal Mic Switch' off"
81- ]
82- }
83- }
25+ True.Define.HaveInternalMic "dmic1"
8426 }
8527
8628 If.in1 {
@@ -89,20 +31,7 @@ If.in1 {
8931 Haystack "${CardLongName}"
9032 Needle "-in1-mic"
9133 }
92- True {
93- Include.mic1.File "/codecs/rt5640/IN1-InternalMic.conf"
94- Define.HaveInternalMic "yes"
95-
96- SectionDevice."Mic" {
97- EnableSequence [
98- cset "name='Internal Mic Switch' on"
99- ]
100-
101- DisableSequence [
102- cset "name='Internal Mic Switch' off"
103- ]
104- }
105- }
34+ True.Define.HaveInternalMic "in1"
10635 }
10736
10837 If.in3 {
@@ -111,34 +40,5 @@ If.in3 {
11140 Haystack "${CardLongName}"
11241 Needle "-in3-mic"
11342 }
114- True {
115- Include.mic3.File "/codecs/rt5640/IN3-InternalMic.conf"
116- Define.HaveInternalMic "yes"
117-
118- SectionDevice."Mic" {
119- EnableSequence [
120- cset "name='Internal Mic Switch' on"
121- ]
122-
123- DisableSequence [
124- cset "name='Internal Mic Switch' off"
125- ]
126- }
127- }
128-}
129-
130-If.hsmic {
131- Condition { Type String Empty "" }
132- True.Include.hsmic.File "/codecs/rt5640/HeadsetMic.conf"
133- Define.HaveHeadsetMic "yes"
134-
135- SectionDevice."Headset" {
136- EnableSequence [
137- cset "name='Headset Mic Switch' on"
138- ]
139-
140- DisableSequence [
141- cset "name='Headset Mic Switch' off"
142- ]
143- }
43+ True.Define.HaveInternalMic "in3"
14444 }
--- a/ucm2/bytcr-rt5640/HiFi.conf
+++ b/ucm2/bytcr-rt5640/HiFi.conf
@@ -1,7 +1,9 @@
11 # Use case Configuration for bytcr-rt5640
22
3-Define.HaveAif1 ""
4-Define.HaveAif2 ""
3+Define.HaveAif ""
4+Define.HaveSpeaker ""
5+Define.HaveInternalMic ""
6+Define.HaveHeadsetMic "yes"
57
68 If.DefineAif1 {
79 Condition {
@@ -9,7 +11,7 @@ If.DefineAif1 {
911 Haystack "${CardComponents}"
1012 Needle "aif:1"
1113 }
12- True.Define.HaveAif1 "yes"
14+ True.Define.HaveAif "1"
1315 }
1416
1517 If.DefineAif2 {
@@ -18,7 +20,17 @@ If.DefineAif2 {
1820 Haystack "${CardComponents}"
1921 Needle "aif:2"
2022 }
21- True.Define.HaveAif2 "yes"
23+ True.Define.HaveAif "2"
24+}
25+
26+If.0 {
27+ Condition {
28+ Type String
29+ Haystack "${CardComponents}"
30+ Needle "cfg-spk:"
31+ }
32+ True.Include.comp.File "/bytcr-rt5640/HiFi-Components.conf"
33+ False.Include.long.File "/bytcr-rt5640/HiFi-LongName.conf"
2234 }
2335
2436 SectionVerb {
@@ -44,12 +56,137 @@ SectionVerb {
4456 }
4557 }
4658
47-If.0 {
59+If.spk {
4860 Condition {
4961 Type String
50- Haystack "${CardComponents}"
51- Needle "cfg-spk:"
62+ Haystack "${var:HaveSpeaker}"
63+ Needle "2"
64+ }
65+ True {
66+ Include.spk.File "/codecs/rt5640/Speaker.conf"
67+
68+ SectionDevice."Speaker" {
69+ EnableSequence [
70+ cset "name='Speaker Switch' on"
71+ ]
72+
73+ DisableSequence [
74+ cset "name='Speaker Switch' off"
75+ ]
76+ }
77+ }
78+}
79+
80+If.mono {
81+ Condition {
82+ Type String
83+ Haystack "${var:HaveSpeaker}"
84+ Needle "1"
85+ }
86+ True {
87+ Include.mspk.File "/codecs/rt5640/MonoSpeaker.conf"
88+
89+ SectionDevice."Speaker" {
90+ EnableSequence [
91+ cset "name='Speaker Switch' on"
92+ ]
93+
94+ DisableSequence [
95+ cset "name='Speaker Switch' off"
96+ ]
97+ }
98+ }
99+}
100+
101+If.hp {
102+ Condition { Type String Empty "" }
103+ True.Include.hs.File "/codecs/rt5640/HeadPhones.conf"
104+
105+ SectionDevice."Headphones" {
106+ EnableSequence [
107+ cset "name='Headphone Switch' on"
108+ ]
109+
110+ DisableSequence [
111+ cset "name='Headphone Switch' off"
112+ ]
113+ }
114+}
115+
116+If.dmic1 {
117+ Condition {
118+ Type String
119+ Haystack "${var:HaveInternalMic}"
120+ Needle "dmic1"
121+ }
122+ True {
123+ Include.dmic.File "/codecs/rt5640/DigitalMics.conf"
124+
125+ SectionDevice."Mic" {
126+ EnableSequence [
127+ cset "name='Internal Mic Switch' on"
128+ ]
129+
130+ DisableSequence [
131+ cset "name='Internal Mic Switch' off"
132+ ]
133+ }
134+ }
135+}
136+
137+If.in1 {
138+ Condition {
139+ Type String
140+ Haystack "${var:HaveInternalMic}"
141+ Needle "in1"
142+ }
143+ True {
144+ Include.mic1.File "/codecs/rt5640/IN1-InternalMic.conf"
145+
146+ SectionDevice."Mic" {
147+ EnableSequence [
148+ cset "name='Internal Mic Switch' on"
149+ ]
150+
151+ DisableSequence [
152+ cset "name='Internal Mic Switch' off"
153+ ]
154+ }
155+ }
156+}
157+
158+If.in3 {
159+ Condition {
160+ Type String
161+ Haystack "${var:HaveInternalMic}"
162+ Needle "in3"
163+ }
164+ True {
165+ Include.mic3.File "/codecs/rt5640/IN3-InternalMic.conf"
166+
167+ SectionDevice."Mic" {
168+ EnableSequence [
169+ cset "name='Internal Mic Switch' on"
170+ ]
171+
172+ DisableSequence [
173+ cset "name='Internal Mic Switch' off"
174+ ]
175+ }
176+ }
177+}
178+
179+If.hsmic {
180+ Condition { Type String Empty "" }
181+ True.Include.hsmic.File "/codecs/rt5640/HeadsetMic.conf"
182+
183+ SectionDevice."Headset" {
184+ EnableSequence [
185+ cset "name='Headset Mic Switch' on"
186+ ]
187+
188+ DisableSequence [
189+ cset "name='Headset Mic Switch' off"
190+ ]
52191 }
53- True.Include.comp.File "/bytcr-rt5640/HiFi-Components.conf"
54- False.Include.long.File "/bytcr-rt5640/HiFi-LongName.conf"
55192 }
--- a/ucm2/codecs/rt5640/DigitalMics.conf
+++ b/ucm2/codecs/rt5640/DigitalMics.conf
@@ -33,16 +33,24 @@ SectionDevice."Mic" {
3333 CapturePriority 100
3434 CapturePCM "hw:${CardId}"
3535 If.DmicAif1 {
36- Condition { Type String Empty "${var:HaveAif1}" }
37- False {
36+ Condition {
37+ Type String
38+ String1 "${var:HaveAif}"
39+ String2 "1"
40+ }
41+ True {
3842 CaptureMixerElem "ADC"
3943 CaptureVolume "ADC Capture Volume"
4044 CaptureSwitch "ADC Capture Switch"
4145 }
4246 }
4347 If.DmicAif2 {
44- Condition { Type String Empty "${var:HaveAif2}" }
45- False {
48+ Condition {
49+ Type String
50+ String1 "${var:HaveAif}"
51+ String2 "2"
52+ }
53+ True {
4654 CaptureMixerElem "Mono ADC"
4755 CaptureVolume "Mono ADC Capture Volume"
4856 CaptureSwitch "Mono ADC Capture Switch"
--- a/ucm2/codecs/rt5640/HeadPhones.conf
+++ b/ucm2/codecs/rt5640/HeadPhones.conf
@@ -34,16 +34,20 @@ SectionDevice."Headphones" {
3434 PlaybackMixerElem "HP"
3535 PlaybackVolume "HP Playback Volume"
3636 If.HpAif1 {
37- Condition { Type String Empty "${var:HaveAif1}" }
38- False {
39- PlaybackMasterElem "DAC1"
37+ Condition {
38+ Type String
39+ String1 "${var:HaveAif}"
40+ String2 "1"
4041 }
42+ True.PlaybackMasterElem "DAC1"
4143 }
4244 If.HpAif2 {
43- Condition { Type String Empty "${var:HaveAif2}" }
44- False {
45- PlaybackMasterElem "DAC2"
45+ Condition {
46+ Type String
47+ String1 "${var:HaveAif}"
48+ String2 "2"
4649 }
50+ True.PlaybackMasterElem "DAC2"
4751 }
4852 }
4953 }
--- a/ucm2/codecs/rt5640/HeadsetMic.conf
+++ b/ucm2/codecs/rt5640/HeadsetMic.conf
@@ -40,16 +40,20 @@ SectionDevice."Headset" {
4040 CaptureMixerElem "IN2 Boost"
4141 CaptureVolume "IN2 Boost"
4242 If.HSmicAif1 {
43- Condition { Type String Empty "${var:HaveAif1}" }
44- False {
45- CaptureMasterElem "ADC"
43+ Condition {
44+ Type String
45+ String1 "${var:HaveAif}"
46+ String2 "1"
4647 }
48+ True.CaptureMasterElem "ADC"
4749 }
4850 If.HSmicAif2 {
49- Condition { Type String Empty "${var:HaveAif2}" }
50- False {
51- CaptureMasterElem "Mono ADC"
51+ Condition {
52+ Type String
53+ String1 "${var:HaveAif}"
54+ String2 "2"
5255 }
56+ True.CaptureMasterElem "Mono ADC"
5357 }
5458 }
5559 }
--- a/ucm2/codecs/rt5640/IN1-InternalMic.conf
+++ b/ucm2/codecs/rt5640/IN1-InternalMic.conf
@@ -39,16 +39,20 @@ SectionDevice."Mic" {
3939 CaptureMixerElem "IN1 Boost"
4040 CaptureVolume "IN1 Boost"
4141 If.In1Aif1 {
42- Condition { Type String Empty "${var:HaveAif1}" }
43- False {
44- CaptureMasterElem "ADC"
42+ Condition {
43+ Type String
44+ String1 "${var:HaveAif}"
45+ String2 "1"
4546 }
47+ True.CaptureMasterElem "ADC"
4648 }
4749 If.In1Aif2 {
48- Condition { Type String Empty "${var:HaveAif2}" }
49- False {
50- CaptureMasterElem "Mono ADC"
50+ Condition {
51+ Type String
52+ String1 "${var:HaveAif}"
53+ String2 "2"
5154 }
55+ True.CaptureMasterElem "Mono ADC"
5256 }
5357 }
5458 }
--- a/ucm2/codecs/rt5640/IN3-InternalMic.conf
+++ b/ucm2/codecs/rt5640/IN3-InternalMic.conf
@@ -39,16 +39,20 @@ SectionDevice."Mic" {
3939 CaptureMixerElem "IN3 Boost"
4040 CaptureVolume "IN3 Boost"
4141 If.In3Aif1 {
42- Condition { Type String Empty "${var:HaveAif1}" }
43- False {
44- CaptureMasterElem "ADC"
42+ Condition {
43+ Type String
44+ String1 "${var:HaveAif}"
45+ String2 "1"
4546 }
47+ True.CaptureMasterElem "ADC"
4648 }
4749 If.In3Aif2 {
48- Condition { Type String Empty "${var:HaveAif2}" }
49- False {
50- CaptureMasterElem "Mono ADC"
50+ Condition {
51+ Type String
52+ String1 "${var:HaveAif}"
53+ String2 "2"
5154 }
55+ True.CaptureMasterElem "Mono ADC"
5256 }
5357 }
5458 }
--- a/ucm2/codecs/rt5640/MonoSpeaker.conf
+++ b/ucm2/codecs/rt5640/MonoSpeaker.conf
@@ -28,16 +28,20 @@ SectionDevice."Speaker" {
2828 PlaybackMixerElem "Speaker"
2929 PlaybackVolume "Speaker Playback Volume"
3030 If.MonoSpkAif1 {
31- Condition { Type String Empty "${var:HaveAif1}" }
32- False {
33- PlaybackMasterElem "DAC1"
31+ Condition {
32+ Type String
33+ String1 "${var:HaveAif}"
34+ String2 "1"
3435 }
36+ True.PlaybackMasterElem "DAC1"
3537 }
3638 If.MonoSpkAif2 {
37- Condition { Type String Empty "${var:HaveAif2}" }
38- False {
39- PlaybackMasterElem "DAC2"
39+ Condition {
40+ Type String
41+ String1 "${var:HaveAif}"
42+ String2 "2"
4043 }
44+ True.PlaybackMasterElem "DAC2"
4145 }
4246 }
4347 }
--- a/ucm2/codecs/rt5640/Speaker.conf
+++ b/ucm2/codecs/rt5640/Speaker.conf
@@ -28,16 +28,20 @@ SectionDevice."Speaker" {
2828 PlaybackMixerElem "Speaker"
2929 PlaybackVolume "Speaker Playback Volume"
3030 If.SpkAif1 {
31- Condition { Type String Empty "${var:HaveAif1}" }
32- False {
33- PlaybackMasterElem "DAC1"
31+ Condition {
32+ Type String
33+ String1 "${var:HaveAif}"
34+ String2 "1"
3435 }
36+ True.PlaybackMasterElem "DAC1"
3537 }
3638 If.SpkAif2 {
37- Condition { Type String Empty "${var:HaveAif2}" }
38- False {
39- PlaybackMasterElem "DAC2"
39+ Condition {
40+ Type String
41+ String1 "${var:HaveAif}"
42+ String2 "2"
4043 }
44+ True.PlaybackMasterElem "DAC2"
4145 }
4246 }
4347 }
Show on old repository browser