From 6eced6b4b6dca9f62ea3d13a40c5991231df3c5c Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 18 Oct 2018 09:38:38 +0200 Subject: conf/ucm/Dell-WD15-Dock: Fix incorrect device names The device name string for Dell WD15 (and its variants) dock is set as "WD15Dock", while the actual device name to be used is "Dock". Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1112292 Fixes: 8ebb40c96970 ("conf/ucm: Add a UCM profile for Dell WD15 Dock USB-audio") Signed-off-by: Takashi Iwai --- src/conf/ucm/Dell-WD15-Dock/HiFi.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/conf/ucm/Dell-WD15-Dock/HiFi.conf b/src/conf/ucm/Dell-WD15-Dock/HiFi.conf index b07f3440..1b6bd212 100644 --- a/src/conf/ucm/Dell-WD15-Dock/HiFi.conf +++ b/src/conf/ucm/Dell-WD15-Dock/HiFi.conf @@ -3,7 +3,7 @@ SectionDevice."Headphone" { Value { PlaybackChannels "2" - PlaybackPCM "hw:WD15Dock,0" + PlaybackPCM "hw:Dock,0" } } @@ -12,7 +12,7 @@ SectionDevice."LineOut" { Value { PlaybackChannels "2" - PlaybackPCM "hw:WD15Dock,1" + PlaybackPCM "hw:Dock,1" } } @@ -21,6 +21,6 @@ SectionDevice."Mic" { Value { CaptureChannels "2" - CapturePCM "hw:WD15Dock,0" + CapturePCM "hw:Dock,0" } } -- cgit v1.2.3 From 6852f88e80e442ba5d7f2044cf0fbbe72d46fefa Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 23 Oct 2018 10:03:17 +0200 Subject: test/latecy: fix typo in tstamp compare Signed-off-by: Jaroslav Kysela --- test/latency.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/latency.c b/test/latency.c index f3590b3f..e926856b 100644 --- a/test/latency.c +++ b/test/latency.c @@ -673,7 +673,7 @@ int main(int argc, char *argv[]) printf("Capture:\n"); showstat(chandle, frames_in); showinmax(in_max); - if (p_tstamp.tv_sec == p_tstamp.tv_sec && + if (p_tstamp.tv_sec == c_tstamp.tv_sec && p_tstamp.tv_usec == c_tstamp.tv_usec) printf("Hardware sync\n"); snd_pcm_drop(chandle); -- cgit v1.2.3 From 82ae026f49e6e22f4775ae23e33324535025a5c6 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 23 Oct 2018 10:17:12 +0200 Subject: test/code: make it work again Signed-off-by: Jaroslav Kysela --- test/code.c | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/test/code.c b/test/code.c index e2032de5..3706243e 100644 --- a/test/code.c +++ b/test/code.c @@ -3,11 +3,7 @@ #include #include #include -#include - -#ifndef __builtin_expect -#include -#endif +#include #define rdtscll(val) \ __asm__ __volatile__("rdtsc" : "=A" (val)) @@ -72,21 +68,21 @@ static inline void atomic_add(volatile int *dst, int v) static double detect_cpu_clock() { - struct timeval tm_begin, tm_end; + struct timespec tm_begin, tm_end; unsigned long long tsc_begin, tsc_end; /* Warm cache */ - gettimeofday(&tm_begin, 0); + clock_gettime(CLOCK_MONOTONIC, &tm_begin); rdtscll(tsc_begin); - gettimeofday(&tm_begin, 0); + clock_gettime(CLOCK_MONOTONIC, &tm_begin); usleep(1000000); rdtscll(tsc_end); - gettimeofday(&tm_end, 0); + clock_gettime(CLOCK_MONOTONIC, &tm_end); - return (tsc_end - tsc_begin) / (tm_end.tv_sec - tm_begin.tv_sec + (tm_end.tv_usec - tm_begin.tv_usec) / 1e6); + return (tsc_end - tsc_begin) / (tm_end.tv_sec - tm_begin.tv_sec + (tm_end.tv_nsec - tm_begin.tv_nsec) / 1e9); } void mix_areas_srv(unsigned int size, @@ -146,11 +142,17 @@ void mix_areas0(unsigned int size, } } -#define MIX_AREAS1 mix_areas1 -#define MIX_AREAS1_MMX mix_areas1_mmx +#define MIX_AREAS_16 mix_areas1 +#define MIX_AREAS_16_MMX mix_areas1_mmx +#define MIX_AREAS_32 mix_areas1_32 +#define MIX_AREAS_24 mix_areas1_24 +#define MIX_AREAS_24_CMOV mix_areas1_24_cmov +#define XADD "addl" +#define XSUB "subl" #include "../src/pcm/pcm_dmix_i386.h" -#undef MIX_AREAS1 -#undef MIX_AREAS1_MMX +static void *ptr_mix_areas1_32 __attribute__((unused)) = &mix_areas1_32; +static void *ptr_mix_areas1_24 __attribute__((unused)) = &mix_areas1_24; +static void *ptr_mix_areas1_24_cmov __attribute__((unused)) = &mix_areas1_24_cmov; void mix_areas2(unsigned int size, volatile s16 *dst, const s16 *src, @@ -319,11 +321,11 @@ int main(int argc, char **argv) printf(" \r"); printf("Summary (the best times):\n"); - printf("mix_areas_srv : %lld %f%%\n", diffS, 100*2*44100.0*diffS/(size*n*cpu_clock)); - printf("mix_areas0 : %lld %f%%\n", diff0, 100*2*44100.0*diff0/(size*n*cpu_clock)); - printf("mix_areas1 : %lld %f%%\n", diff1, 100*2*44100.0*diff1/(size*n*cpu_clock)); - printf("mix_areas1_mmx: %lld %f%%\n", diff1_mmx, 100*2*44100.0*diff1_mmx/(size*n*cpu_clock)); - printf("mix_areas2 : %lld %f%%\n", diff2, 100*2*44100.0*diff2/(size*n*cpu_clock)); + printf("mix_areas_srv : %8lld %f%%\n", diffS, 100*2*44100.0*diffS/(size*n*cpu_clock)); + printf("mix_areas0 : %8lld %f%%\n", diff0, 100*2*44100.0*diff0/(size*n*cpu_clock)); + printf("mix_areas1 : %8lld %f%%\n", diff1, 100*2*44100.0*diff1/(size*n*cpu_clock)); + printf("mix_areas1_mmx : %8lld %f%%\n", diff1_mmx, 100*2*44100.0*diff1_mmx/(size*n*cpu_clock)); + printf("mix_areas2 : %8lld %f%%\n", diff2, 100*2*44100.0*diff2/(size*n*cpu_clock)); printf("\n"); printf("areas1/srv ratio : %f\n", (double)diff1 / diffS); -- cgit v1.2.3 From 956bc152e7f77714a3be58dccf91ef8542c34556 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 23 Oct 2018 10:18:24 +0200 Subject: test: rename code to more approriate mixtest Signed-off-by: Jaroslav Kysela --- test/Makefile.am | 2 +- test/code.c | 335 ------------------------------------------------------- test/mixtest.c | 335 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 336 insertions(+), 336 deletions(-) delete mode 100644 test/code.c create mode 100644 test/mixtest.c diff --git a/test/Makefile.am b/test/Makefile.am index 5f35159a..99c2c4ff 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -20,7 +20,7 @@ oldapi_LDADD=../src/libasound.la queue_timer_LDADD=../src/libasound.la namehint_LDADD=../src/libasound.la client_event_filter_LDADD=../src/libasound.la -code_CFLAGS=-Wall -pipe -g -O2 +mixtest_CFLAGS=-Wall -pipe -g -O2 chmap_LDADD=../src/libasound.la audio_time_LDADD=../src/libasound.la pcm_multi_thread_LDADD=../src/libasound.la diff --git a/test/code.c b/test/code.c deleted file mode 100644 index 3706243e..00000000 --- a/test/code.c +++ /dev/null @@ -1,335 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#define rdtscll(val) \ - __asm__ __volatile__("rdtsc" : "=A" (val)) - -#define likely(x) __builtin_expect((x),1) -#define unlikely(x) __builtin_expect((x),0) - -typedef short int s16; -typedef int s32; - -#if 0 -#define CONFIG_SMP -#endif - -#ifdef CONFIG_SMP -#define LOCK_PREFIX "lock ; " -#else -#define LOCK_PREFIX "" -#endif - -struct __xchg_dummy { unsigned long a[100]; }; -#define __xg(x) ((struct __xchg_dummy *)(x)) - -static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, - unsigned long new, int size) -{ - unsigned long prev; - switch (size) { - case 1: - __asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2" - : "=a"(prev) - : "q"(new), "m"(*__xg(ptr)), "0"(old) - : "memory"); - return prev; - case 2: - __asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2" - : "=a"(prev) - : "q"(new), "m"(*__xg(ptr)), "0"(old) - : "memory"); - return prev; - case 4: - __asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2" - : "=a"(prev) - : "q"(new), "m"(*__xg(ptr)), "0"(old) - : "memory"); - return prev; - } - return old; -} - -#define cmpxchg(ptr,o,n)\ - ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\ - (unsigned long)(n),sizeof(*(ptr)))) - -static inline void atomic_add(volatile int *dst, int v) -{ - __asm__ __volatile__( - LOCK_PREFIX "addl %1,%0" - :"=m" (*dst) - :"ir" (v), "m" (*dst)); -} - -static double detect_cpu_clock() -{ - struct timespec tm_begin, tm_end; - unsigned long long tsc_begin, tsc_end; - - /* Warm cache */ - clock_gettime(CLOCK_MONOTONIC, &tm_begin); - - rdtscll(tsc_begin); - clock_gettime(CLOCK_MONOTONIC, &tm_begin); - - usleep(1000000); - - rdtscll(tsc_end); - clock_gettime(CLOCK_MONOTONIC, &tm_end); - - return (tsc_end - tsc_begin) / (tm_end.tv_sec - tm_begin.tv_sec + (tm_end.tv_nsec - tm_begin.tv_nsec) / 1e9); -} - -void mix_areas_srv(unsigned int size, - const s16 *src, - volatile s32 *sum, - unsigned int src_step, unsigned int sum_step) -{ - src_step /= sizeof(*src); - sum_step /= sizeof(*sum); - while (size-- > 0) { - atomic_add(sum, *src); - src += src_step; - sum += sum_step; - } -} - -void saturate(unsigned int size, - s16 *dst, const s32 *sum, - unsigned int dst_step, unsigned int sum_step) -{ - dst_step /= sizeof(*dst); - sum_step /= sizeof(*sum); - while (size-- > 0) { - s32 sample = *sum; - if (unlikely(sample < -0x8000)) - *dst = -0x8000; - else if (unlikely(sample > 0x7fff)) - *dst = 0x7fff; - else - *dst = sample; - dst += dst_step; - sum += sum_step; - } -} - -void mix_areas0(unsigned int size, - volatile s16 *dst, s16 *src, - volatile s32 *sum, - unsigned int dst_step, - unsigned int src_step, - unsigned int sum_step) -{ - dst_step /= sizeof(*dst); - src_step /= sizeof(*src); - sum_step /= sizeof(*sum); - while (size-- > 0) { - s32 sample = *dst + *src; - if (unlikely(sample < -0x8000)) - *dst = -0x8000; - else if (unlikely(sample > 0x7fff)) - *dst = 0x7fff; - else - *dst = sample; - dst += dst_step; - src += src_step; - sum += sum_step; - } -} - -#define MIX_AREAS_16 mix_areas1 -#define MIX_AREAS_16_MMX mix_areas1_mmx -#define MIX_AREAS_32 mix_areas1_32 -#define MIX_AREAS_24 mix_areas1_24 -#define MIX_AREAS_24_CMOV mix_areas1_24_cmov -#define XADD "addl" -#define XSUB "subl" -#include "../src/pcm/pcm_dmix_i386.h" -static void *ptr_mix_areas1_32 __attribute__((unused)) = &mix_areas1_32; -static void *ptr_mix_areas1_24 __attribute__((unused)) = &mix_areas1_24; -static void *ptr_mix_areas1_24_cmov __attribute__((unused)) = &mix_areas1_24_cmov; - -void mix_areas2(unsigned int size, - volatile s16 *dst, const s16 *src, - volatile s32 *sum, - unsigned int dst_step, - unsigned int src_step) -{ - dst_step /= sizeof(*dst); - src_step /= sizeof(*src); - while (size-- > 0) { - s32 sample = *src; - s32 old_sample = *sum; - if (cmpxchg(dst, 0, 1) == 0) - sample -= old_sample; - atomic_add(sum, sample); - do { - sample = *sum; - if (unlikely(sample < -0x8000)) - *dst = -0x8000; - else if (unlikely(sample > 0x7fff)) - *dst = 0x7fff; - else - *dst = sample; - } while (unlikely(sample != *sum)); - sum++; - dst += dst_step; - src += src_step; - } -} - -void setscheduler(void) -{ - struct sched_param sched_param; - - if (sched_getparam(0, &sched_param) < 0) { - printf("Scheduler getparam failed...\n"); - return; - } - sched_param.sched_priority = sched_get_priority_max(SCHED_RR); - if (!sched_setscheduler(0, SCHED_RR, &sched_param)) { - printf("Scheduler set to Round Robin with priority %i...\n", sched_param.sched_priority); - fflush(stdout); - return; - } - printf("!!!Scheduler set to Round Robin with priority %i FAILED!!!\n", sched_param.sched_priority); -} - -int cache_size = 1024*1024; - -void init(s16 *dst, s32 *sum, int size) -{ - int count; - char *a; - - for (count = size - 1; count >= 0; count--) - *sum++ = 0; - for (count = size - 1; count >= 0; count--) - *dst++ = 0; - a = malloc(cache_size); - for (count = cache_size - 1; count >= 0; count--) { - a[count] = count & 0xff; - a[count] ^= 0x55; - a[count] ^= 0xaa; - } - free(a); -} - -int main(int argc, char **argv) -{ - int size = 2048, n = 4, max = 32267; - int LOOP = 100; - int i, t; - unsigned long long begin, end, diff, diffS, diff0, diff1, diff1_mmx, diff2; - double cpu_clock = detect_cpu_clock(); - s16 *dst = malloc(sizeof(*dst) * size); - s32 *sum = calloc(size, sizeof(*sum)); - s16 **srcs = malloc(sizeof(*srcs) * n); - - setscheduler(); -#ifndef CONFIG_SMP - printf("CPU clock: %fMhz (UP)\n\n", cpu_clock / 10e5); -#else - printf("CPU clock: %fMhz (SMP)\n\n", cpu_clock / 10e5); -#endif - if (argc > 3) { - size = atoi(argv[1]); - n = atoi(argv[2]); - max = atoi(argv[3]); - } - if (argc > 4) - cache_size = atoi(argv[4]) * 1024; - for (i = 0; i < n; i++) { - int k; - s16 *s; - srcs[i] = s = malloc(sizeof(s16) * size); - for (k = 0; k < size; ++k, ++s) { - *s = (rand() % (max * 2)) - max; - } - } - - for (t = 0, diffS = -1; t < LOOP; t++) { - init(dst, sum, size); - rdtscll(begin); - for (i = 0; i < n; i++) { - mix_areas_srv(size, srcs[i], sum, 2, 4); - } - saturate(size, dst, sum, 2, 4); - rdtscll(end); - diff = end - begin; - if (diff < diffS) - diffS = diff; - printf("mix_areas_srv : %lld \r", diff); fflush(stdout); - } - - for (t = 0, diff0 = -1; t < LOOP; t++) { - init(dst, sum, size); - rdtscll(begin); - for (i = 0; i < n; i++) { - mix_areas0(size, dst, srcs[i], sum, 2, 2, 4); - } - rdtscll(end); - diff = end - begin; - if (diff < diff0) - diff0 = diff; - printf("mix_areas0 : %lld \r", diff); fflush(stdout); - } - - for (t = 0, diff1 = -1; t < LOOP; t++) { - init(dst, sum, size); - rdtscll(begin); - for (i = 0; i < n; i++) { - mix_areas1(size, dst, srcs[i], sum, 2, 2, 4); - } - rdtscll(end); - diff = end - begin; - if (diff < diff1) - diff1 = diff; - printf("mix_areas1 : %lld \r", diff); fflush(stdout); - } - - for (t = 0, diff1_mmx = -1; t < LOOP; t++) { - init(dst, sum, size); - rdtscll(begin); - for (i = 0; i < n; i++) { - mix_areas1_mmx(size, dst, srcs[i], sum, 2, 2, 4); - } - rdtscll(end); - diff = end - begin; - if (diff < diff1_mmx) - diff1_mmx = diff; - printf("mix_areas1_mmx: %lld \r", diff); fflush(stdout); - } - - for (t = 0, diff2 = -1; t < LOOP; t++) { - init(dst, sum, size); - rdtscll(begin); - for (i = 0; i < n; i++) { - mix_areas2(size, dst, srcs[i], sum, 2, 2); - } - rdtscll(end); - diff = end - begin; - if (diff < diff2) - diff2 = diff; - printf("mix_areas2 : %lld \r", diff); fflush(stdout); - } - - printf(" \r"); - printf("Summary (the best times):\n"); - printf("mix_areas_srv : %8lld %f%%\n", diffS, 100*2*44100.0*diffS/(size*n*cpu_clock)); - printf("mix_areas0 : %8lld %f%%\n", diff0, 100*2*44100.0*diff0/(size*n*cpu_clock)); - printf("mix_areas1 : %8lld %f%%\n", diff1, 100*2*44100.0*diff1/(size*n*cpu_clock)); - printf("mix_areas1_mmx : %8lld %f%%\n", diff1_mmx, 100*2*44100.0*diff1_mmx/(size*n*cpu_clock)); - printf("mix_areas2 : %8lld %f%%\n", diff2, 100*2*44100.0*diff2/(size*n*cpu_clock)); - - printf("\n"); - printf("areas1/srv ratio : %f\n", (double)diff1 / diffS); - printf("areas1_mmx/srv ratio : %f\n", (double)diff1_mmx / diffS); - - return 0; -} diff --git a/test/mixtest.c b/test/mixtest.c new file mode 100644 index 00000000..3706243e --- /dev/null +++ b/test/mixtest.c @@ -0,0 +1,335 @@ +#include +#include +#include +#include +#include +#include + +#define rdtscll(val) \ + __asm__ __volatile__("rdtsc" : "=A" (val)) + +#define likely(x) __builtin_expect((x),1) +#define unlikely(x) __builtin_expect((x),0) + +typedef short int s16; +typedef int s32; + +#if 0 +#define CONFIG_SMP +#endif + +#ifdef CONFIG_SMP +#define LOCK_PREFIX "lock ; " +#else +#define LOCK_PREFIX "" +#endif + +struct __xchg_dummy { unsigned long a[100]; }; +#define __xg(x) ((struct __xchg_dummy *)(x)) + +static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, + unsigned long new, int size) +{ + unsigned long prev; + switch (size) { + case 1: + __asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2" + : "=a"(prev) + : "q"(new), "m"(*__xg(ptr)), "0"(old) + : "memory"); + return prev; + case 2: + __asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2" + : "=a"(prev) + : "q"(new), "m"(*__xg(ptr)), "0"(old) + : "memory"); + return prev; + case 4: + __asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2" + : "=a"(prev) + : "q"(new), "m"(*__xg(ptr)), "0"(old) + : "memory"); + return prev; + } + return old; +} + +#define cmpxchg(ptr,o,n)\ + ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\ + (unsigned long)(n),sizeof(*(ptr)))) + +static inline void atomic_add(volatile int *dst, int v) +{ + __asm__ __volatile__( + LOCK_PREFIX "addl %1,%0" + :"=m" (*dst) + :"ir" (v), "m" (*dst)); +} + +static double detect_cpu_clock() +{ + struct timespec tm_begin, tm_end; + unsigned long long tsc_begin, tsc_end; + + /* Warm cache */ + clock_gettime(CLOCK_MONOTONIC, &tm_begin); + + rdtscll(tsc_begin); + clock_gettime(CLOCK_MONOTONIC, &tm_begin); + + usleep(1000000); + + rdtscll(tsc_end); + clock_gettime(CLOCK_MONOTONIC, &tm_end); + + return (tsc_end - tsc_begin) / (tm_end.tv_sec - tm_begin.tv_sec + (tm_end.tv_nsec - tm_begin.tv_nsec) / 1e9); +} + +void mix_areas_srv(unsigned int size, + const s16 *src, + volatile s32 *sum, + unsigned int src_step, unsigned int sum_step) +{ + src_step /= sizeof(*src); + sum_step /= sizeof(*sum); + while (size-- > 0) { + atomic_add(sum, *src); + src += src_step; + sum += sum_step; + } +} + +void saturate(unsigned int size, + s16 *dst, const s32 *sum, + unsigned int dst_step, unsigned int sum_step) +{ + dst_step /= sizeof(*dst); + sum_step /= sizeof(*sum); + while (size-- > 0) { + s32 sample = *sum; + if (unlikely(sample < -0x8000)) + *dst = -0x8000; + else if (unlikely(sample > 0x7fff)) + *dst = 0x7fff; + else + *dst = sample; + dst += dst_step; + sum += sum_step; + } +} + +void mix_areas0(unsigned int size, + volatile s16 *dst, s16 *src, + volatile s32 *sum, + unsigned int dst_step, + unsigned int src_step, + unsigned int sum_step) +{ + dst_step /= sizeof(*dst); + src_step /= sizeof(*src); + sum_step /= sizeof(*sum); + while (size-- > 0) { + s32 sample = *dst + *src; + if (unlikely(sample < -0x8000)) + *dst = -0x8000; + else if (unlikely(sample > 0x7fff)) + *dst = 0x7fff; + else + *dst = sample; + dst += dst_step; + src += src_step; + sum += sum_step; + } +} + +#define MIX_AREAS_16 mix_areas1 +#define MIX_AREAS_16_MMX mix_areas1_mmx +#define MIX_AREAS_32 mix_areas1_32 +#define MIX_AREAS_24 mix_areas1_24 +#define MIX_AREAS_24_CMOV mix_areas1_24_cmov +#define XADD "addl" +#define XSUB "subl" +#include "../src/pcm/pcm_dmix_i386.h" +static void *ptr_mix_areas1_32 __attribute__((unused)) = &mix_areas1_32; +static void *ptr_mix_areas1_24 __attribute__((unused)) = &mix_areas1_24; +static void *ptr_mix_areas1_24_cmov __attribute__((unused)) = &mix_areas1_24_cmov; + +void mix_areas2(unsigned int size, + volatile s16 *dst, const s16 *src, + volatile s32 *sum, + unsigned int dst_step, + unsigned int src_step) +{ + dst_step /= sizeof(*dst); + src_step /= sizeof(*src); + while (size-- > 0) { + s32 sample = *src; + s32 old_sample = *sum; + if (cmpxchg(dst, 0, 1) == 0) + sample -= old_sample; + atomic_add(sum, sample); + do { + sample = *sum; + if (unlikely(sample < -0x8000)) + *dst = -0x8000; + else if (unlikely(sample > 0x7fff)) + *dst = 0x7fff; + else + *dst = sample; + } while (unlikely(sample != *sum)); + sum++; + dst += dst_step; + src += src_step; + } +} + +void setscheduler(void) +{ + struct sched_param sched_param; + + if (sched_getparam(0, &sched_param) < 0) { + printf("Scheduler getparam failed...\n"); + return; + } + sched_param.sched_priority = sched_get_priority_max(SCHED_RR); + if (!sched_setscheduler(0, SCHED_RR, &sched_param)) { + printf("Scheduler set to Round Robin with priority %i...\n", sched_param.sched_priority); + fflush(stdout); + return; + } + printf("!!!Scheduler set to Round Robin with priority %i FAILED!!!\n", sched_param.sched_priority); +} + +int cache_size = 1024*1024; + +void init(s16 *dst, s32 *sum, int size) +{ + int count; + char *a; + + for (count = size - 1; count >= 0; count--) + *sum++ = 0; + for (count = size - 1; count >= 0; count--) + *dst++ = 0; + a = malloc(cache_size); + for (count = cache_size - 1; count >= 0; count--) { + a[count] = count & 0xff; + a[count] ^= 0x55; + a[count] ^= 0xaa; + } + free(a); +} + +int main(int argc, char **argv) +{ + int size = 2048, n = 4, max = 32267; + int LOOP = 100; + int i, t; + unsigned long long begin, end, diff, diffS, diff0, diff1, diff1_mmx, diff2; + double cpu_clock = detect_cpu_clock(); + s16 *dst = malloc(sizeof(*dst) * size); + s32 *sum = calloc(size, sizeof(*sum)); + s16 **srcs = malloc(sizeof(*srcs) * n); + + setscheduler(); +#ifndef CONFIG_SMP + printf("CPU clock: %fMhz (UP)\n\n", cpu_clock / 10e5); +#else + printf("CPU clock: %fMhz (SMP)\n\n", cpu_clock / 10e5); +#endif + if (argc > 3) { + size = atoi(argv[1]); + n = atoi(argv[2]); + max = atoi(argv[3]); + } + if (argc > 4) + cache_size = atoi(argv[4]) * 1024; + for (i = 0; i < n; i++) { + int k; + s16 *s; + srcs[i] = s = malloc(sizeof(s16) * size); + for (k = 0; k < size; ++k, ++s) { + *s = (rand() % (max * 2)) - max; + } + } + + for (t = 0, diffS = -1; t < LOOP; t++) { + init(dst, sum, size); + rdtscll(begin); + for (i = 0; i < n; i++) { + mix_areas_srv(size, srcs[i], sum, 2, 4); + } + saturate(size, dst, sum, 2, 4); + rdtscll(end); + diff = end - begin; + if (diff < diffS) + diffS = diff; + printf("mix_areas_srv : %lld \r", diff); fflush(stdout); + } + + for (t = 0, diff0 = -1; t < LOOP; t++) { + init(dst, sum, size); + rdtscll(begin); + for (i = 0; i < n; i++) { + mix_areas0(size, dst, srcs[i], sum, 2, 2, 4); + } + rdtscll(end); + diff = end - begin; + if (diff < diff0) + diff0 = diff; + printf("mix_areas0 : %lld \r", diff); fflush(stdout); + } + + for (t = 0, diff1 = -1; t < LOOP; t++) { + init(dst, sum, size); + rdtscll(begin); + for (i = 0; i < n; i++) { + mix_areas1(size, dst, srcs[i], sum, 2, 2, 4); + } + rdtscll(end); + diff = end - begin; + if (diff < diff1) + diff1 = diff; + printf("mix_areas1 : %lld \r", diff); fflush(stdout); + } + + for (t = 0, diff1_mmx = -1; t < LOOP; t++) { + init(dst, sum, size); + rdtscll(begin); + for (i = 0; i < n; i++) { + mix_areas1_mmx(size, dst, srcs[i], sum, 2, 2, 4); + } + rdtscll(end); + diff = end - begin; + if (diff < diff1_mmx) + diff1_mmx = diff; + printf("mix_areas1_mmx: %lld \r", diff); fflush(stdout); + } + + for (t = 0, diff2 = -1; t < LOOP; t++) { + init(dst, sum, size); + rdtscll(begin); + for (i = 0; i < n; i++) { + mix_areas2(size, dst, srcs[i], sum, 2, 2); + } + rdtscll(end); + diff = end - begin; + if (diff < diff2) + diff2 = diff; + printf("mix_areas2 : %lld \r", diff); fflush(stdout); + } + + printf(" \r"); + printf("Summary (the best times):\n"); + printf("mix_areas_srv : %8lld %f%%\n", diffS, 100*2*44100.0*diffS/(size*n*cpu_clock)); + printf("mix_areas0 : %8lld %f%%\n", diff0, 100*2*44100.0*diff0/(size*n*cpu_clock)); + printf("mix_areas1 : %8lld %f%%\n", diff1, 100*2*44100.0*diff1/(size*n*cpu_clock)); + printf("mix_areas1_mmx : %8lld %f%%\n", diff1_mmx, 100*2*44100.0*diff1_mmx/(size*n*cpu_clock)); + printf("mix_areas2 : %8lld %f%%\n", diff2, 100*2*44100.0*diff2/(size*n*cpu_clock)); + + printf("\n"); + printf("areas1/srv ratio : %f\n", (double)diff1 / diffS); + printf("areas1_mmx/srv ratio : %f\n", (double)diff1_mmx / diffS); + + return 0; +} -- cgit v1.2.3 From 92172adb0b733de5a52f1671a279b3079cf0a657 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 23 Oct 2018 10:20:20 +0200 Subject: test/audio_time: remove unused variables Signed-off-by: Jaroslav Kysela --- test/audio_time.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/audio_time.c b/test/audio_time.c index a54c10dc..530922d9 100644 --- a/test/audio_time.c +++ b/test/audio_time.c @@ -115,9 +115,7 @@ int main(int argc, char *argv[]) snd_pcm_sw_params_t *swparams_p; snd_pcm_sw_params_t *swparams_c; - snd_pcm_uframes_t curr_count_c; snd_pcm_uframes_t frame_count_c = 0; - snd_pcm_uframes_t curr_count_p; snd_pcm_uframes_t frame_count_p = 0; snd_pcm_sframes_t delay_p, delay_c; -- cgit v1.2.3 From b420056604f06117c967b65d43d01536c5ffcbc9 Mon Sep 17 00:00:00 2001 From: Timo Wischer Date: Thu, 18 Oct 2018 13:33:24 +0200 Subject: pcm: interval: Interpret (x x+1] correctly and return x+1 Without this change an interval of (x x+1] will be interpreted as an empty interval but the right value would be x+1. This leads to a failing snd_pcm_hw_params() call which returns -EINVAL. An example issue log is given in the following: snd_pcm_hw_params failed with err -22 (Invalid argument) ACCESS: MMAP_NONINTERLEAVED FORMAT: S16_LE SUBFORMAT: STD SAMPLE_BITS: 16 FRAME_BITS: 16 CHANNELS: 1 RATE: 16000 PERIOD_TIME: (15999 16000] PERIOD_SIZE: (255 256] PERIOD_BYTES: (510 512] PERIODS: [2 3) BUFFER_TIME: 32000 BUFFER_SIZE: 512 BUFFER_BYTES: 1024 In case of (x x+1) we have to interpret it anyway as a single value of x to compensate rounding issues. For example the period size will result in an interval of (352 353) when the period time is 16ms and the sample rate 22050 Hz (16ms * 22,05 kHz = 352,8 frames). But 352 has to be chosen to allow a buffer size of 705 (32ms * 22,05 kHz = 705,6 frames) which has to be >= 2x period size to avoid Xruns. The buffer size will not end up with an interval of (705 706) simular to the period size because snd_pcm_rate_hw_refine_cchange() calls snd_interval_floor() for the buffer size. Therefore this value will be interpreted as an integer interval instead of a real interval further on. This issue seems to exist since the change of 9bb985c38 ("pcm: snd_interval_refine_first/last: exclude value only if also excluded before") Signed-off-by: Timo Wischer Signed-off-by: Jaroslav Kysela --- src/pcm/interval_inline.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pcm/interval_inline.h b/src/pcm/interval_inline.h index a68e292b..d9a30b2a 100644 --- a/src/pcm/interval_inline.h +++ b/src/pcm/interval_inline.h @@ -51,12 +51,14 @@ INTERVAL_INLINE int snd_interval_single(const snd_interval_t *i) { assert(!snd_interval_empty(i)); return (i->min == i->max || - (i->min + 1 == i->max && i->openmax)); + (i->min + 1 == i->max && (i->openmin || i->openmax))); } INTERVAL_INLINE int snd_interval_value(const snd_interval_t *i) { assert(snd_interval_single(i)); + if (i->openmin && !i->openmax) + return i->max; return i->min; } -- cgit v1.2.3 From 6fbee195e00bd4ddd09e04c0c32db77c5fd7050c Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 23 Oct 2018 17:21:16 +0200 Subject: initial version of .travis.yml file Signed-off-by: Jaroslav Kysela --- .gitignore | 1 + .travis.yml | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 .travis.yml diff --git a/.gitignore b/.gitignore index 098de14d..88d6b6ad 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .* +!.travis.yml configure config.log config.cache diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..e32b0f77 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +sudo: required +language: c +script: + - sed 's/-Wunused-const-variable=0//g' < gitcompile > gitcompile.travis + - bash gitcompile.travis -- cgit v1.2.3 From fa72edc217c4d69aaf30c3571633ac48d56cc68d Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 24 Oct 2018 16:13:48 +0200 Subject: initial version of README.md for github --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..8b67e8b8 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# alsa-lib +## Advanced Linux Sound Architecture (ALSA) project + +The alsa-lib is a library to interface with ALSA in the Linux kernel and +virtual devices using a plugin system. + +The up-to-date reference generated from sources can be accessed here: + +http://www.alsa-project.org/alsa-doc/alsa-lib/ -- cgit v1.2.3 From 9a8d0b0ad56d70f1822fb2219b090c66dcb6618d Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 24 Oct 2018 17:33:10 +0200 Subject: README.md: add link to www.alsa-project.org --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 8b67e8b8..9d6f7c8e 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,6 @@ virtual devices using a plugin system. The up-to-date reference generated from sources can be accessed here: http://www.alsa-project.org/alsa-doc/alsa-lib/ + +You may give a look for more information about the ALSA project to URL +http://www.alsa-project.org. -- cgit v1.2.3 From 178fe66bc88c6ccdd3b90195e7178293d368a83b Mon Sep 17 00:00:00 2001 From: Thomas De Schampheleire Date: Thu, 1 Nov 2018 15:40:07 +0100 Subject: utils/alsa.m4: conditionally enable libdl in AM_PATH_ALSA m4 macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The AM_PATH_ALSA macro in utils/alsa.m4 unconditionally uses -ldl. This breaks compilation of alsa-utils (and probably other packages using this macro) for targets that do not support dynamic loading. This patch updates the macro to check if dlopen is available, and use that result to conditionally add -ldl to the list of libraries. Signed-off-by: Thomas De Schampheleire Signed-off-by: Jörg Krause Signed-off-by: Thomas Petazzoni Signed-off-by: Takashi Iwai --- utils/alsa.m4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/alsa.m4 b/utils/alsa.m4 index e12310df..a5c5a292 100644 --- a/utils/alsa.m4 +++ b/utils/alsa.m4 @@ -44,6 +44,8 @@ if test "$alsa_inc_prefix" != "" ; then fi AC_MSG_RESULT($ALSA_CFLAGS) +AC_CHECK_LIB(c, dlopen, LIBDL="", [AC_CHECK_LIB(dl, dlopen, LIBDL="-ldl")]) + dnl add any special lib dirs AC_MSG_CHECKING(for ALSA LDFLAGS) if test "$alsa_prefix" != "" ; then @@ -52,7 +54,7 @@ if test "$alsa_prefix" != "" ; then fi dnl add the alsa library -ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread" +ALSA_LIBS="$ALSA_LIBS -lasound -lm $LIBDL -lpthread" LIBS="$ALSA_LIBS $LIBS" AC_MSG_RESULT($ALSA_LIBS) -- cgit v1.2.3 From 6b058fda9dce8f416774ae54975f5706f3f5a6da Mon Sep 17 00:00:00 2001 From: Laxmi Devi Date: Tue, 13 Nov 2018 08:43:00 +0100 Subject: pcm: dmix: Add option to allow alignment of slave pointers These changes are required due to the kernel commit 07b7acb51d283d8469696c906b91f1882696a4d4 ("ASoC: rsnd: update pointer more accurate") Issue is that snd_pcm_wait() goes back to waiting because the hw_ptr is not period aligned. Therefore snd_pcm_wait() will block for a longer time as required. With these rcar driver changes the exact position of the dma is returned. During snd_pcm_start they read hw_ptr as reference, and this hw_ptr is now not period aligned, and is a little ahead over the period while it is read. Therefore when the avail is calculated during snd_pcm_wait(), it is missing the avail_min by a few frames. An additional option hw_ptr_alignment is provided to dmix configuration, to allow the user to configure the slave application and hw pointer alignment at startup [ Slight indentation and parentheses removals by tiwai ] Signed-off-by: Laxmi Devi Signed-off-by: Timo Wischer Signed-off-by: Takashi Iwai --- src/pcm/pcm_direct.c | 23 +++++++++++++++++++++++ src/pcm/pcm_direct.h | 9 +++++++++ src/pcm/pcm_dmix.c | 52 ++++++++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 76 insertions(+), 8 deletions(-) diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c index 2b07eff9..8998943a 100644 --- a/src/pcm/pcm_direct.c +++ b/src/pcm/pcm_direct.c @@ -1877,6 +1877,7 @@ int snd_pcm_direct_parse_open_conf(snd_config_t *root, snd_config_t *conf, rec->max_periods = 0; rec->var_periodsize = 0; rec->direct_memory_access = 1; + rec->hw_ptr_alignment = SND_PCM_HW_PTR_ALIGNMENT_AUTO; /* read defaults */ if (snd_config_search(root, "defaults.pcm.dmix_max_periods", &n) >= 0) { @@ -1918,6 +1919,28 @@ int snd_pcm_direct_parse_open_conf(snd_config_t *root, snd_config_t *conf, rec->ipc_perm = perm; continue; } + if (strcmp(id, "hw_ptr_alignment") == 0) { + const char *str; + err = snd_config_get_string(n, &str); + if (err < 0) { + SNDERR("Invalid type for %s", id); + return -EINVAL; + } + if (strcmp(str, "no") == 0) + rec->hw_ptr_alignment = SND_PCM_HW_PTR_ALIGNMENT_NO; + else if (strcmp(str, "roundup") == 0) + rec->hw_ptr_alignment = SND_PCM_HW_PTR_ALIGNMENT_ROUNDUP; + else if (strcmp(str, "rounddown") == 0) + rec->hw_ptr_alignment = SND_PCM_HW_PTR_ALIGNMENT_ROUNDDOWN; + else if (strcmp(str, "auto") == 0) + rec->hw_ptr_alignment = SND_PCM_HW_PTR_ALIGNMENT_AUTO; + else { + SNDERR("The field hw_ptr_alignment is invalid : %s", str); + return -EINVAL; + } + + continue; + } if (strcmp(id, "ipc_gid") == 0) { char *group; char *endp; diff --git a/src/pcm/pcm_direct.h b/src/pcm/pcm_direct.h index f0ad82ae..da5e280e 100644 --- a/src/pcm/pcm_direct.h +++ b/src/pcm/pcm_direct.h @@ -50,6 +50,13 @@ typedef void (mix_areas_u8_t)(unsigned int size, volatile signed int *sum, size_t dst_step, size_t src_step, size_t sum_step); +typedef enum snd_pcm_direct_hw_ptr_alignment { + SND_PCM_HW_PTR_ALIGNMENT_NO = 0, /* use the hw_ptr as is and do no rounding */ + SND_PCM_HW_PTR_ALIGNMENT_ROUNDUP = 1, /* round the slave_appl_ptr up to slave_period */ + SND_PCM_HW_PTR_ALIGNMENT_ROUNDDOWN = 2, /* round slave_hw_ptr and slave_appl_ptr down to slave_period */ + SND_PCM_HW_PTR_ALIGNMENT_AUTO = 3 /* automatic selection */ +} snd_pcm_direct_hw_ptr_alignment_t; + struct slave_params { snd_pcm_format_t format; int rate; @@ -160,6 +167,7 @@ struct snd_pcm_direct { unsigned int *bindings; unsigned int recoveries; /* mirror of executed recoveries on slave */ int direct_memory_access; /* use arch-optimized buffer RW */ + snd_pcm_direct_hw_ptr_alignment_t hw_ptr_alignment; union { struct { int shmid_sum; /* IPC global sum ring buffer memory identification */ @@ -342,6 +350,7 @@ struct snd_pcm_direct_open_conf { int max_periods; int var_periodsize; int direct_memory_access; + snd_pcm_direct_hw_ptr_alignment_t hw_ptr_alignment; snd_config_t *slave; snd_config_t *bindings; }; diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c index 3a951f53..c5592cdb 100644 --- a/src/pcm/pcm_dmix.c +++ b/src/pcm/pcm_dmix.c @@ -55,6 +55,9 @@ const char *_snd_module_pcm_dmix = ""; #define STATE_RUN_PENDING 1024 #endif +#define SEC_TO_MS 1000 /* Seconds representing in Milli seconds */ +#define LOW_LATENCY_PERIOD_TIME 10 /* slave_period time for low latency requirements in ms */ + /* * */ @@ -560,14 +563,19 @@ static int snd_pcm_dmix_hwsync(snd_pcm_t *pcm) static void reset_slave_ptr(snd_pcm_t *pcm, snd_pcm_direct_t *dmix) { dmix->slave_appl_ptr = dmix->slave_hw_ptr = *dmix->spcm->hw.ptr; - if (pcm->buffer_size > pcm->period_size * 2) - return; - /* If we have too litte periods, better to align the start position - * to the period boundary so that the interrupt can be handled properly - * at the right time. - */ - dmix->slave_appl_ptr = ((dmix->slave_appl_ptr + dmix->slave_period_size - 1) - / dmix->slave_period_size) * dmix->slave_period_size; + + if (dmix->hw_ptr_alignment == SND_PCM_HW_PTR_ALIGNMENT_ROUNDUP || + (dmix->hw_ptr_alignment == SND_PCM_HW_PTR_ALIGNMENT_AUTO && + pcm->buffer_size <= pcm->period_size * 2)) + dmix->slave_appl_ptr = + ((dmix->slave_appl_ptr + dmix->slave_period_size - 1) + / dmix->slave_period_size) * dmix->slave_period_size; + else if (dmix->hw_ptr_alignment == SND_PCM_HW_PTR_ALIGNMENT_ROUNDDOWN || + (dmix->hw_ptr_alignment == SND_PCM_HW_PTR_ALIGNMENT_AUTO && + (dmix->slave_period_size * SEC_TO_MS) / pcm->rate < LOW_LATENCY_PERIOD_TIME)) + dmix->slave_appl_ptr = dmix->slave_hw_ptr = + ((dmix->slave_hw_ptr / dmix->slave_period_size) * + dmix->slave_period_size); } static int snd_pcm_dmix_reset(snd_pcm_t *pcm) @@ -1086,6 +1094,7 @@ int snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name, dmix->slowptr = opts->slowptr; dmix->max_periods = opts->max_periods; dmix->var_periodsize = opts->var_periodsize; + dmix->hw_ptr_alignment = opts->hw_ptr_alignment; dmix->sync_ptr = snd_pcm_dmix_sync_ptr; dmix->direct_memory_access = opts->direct_memory_access; @@ -1241,6 +1250,12 @@ pcm.name { ipc_key INT # unique IPC key ipc_key_add_uid BOOL # add current uid to unique IPC key ipc_perm INT # IPC permissions (octal, default 0600) + hw_ptr_alignment STR # Slave application and hw pointer alignment type + # STR can be one of the below strings : + # no + # roundup + # rounddown + # auto (default) slave STR # or slave { # Slave definition @@ -1273,6 +1288,27 @@ added to the value set in ipc_key. This will avoid the confliction of the same IPC key with different users concurrently. +hw_ptr_alignment specifies slave application and hw +pointer alignment type. By default hw_ptr_alignment is auto. Below are +the possible configurations: +- no: minimal latency with minimal frames dropped at startup. But + wakeup of application (return from snd_pcm_wait() or poll()) can + take up to 2 * period. +- roundup: It is guaranteed that all frames will be played at + startup. But the latency will increase upto period-1 frames. +- rounddown: It is guaranteed that a wakeup will happen for each + period and frames can be written from application. But on startup + upto period-1 frames will be dropped. +- auto: Selects the best approach depending on the used period and + buffer size. + If the application buffer size is < 2 * application period, + "roundup" will be selected to avoid under runs. If the slave_period + is < 10ms we could expect that there are low latency + requirements. Therefore "rounddown" will be chosen to avoid long + wakeup times. Such wakeup delay could otherwise end up with Xruns in + case of a dependency to another sound device (e.g. forwarding of + microphone to speaker). Else "no" will be chosen. + Note that the dmix plugin itself supports only a single configuration. That is, it supports only the fixed rate (default 48000), format (\c S16), channels (2), and period_time (125000). -- cgit v1.2.3 From d3dfef24bf47b0556deed9686d62a0255cace7e8 Mon Sep 17 00:00:00 2001 From: Kirill Marinushkin Date: Tue, 20 Nov 2018 21:43:44 +0100 Subject: pcm: dshare: Fix segfault when not binding channel 0 Configuration to reproduce: ~~~~ pcm.share_right { type dshare ipc_key 73 ipc_perm 0666 slave { pcm "hw:0,0" } bindings { # the seagfault happens when we don't bind channel 0 1 1 } } ~~~~ Execute to reproduce: ~~~~ $ aplay -D plug:share_right test.wav Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo Segmentation fault ~~~~ For channels whithout binding, values are set to UINT_MAX in function `snd_pcm_direct_parse_bindings()`: ~~~~ for (chn = 0; chn < count; chn++) bindings[chn] = UINT_MAX; /* don't route */ ~~~~ But, these values are not checked when playing, which causes the segfault. This commit fixes the issue. Signed-off-by: Kirill Marinushkin Signed-off-by: Takashi Iwai --- src/pcm/pcm_dshare.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c index 54dc9d48..2bb735fe 100644 --- a/src/pcm/pcm_dshare.c +++ b/src/pcm/pcm_dshare.c @@ -67,7 +67,9 @@ static void do_silence(snd_pcm_t *pcm) format = dshare->shmptr->s.format; for (chn = 0; chn < channels; chn++) { dchn = dshare->bindings ? dshare->bindings[chn] : chn; - snd_pcm_area_silence(&dst_areas[dchn], 0, dshare->shmptr->s.buffer_size, format); + if (dchn != UINT_MAX) + snd_pcm_area_silence(&dst_areas[dchn], 0, + dshare->shmptr->s.buffer_size, format); } } @@ -91,7 +93,9 @@ static void share_areas(snd_pcm_direct_t *dshare, } else { for (chn = 0; chn < channels; chn++) { dchn = dshare->bindings ? dshare->bindings[chn] : chn; - snd_pcm_area_copy(&dst_areas[dchn], dst_ofs, &src_areas[chn], src_ofs, size, format); + if (dchn != UINT_MAX) + snd_pcm_area_copy(&dst_areas[dchn], dst_ofs, + &src_areas[chn], src_ofs, size, format); } } @@ -834,8 +838,11 @@ int snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name, dshare->spcm = spcm; } - for (chn = 0; chn < dshare->channels; chn++) - dshare->u.dshare.chn_mask |= (1ULL<bindings[chn]); + for (chn = 0; chn < dshare->channels; chn++) { + unsigned int dchn = dshare->bindings ? dshare->bindings[chn] : chn; + if (dchn != UINT_MAX) + dshare->u.dshare.chn_mask |= (1ULL << dchn); + } if (dshare->shmptr->u.dshare.chn_mask & dshare->u.dshare.chn_mask) { SNDERR("destination channel specified in bindings is already used"); dshare->u.dshare.chn_mask = 0; -- cgit v1.2.3 From 7ca1f6e78c15846951e5d970a864382180be7213 Mon Sep 17 00:00:00 2001 From: Hui Wang Date: Wed, 28 Nov 2018 17:16:45 +0800 Subject: conf: USB-Audio: Add Dell WD19 Dock in the IEC958 blacklist This Dock doesn't have IEC958 physical output, so add it to the blacklist to prevent it being opened. [ Also adding WD15 Dock entry that has the same problem -- tiwai ] Signed-off-by: Hui Wang Signed-off-by: Takashi Iwai --- src/conf/cards/USB-Audio.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/conf/cards/USB-Audio.conf b/src/conf/cards/USB-Audio.conf index 05779c47..1c677937 100644 --- a/src/conf/cards/USB-Audio.conf +++ b/src/conf/cards/USB-Audio.conf @@ -60,6 +60,8 @@ USB-Audio.pcm.iec958_device { "SWTOR Gaming Headset by Razer" 999 "USB Device 0x46d_0x821" 999 "USB Device 0x46d_0x992" 999 + "WD15 Dock" 999 + "WD19 Dock" 999 } # Second iec958 device number, if any. -- cgit v1.2.3 From d48adc2a206d044678be09953d57971c0e1907c7 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 27 Nov 2018 13:55:04 +0100 Subject: conf: Move UCM profile snippets into components subdirectory We have placed UCM profile snippets to be included by the main config files also in the same directory, src/conf/ucm, it confuses alsaucm program that scans over all subdirectories. It thinks such a file is also the main config file, and spews errors like: % alsaucm ALSA lib utils.c:67:(uc_mgr_config_load) could not open configuration file /usr/share/alsa/ucm/bytcr/bytcr.conf ALSA lib parser.c:1427:(load_master_config) error: could not parse configuration for card bytcr alsaucm: unable to obtain card list: No such file or directory Actually we already defined the subdirectory for such components, and they are skipped at parsing the main configs. So we just need to move the files there -- this is what's done here. One more thing done here is to add a new component subdirectory, platforms, for definitions bytcr/* that don't match with neither the existing ones (codecs nor dsps). Suggested-by: Hans de Goede Acked-by: Jaroslav Kysela Reviewed-by: Hans de Goede Tested-by: Hans de Goede Signed-off-by: Takashi Iwai --- configure.ac | 10 +- src/conf/ucm/Makefile.am | 6 +- .../PIPO-W2S-Defaultstring-CherryTrailCR/HiFi.conf | 14 +-- .../ucm/bytcr-rt5640-mono-spk-dmic1-mic/HiFi.conf | 14 +-- .../ucm/bytcr-rt5640-mono-spk-in1-mic/HiFi.conf | 14 +-- .../ucm/bytcr-rt5640-mono-spk-in3-mic/HiFi.conf | 14 +-- .../bytcr-rt5640-stereo-spk-dmic1-mic/HiFi.conf | 14 +-- .../ucm/bytcr-rt5640-stereo-spk-in1-mic/HiFi.conf | 14 +-- .../ucm/bytcr-rt5640-stereo-spk-in3-mic/HiFi.conf | 14 +-- src/conf/ucm/bytcr-rt5640/HiFi.conf | 20 ++-- .../ucm/bytcr-rt5651-mono-spk-in1-mic/HiFi.conf | 14 +-- .../HiFi.conf | 14 +-- .../ucm/bytcr-rt5651-mono-spk-in2-mic/HiFi.conf | 14 +-- .../ucm/bytcr-rt5651-stereo-spk-in1-mic/HiFi.conf | 14 +-- .../ucm/bytcr-rt5651-stereo-spk-in12-mic/HiFi.conf | 14 +-- .../ucm/bytcr-rt5651-stereo-spk-in2-mic/HiFi.conf | 14 +-- src/conf/ucm/bytcr-rt5651/HiFi.conf | 20 ++-- src/conf/ucm/bytcr/Makefile.am | 4 - src/conf/ucm/bytcr/PlatformDisableSeq.conf | 20 ---- src/conf/ucm/bytcr/PlatformEnableSeq.conf | 115 --------------------- src/conf/ucm/chtnau8824/HiFi.conf | 14 +-- src/conf/ucm/chtrt5645/HiFi.conf | 4 +- src/conf/ucm/codecs/Makefile.am | 4 + src/conf/ucm/codecs/nau8824/EnableSeq.conf | 15 +++ src/conf/ucm/codecs/nau8824/HeadPhones.conf | 25 +++++ src/conf/ucm/codecs/nau8824/HeadsetMic.conf | 31 ++++++ src/conf/ucm/codecs/nau8824/InternalMic.conf | 31 ++++++ src/conf/ucm/codecs/nau8824/Makefile.am | 5 + src/conf/ucm/codecs/nau8824/MonoSpeaker.conf | 29 ++++++ src/conf/ucm/codecs/nau8824/Speaker.conf | 28 +++++ src/conf/ucm/codecs/rt5640/DigitalMics.conf | 31 ++++++ src/conf/ucm/codecs/rt5640/EnableSeq.conf | 41 ++++++++ src/conf/ucm/codecs/rt5640/HeadPhones.conf | 41 ++++++++ src/conf/ucm/codecs/rt5640/HeadsetMic.conf | 48 +++++++++ src/conf/ucm/codecs/rt5640/IN1-InternalMic.conf | 50 +++++++++ src/conf/ucm/codecs/rt5640/IN3-InternalMic.conf | 50 +++++++++ src/conf/ucm/codecs/rt5640/Makefile.am | 5 + src/conf/ucm/codecs/rt5640/MonoSpeaker.conf | 45 ++++++++ src/conf/ucm/codecs/rt5640/Speaker.conf | 45 ++++++++ src/conf/ucm/codecs/rt5651/EnableSeq.conf | 54 ++++++++++ src/conf/ucm/codecs/rt5651/HeadPhones-swapped.conf | 42 ++++++++ src/conf/ucm/codecs/rt5651/HeadPhones.conf | 32 ++++++ src/conf/ucm/codecs/rt5651/IN1-InternalMic.conf | 27 +++++ src/conf/ucm/codecs/rt5651/IN12-InternalMic.conf | 31 ++++++ src/conf/ucm/codecs/rt5651/IN2-InternalMic.conf | 27 +++++ src/conf/ucm/codecs/rt5651/IN3-HeadsetMic.conf | 28 +++++ src/conf/ucm/codecs/rt5651/Makefile.am | 6 ++ src/conf/ucm/codecs/rt5651/MonoSpeaker.conf | 36 +++++++ src/conf/ucm/codecs/rt5651/Speaker.conf | 31 ++++++ .../HiFi.conf | 14 +-- src/conf/ucm/nau8824/EnableSeq.conf | 15 --- src/conf/ucm/nau8824/HeadPhones.conf | 25 ----- src/conf/ucm/nau8824/HeadsetMic.conf | 31 ------ src/conf/ucm/nau8824/InternalMic.conf | 31 ------ src/conf/ucm/nau8824/Makefile.am | 5 - src/conf/ucm/nau8824/MonoSpeaker.conf | 29 ------ src/conf/ucm/nau8824/Speaker.conf | 28 ----- src/conf/ucm/platforms/Makefile.am | 2 + src/conf/ucm/platforms/bytcr/Makefile.am | 4 + .../ucm/platforms/bytcr/PlatformDisableSeq.conf | 20 ++++ .../ucm/platforms/bytcr/PlatformEnableSeq.conf | 115 +++++++++++++++++++++ src/conf/ucm/rt5640/DigitalMics.conf | 31 ------ src/conf/ucm/rt5640/EnableSeq.conf | 41 -------- src/conf/ucm/rt5640/HeadPhones.conf | 41 -------- src/conf/ucm/rt5640/HeadsetMic.conf | 48 --------- src/conf/ucm/rt5640/IN1-InternalMic.conf | 50 --------- src/conf/ucm/rt5640/IN3-InternalMic.conf | 50 --------- src/conf/ucm/rt5640/Makefile.am | 5 - src/conf/ucm/rt5640/MonoSpeaker.conf | 45 -------- src/conf/ucm/rt5640/Speaker.conf | 45 -------- src/conf/ucm/rt5651/EnableSeq.conf | 54 ---------- src/conf/ucm/rt5651/HeadPhones-swapped.conf | 42 -------- src/conf/ucm/rt5651/HeadPhones.conf | 32 ------ src/conf/ucm/rt5651/IN1-InternalMic.conf | 27 ----- src/conf/ucm/rt5651/IN12-InternalMic.conf | 31 ------ src/conf/ucm/rt5651/IN2-InternalMic.conf | 27 ----- src/conf/ucm/rt5651/IN3-HeadsetMic.conf | 28 ----- src/conf/ucm/rt5651/Makefile.am | 6 -- src/conf/ucm/rt5651/MonoSpeaker.conf | 36 ------- src/conf/ucm/rt5651/Speaker.conf | 31 ------ src/ucm/parser.c | 1 + 81 files changed, 1116 insertions(+), 1107 deletions(-) delete mode 100644 src/conf/ucm/bytcr/Makefile.am delete mode 100644 src/conf/ucm/bytcr/PlatformDisableSeq.conf delete mode 100644 src/conf/ucm/bytcr/PlatformEnableSeq.conf create mode 100644 src/conf/ucm/codecs/Makefile.am create mode 100644 src/conf/ucm/codecs/nau8824/EnableSeq.conf create mode 100644 src/conf/ucm/codecs/nau8824/HeadPhones.conf create mode 100644 src/conf/ucm/codecs/nau8824/HeadsetMic.conf create mode 100644 src/conf/ucm/codecs/nau8824/InternalMic.conf create mode 100644 src/conf/ucm/codecs/nau8824/Makefile.am create mode 100644 src/conf/ucm/codecs/nau8824/MonoSpeaker.conf create mode 100644 src/conf/ucm/codecs/nau8824/Speaker.conf create mode 100644 src/conf/ucm/codecs/rt5640/DigitalMics.conf create mode 100644 src/conf/ucm/codecs/rt5640/EnableSeq.conf create mode 100644 src/conf/ucm/codecs/rt5640/HeadPhones.conf create mode 100644 src/conf/ucm/codecs/rt5640/HeadsetMic.conf create mode 100644 src/conf/ucm/codecs/rt5640/IN1-InternalMic.conf create mode 100644 src/conf/ucm/codecs/rt5640/IN3-InternalMic.conf create mode 100644 src/conf/ucm/codecs/rt5640/Makefile.am create mode 100644 src/conf/ucm/codecs/rt5640/MonoSpeaker.conf create mode 100644 src/conf/ucm/codecs/rt5640/Speaker.conf create mode 100644 src/conf/ucm/codecs/rt5651/EnableSeq.conf create mode 100644 src/conf/ucm/codecs/rt5651/HeadPhones-swapped.conf create mode 100644 src/conf/ucm/codecs/rt5651/HeadPhones.conf create mode 100644 src/conf/ucm/codecs/rt5651/IN1-InternalMic.conf create mode 100644 src/conf/ucm/codecs/rt5651/IN12-InternalMic.conf create mode 100644 src/conf/ucm/codecs/rt5651/IN2-InternalMic.conf create mode 100644 src/conf/ucm/codecs/rt5651/IN3-HeadsetMic.conf create mode 100644 src/conf/ucm/codecs/rt5651/Makefile.am create mode 100644 src/conf/ucm/codecs/rt5651/MonoSpeaker.conf create mode 100644 src/conf/ucm/codecs/rt5651/Speaker.conf delete mode 100644 src/conf/ucm/nau8824/EnableSeq.conf delete mode 100644 src/conf/ucm/nau8824/HeadPhones.conf delete mode 100644 src/conf/ucm/nau8824/HeadsetMic.conf delete mode 100644 src/conf/ucm/nau8824/InternalMic.conf delete mode 100644 src/conf/ucm/nau8824/Makefile.am delete mode 100644 src/conf/ucm/nau8824/MonoSpeaker.conf delete mode 100644 src/conf/ucm/nau8824/Speaker.conf create mode 100644 src/conf/ucm/platforms/Makefile.am create mode 100644 src/conf/ucm/platforms/bytcr/Makefile.am create mode 100644 src/conf/ucm/platforms/bytcr/PlatformDisableSeq.conf create mode 100644 src/conf/ucm/platforms/bytcr/PlatformEnableSeq.conf delete mode 100644 src/conf/ucm/rt5640/DigitalMics.conf delete mode 100644 src/conf/ucm/rt5640/EnableSeq.conf delete mode 100644 src/conf/ucm/rt5640/HeadPhones.conf delete mode 100644 src/conf/ucm/rt5640/HeadsetMic.conf delete mode 100644 src/conf/ucm/rt5640/IN1-InternalMic.conf delete mode 100644 src/conf/ucm/rt5640/IN3-InternalMic.conf delete mode 100644 src/conf/ucm/rt5640/Makefile.am delete mode 100644 src/conf/ucm/rt5640/MonoSpeaker.conf delete mode 100644 src/conf/ucm/rt5640/Speaker.conf delete mode 100644 src/conf/ucm/rt5651/EnableSeq.conf delete mode 100644 src/conf/ucm/rt5651/HeadPhones-swapped.conf delete mode 100644 src/conf/ucm/rt5651/HeadPhones.conf delete mode 100644 src/conf/ucm/rt5651/IN1-InternalMic.conf delete mode 100644 src/conf/ucm/rt5651/IN12-InternalMic.conf delete mode 100644 src/conf/ucm/rt5651/IN2-InternalMic.conf delete mode 100644 src/conf/ucm/rt5651/IN3-HeadsetMic.conf delete mode 100644 src/conf/ucm/rt5651/Makefile.am delete mode 100644 src/conf/ucm/rt5651/MonoSpeaker.conf delete mode 100644 src/conf/ucm/rt5651/Speaker.conf diff --git a/configure.ac b/configure.ac index 4c9d860f..d0cab2d6 100644 --- a/configure.ac +++ b/configure.ac @@ -720,7 +720,6 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \ src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/Makefile \ src/conf/ucm/broadwell-rt286/Makefile \ src/conf/ucm/broxton-rt298/Makefile \ - src/conf/ucm/bytcr/Makefile \ src/conf/ucm/bytcr-rt5640/Makefile \ src/conf/ucm/bytcr-rt5640-mono-spk-dmic1-mic/Makefile \ src/conf/ucm/bytcr-rt5640-mono-spk-in1-mic/Makefile \ @@ -747,18 +746,21 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \ src/conf/ucm/HDAudio-Gigabyte-ALC1220DualCodecs/Makefile \ src/conf/ucm/HDAudio-Lenovo-DualCodecs/Makefile \ src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/Makefile \ - src/conf/ucm/nau8824/Makefile \ src/conf/ucm/PandaBoard/Makefile \ src/conf/ucm/PandaBoardES/Makefile \ src/conf/ucm/PAZ00/Makefile \ src/conf/ucm/PIPO-W2S-Defaultstring-CherryTrailCR/Makefile \ - src/conf/ucm/rt5640/Makefile \ - src/conf/ucm/rt5651/Makefile \ src/conf/ucm/SDP4430/Makefile \ src/conf/ucm/skylake-rt286/Makefile \ src/conf/ucm/TECLAST-X80Pro-Defaultstring-CherryTrailCR/Makefile \ src/conf/ucm/tegraalc5632/Makefile \ src/conf/ucm/VEYRON-I2S/Makefile \ + src/conf/ucm/codecs/Makefile \ + src/conf/ucm/codecs/nau8824/Makefile \ + src/conf/ucm/codecs/rt5640/Makefile \ + src/conf/ucm/codecs/rt5651/Makefile \ + src/conf/ucm/platforms/Makefile \ + src/conf/ucm/platforms/bytcr/Makefile \ src/conf/topology/Makefile \ src/conf/topology/broadwell/Makefile \ modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile \ diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am index 7cdc6176..85c15090 100644 --- a/src/conf/ucm/Makefile.am +++ b/src/conf/ucm/Makefile.am @@ -1,8 +1,9 @@ SUBDIRS=\ +codecs \ +platforms \ ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN \ broadwell-rt286 \ broxton-rt298 \ -bytcr \ bytcr-rt5640 \ bytcr-rt5640-mono-spk-dmic1-mic \ bytcr-rt5640-mono-spk-in1-mic \ @@ -29,13 +30,10 @@ gpd-win-pocket-rt5645 \ HDAudio-Gigabyte-ALC1220DualCodecs \ HDAudio-Lenovo-DualCodecs \ LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216 \ -nau8824 \ PandaBoard \ PandaBoardES \ PAZ00 \ PIPO-W2S-Defaultstring-CherryTrailCR \ -rt5640 \ -rt5651 \ SDP4430 \ skylake-rt286 \ TECLAST-X80Pro-Defaultstring-CherryTrailCR \ diff --git a/src/conf/ucm/PIPO-W2S-Defaultstring-CherryTrailCR/HiFi.conf b/src/conf/ucm/PIPO-W2S-Defaultstring-CherryTrailCR/HiFi.conf index 799163db..facc73ac 100644 --- a/src/conf/ucm/PIPO-W2S-Defaultstring-CherryTrailCR/HiFi.conf +++ b/src/conf/ucm/PIPO-W2S-Defaultstring-CherryTrailCR/HiFi.conf @@ -11,18 +11,18 @@ SectionVerb { EnableSequence [ cdev "hw:chtnau8824" - - + + ] DisableSequence [ cdev "hw:chtnau8824" - + ] } - - + + - - + + diff --git a/src/conf/ucm/bytcr-rt5640-mono-spk-dmic1-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5640-mono-spk-dmic1-mic/HiFi.conf index 938b3592..c78cdfb8 100644 --- a/src/conf/ucm/bytcr-rt5640-mono-spk-dmic1-mic/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5640-mono-spk-dmic1-mic/HiFi.conf @@ -6,13 +6,13 @@ SectionVerb { EnableSequence [ cdev "hw:bytcrrt5640" - - + + ] DisableSequence [ cdev "hw:bytcrrt5640" - + ] Value { @@ -21,8 +21,8 @@ SectionVerb { } } - - + + - - + + diff --git a/src/conf/ucm/bytcr-rt5640-mono-spk-in1-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5640-mono-spk-in1-mic/HiFi.conf index f36b245e..34a5d53d 100644 --- a/src/conf/ucm/bytcr-rt5640-mono-spk-in1-mic/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5640-mono-spk-in1-mic/HiFi.conf @@ -6,13 +6,13 @@ SectionVerb { EnableSequence [ cdev "hw:bytcrrt5640" - - + + ] DisableSequence [ cdev "hw:bytcrrt5640" - + ] Value { @@ -21,8 +21,8 @@ SectionVerb { } } - - + + - - + + diff --git a/src/conf/ucm/bytcr-rt5640-mono-spk-in3-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5640-mono-spk-in3-mic/HiFi.conf index 1a08eded..0aa0c026 100644 --- a/src/conf/ucm/bytcr-rt5640-mono-spk-in3-mic/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5640-mono-spk-in3-mic/HiFi.conf @@ -6,13 +6,13 @@ SectionVerb { EnableSequence [ cdev "hw:bytcrrt5640" - - + + ] DisableSequence [ cdev "hw:bytcrrt5640" - + ] Value { @@ -21,8 +21,8 @@ SectionVerb { } } - - + + - - + + diff --git a/src/conf/ucm/bytcr-rt5640-stereo-spk-dmic1-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5640-stereo-spk-dmic1-mic/HiFi.conf index 4587b2e1..e358d4f2 100644 --- a/src/conf/ucm/bytcr-rt5640-stereo-spk-dmic1-mic/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5640-stereo-spk-dmic1-mic/HiFi.conf @@ -6,13 +6,13 @@ SectionVerb { EnableSequence [ cdev "hw:bytcrrt5640" - - + + ] DisableSequence [ cdev "hw:bytcrrt5640" - + ] Value { @@ -21,8 +21,8 @@ SectionVerb { } } - - + + - - + + diff --git a/src/conf/ucm/bytcr-rt5640-stereo-spk-in1-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5640-stereo-spk-in1-mic/HiFi.conf index decd3960..097560d0 100644 --- a/src/conf/ucm/bytcr-rt5640-stereo-spk-in1-mic/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5640-stereo-spk-in1-mic/HiFi.conf @@ -6,13 +6,13 @@ SectionVerb { EnableSequence [ cdev "hw:bytcrrt5640" - - + + ] DisableSequence [ cdev "hw:bytcrrt5640" - + ] Value { @@ -21,8 +21,8 @@ SectionVerb { } } - - + + - - + + diff --git a/src/conf/ucm/bytcr-rt5640-stereo-spk-in3-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5640-stereo-spk-in3-mic/HiFi.conf index d243bf82..8a018f63 100644 --- a/src/conf/ucm/bytcr-rt5640-stereo-spk-in3-mic/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5640-stereo-spk-in3-mic/HiFi.conf @@ -6,13 +6,13 @@ SectionVerb { EnableSequence [ cdev "hw:bytcrrt5640" - - + + ] DisableSequence [ cdev "hw:bytcrrt5640" - + ] Value { @@ -21,8 +21,8 @@ SectionVerb { } } - - + + - - + + diff --git a/src/conf/ucm/bytcr-rt5640/HiFi.conf b/src/conf/ucm/bytcr-rt5640/HiFi.conf index c833fe74..20ebe2dd 100644 --- a/src/conf/ucm/bytcr-rt5640/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5640/HiFi.conf @@ -6,13 +6,13 @@ SectionVerb { EnableSequence [ cdev "hw:bytcrrt5640" - - + + ] DisableSequence [ cdev "hw:bytcrrt5640" - + ] Value { @@ -21,11 +21,11 @@ SectionVerb { } } - - - + + + - - - - + + + + diff --git a/src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/HiFi.conf index dd5b35fc..ca8a7d90 100644 --- a/src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/HiFi.conf @@ -5,13 +5,13 @@ SectionVerb { EnableSequence [ cdev "hw:bytcrrt5651" - - + + ] DisableSequence [ cdev "hw:bytcrrt5651" - + ] Value { @@ -20,8 +20,8 @@ SectionVerb { } } - - + + - - + + diff --git a/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/HiFi.conf b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/HiFi.conf index 777ed783..60ef6b33 100644 --- a/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/HiFi.conf @@ -5,13 +5,13 @@ SectionVerb { EnableSequence [ cdev "hw:bytcrrt5651" - - + + ] DisableSequence [ cdev "hw:bytcrrt5651" - + ] Value { @@ -20,8 +20,8 @@ SectionVerb { } } - - + + - - + + diff --git a/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/HiFi.conf index 9f56c077..e75210d4 100644 --- a/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/HiFi.conf @@ -5,13 +5,13 @@ SectionVerb { EnableSequence [ cdev "hw:bytcrrt5651" - - + + ] DisableSequence [ cdev "hw:bytcrrt5651" - + ] Value { @@ -20,8 +20,8 @@ SectionVerb { } } - - + + - - + + diff --git a/src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/HiFi.conf index e2a579ab..2b7675bc 100644 --- a/src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/HiFi.conf @@ -5,13 +5,13 @@ SectionVerb { EnableSequence [ cdev "hw:bytcrrt5651" - - + + ] DisableSequence [ cdev "hw:bytcrrt5651" - + ] Value { @@ -20,8 +20,8 @@ SectionVerb { } } - - + + - - + + diff --git a/src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/HiFi.conf index ae52e719..7a8c94bc 100644 --- a/src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/HiFi.conf @@ -5,13 +5,13 @@ SectionVerb { EnableSequence [ cdev "hw:bytcrrt5651" - - + + ] DisableSequence [ cdev "hw:bytcrrt5651" - + ] Value { @@ -20,8 +20,8 @@ SectionVerb { } } - - + + - - + + diff --git a/src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/HiFi.conf index a73ff5f8..45c7837c 100644 --- a/src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/HiFi.conf @@ -5,13 +5,13 @@ SectionVerb { EnableSequence [ cdev "hw:bytcrrt5651" - - + + ] DisableSequence [ cdev "hw:bytcrrt5651" - + ] Value { @@ -20,8 +20,8 @@ SectionVerb { } } - - + + - - + + diff --git a/src/conf/ucm/bytcr-rt5651/HiFi.conf b/src/conf/ucm/bytcr-rt5651/HiFi.conf index 8733403c..d3928e9b 100644 --- a/src/conf/ucm/bytcr-rt5651/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5651/HiFi.conf @@ -5,13 +5,13 @@ SectionVerb { EnableSequence [ cdev "hw:bytcrrt5651" - - + + ] DisableSequence [ cdev "hw:bytcrrt5651" - + ] Value { @@ -20,11 +20,11 @@ SectionVerb { } } - - - + + + - - - - + + + + diff --git a/src/conf/ucm/bytcr/Makefile.am b/src/conf/ucm/bytcr/Makefile.am deleted file mode 100644 index f7a54cbd..00000000 --- a/src/conf/ucm/bytcr/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -alsaconfigdir = @ALSA_CONFIG_DIR@ -ucmdir = $(alsaconfigdir)/ucm/bytcr -ucm_DATA = PlatformEnableSeq.conf PlatformDisableSeq.conf -EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/bytcr/PlatformDisableSeq.conf b/src/conf/ucm/bytcr/PlatformDisableSeq.conf deleted file mode 100644 index 9bb018bc..00000000 --- a/src/conf/ucm/bytcr/PlatformDisableSeq.conf +++ /dev/null @@ -1,20 +0,0 @@ -# disable audio output path -cset "name='codec_out0 mix 0 pcm0_in Switch' off" -cset "name='modem_out mix 0 pcm0_in Switch' off" - -cset "name='media0_out mix 0 media0_in Switch' off" -cset "name='media0_out mix 0 media1_in Switch' off" -cset "name='media0_out mix 0 media3_in Switch' off" - -cset "name='media0_in Gain 0 Switch' off" -cset "name='media1_in Gain 0 Switch' off" -cset "name='media3_in Gain 0 Switch' off" - -cset "name='pcm0_in Gain 0 Switch' off" -cset "name='codec_out0 Gain 0 Switch' off" -cset "name='modem_out Gain 0 Switch' off" - -# disable audio input path -cset "name='pcm1_out Gain 0 Switch' off" -cset "name='codec_in0 Gain 0 Switch' off" -cset "name='modem_in Gain 0 Switch' off" diff --git a/src/conf/ucm/bytcr/PlatformEnableSeq.conf b/src/conf/ucm/bytcr/PlatformEnableSeq.conf deleted file mode 100644 index b5ee2b41..00000000 --- a/src/conf/ucm/bytcr/PlatformEnableSeq.conf +++ /dev/null @@ -1,115 +0,0 @@ -# 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 (used if SSP2 is connected) -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" - -# modem_out settings (used if SSP0 is connected) -cset "name='modem_out mix 0 codec_in0 Switch' off" -cset "name='modem_out mix 0 codec_in1 Switch' off" -cset "name='modem_out mix 0 media_loop1_in Switch' off" -cset "name='modem_out mix 0 media_loop2_in Switch' off" -cset "name='modem_out mix 0 pcm0_in Switch' on" -cset "name='modem_out mix 0 pcm1_in Switch' off" -cset "name='modem_out mix 0 sprot_loop_in Switch' off" -cset "name='modem_out Gain 0 Switch' on" -cset "name='modem_out Gain 0 Volume' 0" - -# input settings - -# input used when SSP2 is connected -cset "name='codec_in0 Gain 0 Switch' on" -cset "name='codec_in0 Gain 0 Volume' 0" - -# input used when SSP0 is connected -cset "name='modem_in Gain 0 Switch' on" -cset "name='modem_in Gain 0 Volume' 0" - -# pcm1_out settings -cset "name='pcm1_out mix 0 codec_in0 Switch' on" -cset "name='pcm1_out mix 0 modem_in 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" diff --git a/src/conf/ucm/chtnau8824/HiFi.conf b/src/conf/ucm/chtnau8824/HiFi.conf index dc52800e..97a7ac7b 100644 --- a/src/conf/ucm/chtnau8824/HiFi.conf +++ b/src/conf/ucm/chtnau8824/HiFi.conf @@ -11,18 +11,18 @@ SectionVerb { EnableSequence [ cdev "hw:chtnau8824" - - + + ] DisableSequence [ cdev "hw:chtnau8824" - + ] } - - + + - - + + diff --git a/src/conf/ucm/chtrt5645/HiFi.conf b/src/conf/ucm/chtrt5645/HiFi.conf index d993f6ae..6a3c6875 100644 --- a/src/conf/ucm/chtrt5645/HiFi.conf +++ b/src/conf/ucm/chtrt5645/HiFi.conf @@ -1,3 +1,5 @@ + + SectionVerb { # ALSA PCM Value { @@ -11,7 +13,7 @@ SectionVerb { EnableSequence [ cdev "hw:chtrt5645" - + # Output Configuration cset "name='DAC1 L Mux' IF1 DAC" diff --git a/src/conf/ucm/codecs/Makefile.am b/src/conf/ucm/codecs/Makefile.am new file mode 100644 index 00000000..2b374acb --- /dev/null +++ b/src/conf/ucm/codecs/Makefile.am @@ -0,0 +1,4 @@ +SUBDIRS=\ +rt5640 \ +rt5651 \ +nau8824 diff --git a/src/conf/ucm/codecs/nau8824/EnableSeq.conf b/src/conf/ucm/codecs/nau8824/EnableSeq.conf new file mode 100644 index 00000000..05f5f0b4 --- /dev/null +++ b/src/conf/ucm/codecs/nau8824/EnableSeq.conf @@ -0,0 +1,15 @@ +# Playback TDM configuration +cset "name='DACL Channel Source' 0" +cset "name='DACR Channel Source' 1" +# Input Configuration +cset "name='DMIC1 Enable Switch' off" +cset "name='DMIC2 Enable Switch' off" +cset "name='DMIC3 Enable Switch' off" +cset "name='DMIC4 Enable Switch' off" +cset "name='MIC1 Volume' 10" +cset "name='MIC2 Volume' 10" +# Button Configuration +cset "name='THD for key media' 10" +cset "name='THD for key voice command' 16" +cset "name='THD for key volume up' 38" +cset "name='THD for key volume down' 115" diff --git a/src/conf/ucm/codecs/nau8824/HeadPhones.conf b/src/conf/ucm/codecs/nau8824/HeadPhones.conf new file mode 100644 index 00000000..8ed6f194 --- /dev/null +++ b/src/conf/ucm/codecs/nau8824/HeadPhones.conf @@ -0,0 +1,25 @@ +SectionDevice."Headphones" { + Comment "Headphones" + + Value { + PlaybackChannels "2" + JackControl "Headphone Jack" + } + + ConflictingDevice [ + "MonoSpeaker" + "Speaker" + ] + + EnableSequence [ + cdev "hw:chtnau8824" + + cset "name='Headphone Switch' on" + ] + + DisableSequence [ + cdev "hw:chtnau8824" + + cset "name='Headphone Switch' off" + ] +} diff --git a/src/conf/ucm/codecs/nau8824/HeadsetMic.conf b/src/conf/ucm/codecs/nau8824/HeadsetMic.conf new file mode 100644 index 00000000..11b0b52a --- /dev/null +++ b/src/conf/ucm/codecs/nau8824/HeadsetMic.conf @@ -0,0 +1,31 @@ +SectionDevice."HeadsetMic" { + Comment "Headset Microphone" + + Value { + CaptureChannels "2" + JackControl "Headset Mic Jack" + } + + ConflictingDevice [ + "InternalMic" + ] + + EnableSequence [ + cdev "hw:chtnau8824" + + cset "name='ADC CH0 Select' 1" + cset "name='ADC CH1 Select' 1" + + cset "name='Headset Mic Switch' on" + cset "name='Right ADC HSMIC Switch' on" + cset "name='Left ADC HSMIC Switch' on" + ] + + DisableSequence [ + cdev "hw:chtnau8824" + + cset "name='Headset Mic Switch' off" + cset "name='Right ADC HSMIC Switch' off" + cset "name='Left ADC HSMIC Switch' off" + ] +} diff --git a/src/conf/ucm/codecs/nau8824/InternalMic.conf b/src/conf/ucm/codecs/nau8824/InternalMic.conf new file mode 100644 index 00000000..c6a741cc --- /dev/null +++ b/src/conf/ucm/codecs/nau8824/InternalMic.conf @@ -0,0 +1,31 @@ +SectionDevice."InternalMic" { + Comment "Internal Microphone" + + Value { + CaptureChannels "2" + CapturePriority "150" + } + + ConflictingDevice [ + "HeadsetMic" + ] + + EnableSequence [ + cdev "hw:chtnau8824" + + cset "name='ADC CH0 Select' 0" + cset "name='ADC CH1 Select' 0" + + cset "name='Int Mic Switch' on" + cset "name='Right ADC MIC Switch' on" + cset "name='Left ADC MIC Switch' on" + ] + + DisableSequence [ + cdev "hw:chtnau8824" + + cset "name='Int Mic Switch' off" + cset "name='Right ADC MIC Switch' off" + cset "name='Left ADC MIC Switch' off" + ] +} diff --git a/src/conf/ucm/codecs/nau8824/Makefile.am b/src/conf/ucm/codecs/nau8824/Makefile.am new file mode 100644 index 00000000..fd3bafe1 --- /dev/null +++ b/src/conf/ucm/codecs/nau8824/Makefile.am @@ -0,0 +1,5 @@ +alsaconfigdir = @ALSA_CONFIG_DIR@ +ucmdir = $(alsaconfigdir)/ucm/codecs/nau8824 +ucm_DATA = EnableSeq.conf HeadPhones.conf HeadsetMic.conf InternalMic.conf \ + MonoSpeaker.conf Speaker.conf +EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/codecs/nau8824/MonoSpeaker.conf b/src/conf/ucm/codecs/nau8824/MonoSpeaker.conf new file mode 100644 index 00000000..86735181 --- /dev/null +++ b/src/conf/ucm/codecs/nau8824/MonoSpeaker.conf @@ -0,0 +1,29 @@ +SectionDevice."MonoSpeaker" { + Comment "Mono Speaker" + + Value { + PlaybackChannels "2" + } + + ConflictingDevice [ + "Speaker" + "Headphones" + ] + + EnableSequence [ + cdev "hw:chtnau8824" + + # nau8824 mono speaker boards have the speaker on the right chan + cset "name='Speaker Left DACL Volume' 0" + cset "name='Speaker Left DACR Volume' 0" + cset "name='Speaker Right DACL Volume' 1" + cset "name='Speaker Right DACR Volume' 1" + cset "name='Ext Spk Switch' on" + ] + + DisableSequence [ + cdev "hw:chtnau8824" + + cset "name='Ext Spk Switch' off" + ] +} diff --git a/src/conf/ucm/codecs/nau8824/Speaker.conf b/src/conf/ucm/codecs/nau8824/Speaker.conf new file mode 100644 index 00000000..e4d25b08 --- /dev/null +++ b/src/conf/ucm/codecs/nau8824/Speaker.conf @@ -0,0 +1,28 @@ +SectionDevice."Speaker" { + Comment "Speaker" + + Value { + PlaybackChannels "2" + } + + ConflictingDevice [ + "MonoSpeaker" + "Headphones" + ] + + EnableSequence [ + cdev "hw:chtnau8824" + + cset "name='Speaker Left DACL Volume' 1" + cset "name='Speaker Left DACR Volume' 0" + cset "name='Speaker Right DACL Volume' 0" + cset "name='Speaker Right DACR Volume' 1" + cset "name='Ext Spk Switch' on" + ] + + DisableSequence [ + cdev "hw:chtnau8824" + + cset "name='Ext Spk Switch' off" + ] +} diff --git a/src/conf/ucm/codecs/rt5640/DigitalMics.conf b/src/conf/ucm/codecs/rt5640/DigitalMics.conf new file mode 100644 index 00000000..06b42f16 --- /dev/null +++ b/src/conf/ucm/codecs/rt5640/DigitalMics.conf @@ -0,0 +1,31 @@ +SectionDevice."DigitalMics" { + Comment "Internal Digital Microphones" + + ConflictingDevice [ + "IN1-InternalMics" + "IN3-InternalMics" + "HeadsetMic" + ] + + EnableSequence [ + cdev "hw:bytcrrt5640" + + cset "name='Stereo ADC MIXL ADC2 Switch' on" + cset "name='Stereo ADC MIXR ADC2 Switch' on" + cset "name='Internal Mic Switch' on" + + ] + + DisableSequence [ + cdev "hw:bytcrrt5640" + + cset "name='Stereo ADC MIXL ADC2 Switch' off" + cset "name='Stereo ADC MIXR ADC2 Switch' off" + cset "name='Internal Mic Switch' off" + + ] + + Value { + CaptureChannels 2 + } +} diff --git a/src/conf/ucm/codecs/rt5640/EnableSeq.conf b/src/conf/ucm/codecs/rt5640/EnableSeq.conf new file mode 100644 index 00000000..62795fa6 --- /dev/null +++ b/src/conf/ucm/codecs/rt5640/EnableSeq.conf @@ -0,0 +1,41 @@ +# RT5640 default output routing +cset "name='OUT MIXL DAC L1 Switch' on" +cset "name='OUT MIXR DAC R1 Switch' on" + +# uncomment for loopback mic->speakers +# cset "name='SPOL MIX BST1 Switch' on" +# cset "name='SPOR MIX BST1 Switch' on" + +# uncomment for loopback playback -> capture +# cset "name='RECMIXL OUT MIXL Switch' on" +# cset "name='RECMIXR OUT MIXR Switch' on" + +# uncomment to enable swap between AIF1 and AIF2 +# warning: can only work with SSP0 firmware enabled +cset "name='SDI select' 0" +cset "name='DAI select' 0" +#cset "name='SDI select' 1" +#cset "name='DAI select' 1" + +cset "name='DAC2 Playback Switch' on" +cset "name='DIG MIXL DAC L2 Switch' on" + +# Input Configuration +cset "name='Stereo ADC1 Mux' ADC" +cset "name='Stereo ADC2 Mux' DMIC1" +cset "name='Mono ADC L1 Mux' 1" +cset "name='Mono ADC R1 Mux' 1" + +# 47=0dB, 0.375 dB/step, set it to 6 dB to help with soft mics +cset "name='ADC Capture Volume' 63" +# Set ADC Boost Gain to 3dB higher vals result in too much noise +cset "name='ADC Boost Gain' 1" +# Set IN1/IN3 internal mic boost to 8 (max) +# Set IN2 headset-mic boost to 1, headset mics are quite loud +cset "name='IN1 Boost' 8" +cset "name='IN2 Boost' 1" +cset "name='IN3 Boost' 8" + +cset "name='Internal Mic Switch' off" +cset "name='Headset Mic Switch' off" +cset "name='ADC Capture Switch' on" diff --git a/src/conf/ucm/codecs/rt5640/HeadPhones.conf b/src/conf/ucm/codecs/rt5640/HeadPhones.conf new file mode 100644 index 00000000..38f37a6f --- /dev/null +++ b/src/conf/ucm/codecs/rt5640/HeadPhones.conf @@ -0,0 +1,41 @@ +SectionDevice."Headphones" { + Comment "Headphones" + + ConflictingDevice [ + "Speaker" + "MonoSpeaker" + ] + + EnableSequence [ + cdev "hw:bytcrrt5640" + + cset "name='DAC MIXL INF1 Switch' on" + cset "name='DAC MIXR INF1 Switch' on" + cset "name='Stereo DAC MIXL DAC L1 Switch' on" + cset "name='Stereo DAC MIXR DAC R1 Switch' on" + cset "name='Stereo DAC MIXL DAC L2 Switch' on" + cset "name='Stereo DAC MIXR DAC R2 Switch' on" + cset "name='HPO MIX HPVOL Switch' on" + cset "name='Headphone Switch' on" + cset "name='HP Channel Switch' on" + cset "name='Speaker Switch' off" + cset "name='HP L Playback Switch' on" + cset "name='HP R Playback Switch' on" + cset "name='HP Playback Volume' 29" + + ] + + DisableSequence [ + cdev "hw:bytcrrt5640" + cset "name='Headphone Switch' off" + cset "name='HP Channel Switch' off" + cset "name='HP L Playback Switch' off" + cset "name='HP R Playback Switch' off" + cset "name='HP Playback Volume' 0" + ] + + Value { + PlaybackChannels "2" + JackControl "Headphone Jack" + } +} diff --git a/src/conf/ucm/codecs/rt5640/HeadsetMic.conf b/src/conf/ucm/codecs/rt5640/HeadsetMic.conf new file mode 100644 index 00000000..567d4122 --- /dev/null +++ b/src/conf/ucm/codecs/rt5640/HeadsetMic.conf @@ -0,0 +1,48 @@ +SectionDevice."HeadsetMic" { + Comment "Headset Microphone" + + ConflictingDevice [ + "IN1-InternalMics" + "IN3-InternalMics" + "DigitalMics" + ] + + EnableSequence [ + cdev "hw:bytcrrt5640" + + cset "name='Headset Mic Switch' on" + + cset "name='RECMIXL BST2 Switch' on" + cset "name='RECMIXR BST2 Switch' on" + + cset "name='Stereo ADC MIXL ADC1 Switch' on" + cset "name='Stereo ADC MIXR ADC1 Switch' on" + + cset "name='Mono ADC MIXL ADC1 Switch' on" + cset "name='Mono ADC MIXR ADC1 Switch' on" + + cset "name='Mono ADC Capture Switch' on" + ] + + DisableSequence [ + cdev "hw:bytcrrt5640" + + cset "name='Stereo ADC MIXL ADC1 Switch' off" + cset "name='Stereo ADC MIXR ADC1 Switch' off" + + cset "name='RECMIXL BST2 Switch' off" + cset "name='RECMIXR BST2 Switch' off" + + cset "name='Headset Mic Switch' off" + + cset "name='Mono ADC MIXL ADC1 Switch' off" + cset "name='Mono ADC MIXR ADC1 Switch' off" + + cset "name='Mono ADC Capture Switch' off" + ] + + Value { + CaptureChannels 2 + JackControl "Headset Mic Jack" + } +} diff --git a/src/conf/ucm/codecs/rt5640/IN1-InternalMic.conf b/src/conf/ucm/codecs/rt5640/IN1-InternalMic.conf new file mode 100644 index 00000000..3bf31e64 --- /dev/null +++ b/src/conf/ucm/codecs/rt5640/IN1-InternalMic.conf @@ -0,0 +1,50 @@ +SectionDevice."IN1-InternalMics" { + Comment "Internal Microphone on IN1" + + ConflictingDevice [ + "DigitalMics" + "HeadsetMic" + "IN3-InternalMics" + ] + + EnableSequence [ + cdev "hw:bytcrrt5640" + + cset "name='Internal Mic Switch' on" + + cset "name='RECMIXL BST1 Switch' on" + cset "name='RECMIXR BST1 Switch' on" + cset "name='RECMIXL BST3 Switch' off" + cset "name='RECMIXR BST3 Switch' off" + + cset "name='Stereo ADC MIXL ADC1 Switch' on" + cset "name='Stereo ADC MIXR ADC1 Switch' on" + + cset "name='Mono ADC MIXL ADC1 Switch' on" + cset "name='Mono ADC MIXR ADC1 Switch' on" + + cset "name='Mono ADC Capture Switch' on" + ] + + DisableSequence [ + cdev "hw:bytcrrt5640" + + cset "name='Stereo ADC MIXL ADC1 Switch' off" + cset "name='Stereo ADC MIXR ADC1 Switch' off" + + cset "name='RECMIXL BST1 Switch' off" + cset "name='RECMIXR BST1 Switch' off" + + cset "name='Internal Mic Switch' off" + + cset "name='Mono ADC MIXL ADC1 Switch' off" + cset "name='Mono ADC MIXR ADC1 Switch' off" + + cset "name='Mono ADC Capture Switch' off" + + ] + + Value { + CaptureChannels 2 + } +} diff --git a/src/conf/ucm/codecs/rt5640/IN3-InternalMic.conf b/src/conf/ucm/codecs/rt5640/IN3-InternalMic.conf new file mode 100644 index 00000000..e1a6c49b --- /dev/null +++ b/src/conf/ucm/codecs/rt5640/IN3-InternalMic.conf @@ -0,0 +1,50 @@ +SectionDevice."IN3-InternalMics" { + Comment "Internal Microphone on IN3" + + ConflictingDevice [ + "DigitalMics" + "HeadsetMic" + "IN1-InternalMics" + ] + + EnableSequence [ + cdev "hw:bytcrrt5640" + + cset "name='Internal Mic Switch' on" + + cset "name='RECMIXL BST1 Switch' off" + cset "name='RECMIXR BST1 Switch' off" + cset "name='RECMIXL BST3 Switch' on" + cset "name='RECMIXR BST3 Switch' on" + + cset "name='Stereo ADC MIXL ADC1 Switch' on" + cset "name='Stereo ADC MIXR ADC1 Switch' on" + + cset "name='Mono ADC MIXL ADC1 Switch' on" + cset "name='Mono ADC MIXR ADC1 Switch' on" + + cset "name='Mono ADC Capture Switch' on" + + ] + + DisableSequence [ + cdev "hw:bytcrrt5640" + + cset "name='Stereo ADC MIXL ADC1 Switch' off" + cset "name='Stereo ADC MIXR ADC1 Switch' off" + + cset "name='RECMIXL BST3 Switch' off" + cset "name='RECMIXR BST3 Switch' off" + + cset "name='Internal Mic Switch' off" + + cset "name='Mono ADC MIXL ADC1 Switch' off" + cset "name='Mono ADC MIXR ADC1 Switch' off" + + cset "name='Mono ADC Capture Switch' off" + ] + + Value { + CaptureChannels 2 + } +} diff --git a/src/conf/ucm/codecs/rt5640/Makefile.am b/src/conf/ucm/codecs/rt5640/Makefile.am new file mode 100644 index 00000000..80fa8cfc --- /dev/null +++ b/src/conf/ucm/codecs/rt5640/Makefile.am @@ -0,0 +1,5 @@ +alsaconfigdir = @ALSA_CONFIG_DIR@ +ucmdir = $(alsaconfigdir)/ucm/codecs/rt5640 +ucm_DATA = DigitalMics.conf EnableSeq.conf HeadPhones.conf HeadsetMic.conf \ + IN1-InternalMic.conf IN3-InternalMic.conf MonoSpeaker.conf Speaker.conf +EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/codecs/rt5640/MonoSpeaker.conf b/src/conf/ucm/codecs/rt5640/MonoSpeaker.conf new file mode 100644 index 00000000..58ab7807 --- /dev/null +++ b/src/conf/ucm/codecs/rt5640/MonoSpeaker.conf @@ -0,0 +1,45 @@ +SectionDevice."MonoSpeaker" { + Comment "Mono Speaker" + + ConflictingDevice [ + "Headphones" + "Speaker" + ] + + EnableSequence [ + cdev "hw:bytcrrt5640" + + cset "name='DAC MIXL INF1 Switch' on" + cset "name='DAC MIXR INF1 Switch' on" + cset "name='Stereo DAC MIXL DAC L1 Switch' on" + cset "name='Stereo DAC MIXR DAC R1 Switch' on" + cset "name='Stereo DAC MIXL DAC L2 Switch' on" + cset "name='Stereo DAC MIXR DAC R2 Switch' on" + cset "name='SPK MIXL DAC L1 Switch' on" + cset "name='SPK MIXR DAC R1 Switch' on" + cset "name='SPOL MIX SPKVOL L Switch' on" +# for mono speaker we apply left on right +# cset "name='SPOR MIX SPKVOL R Switch' on" + cset "name='SPOL MIX SPKVOL R Switch' on" + cset "name='Speaker Switch' on" + cset "name='Speaker Channel Switch' on" + cset "name='Headphone Switch' off" + cset "name='Speaker L Playback Switch' on" + cset "name='Speaker R Playback Switch' on" + cset "name='Speaker Playback Volume' 35" + + ] + + DisableSequence [ + cdev "hw:bytcrrt5640" + cset "name='Speaker Switch' off" + cset "name='Speaker Channel Switch' off" + cset "name='Speaker L Playback Switch' off" + cset "name='Speaker R Playback Switch' off" + cset "name='Speaker Playback Volume' 0" + ] + + Value { + PlaybackChannels "2" + } +} diff --git a/src/conf/ucm/codecs/rt5640/Speaker.conf b/src/conf/ucm/codecs/rt5640/Speaker.conf new file mode 100644 index 00000000..a7df9fbf --- /dev/null +++ b/src/conf/ucm/codecs/rt5640/Speaker.conf @@ -0,0 +1,45 @@ +SectionDevice."Speaker" { + Comment "Speakers" + + ConflictingDevice [ + "Headphones" + "MonoSpeaker" + ] + + EnableSequence [ + cdev "hw:bytcrrt5640" + + cset "name='DAC MIXL INF1 Switch' on" + cset "name='DAC MIXR INF1 Switch' on" + cset "name='Stereo DAC MIXL DAC L1 Switch' on" + cset "name='Stereo DAC MIXR DAC R1 Switch' on" + cset "name='Stereo DAC MIXL DAC L2 Switch' on" + cset "name='Stereo DAC MIXR DAC R2 Switch' on" + cset "name='SPK MIXL DAC L1 Switch' on" + cset "name='SPK MIXR DAC R1 Switch' on" + cset "name='SPOL MIX SPKVOL L Switch' on" + cset "name='SPOR MIX SPKVOL R Switch' on" + # undo MonoSpeaker mixing of right channel to left speaker + cset "name='SPOL MIX SPKVOL R Switch' off" + cset "name='Speaker Switch' on" + cset "name='Speaker Channel Switch' on" + cset "name='Headphone Switch' off" + cset "name='Speaker L Playback Switch' on" + cset "name='Speaker R Playback Switch' on" + cset "name='Speaker Playback Volume' 35" + + ] + + DisableSequence [ + cdev "hw:bytcrrt5640" + cset "name='Speaker Switch' off" + cset "name='Speaker Channel Switch' off" + cset "name='Speaker L Playback Switch' off" + cset "name='Speaker R Playback Switch' off" + cset "name='Speaker Playback Volume' 0" + ] + + Value { + PlaybackChannels "2" + } +} diff --git a/src/conf/ucm/codecs/rt5651/EnableSeq.conf b/src/conf/ucm/codecs/rt5651/EnableSeq.conf new file mode 100644 index 00000000..6fb3c1f2 --- /dev/null +++ b/src/conf/ucm/codecs/rt5651/EnableSeq.conf @@ -0,0 +1,54 @@ +# default state +cset "name='HPO MIX DAC1 Switch' on" +cset "name='HPO MIX HPVOL Switch' off" +cset "name='HPO L Playback Switch' off" +cset "name='HPO R Playback Switch' off" +cset "name='HPOVOL L Switch' on" +cset "name='HPOVOL R Switch' on" +cset "name='LOUT MIX DAC L1 Switch' on" +cset "name='LOUT MIX DAC R1 Switch' on" +cset "name='IF1 ASRC Switch' on" +cset "name='LOUT L Playback Switch' off" +cset "name='LOUT R Playback Switch' off" +cset "name='Stereo DAC MIXL DAC L1 Switch' on" +cset "name='Stereo DAC MIXL DAC R1 Switch' off" +cset "name='Stereo DAC MIXR DAC L1 Switch' off" +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" + +# volumes +cset "name='OUT Playback Volume' 31" +cset "name='HP Playback Volume' 31" +cset "name='DAC1 Playback Volume' 175" +cset "name='IN Capture Volume' 23" +# 47=0dB, 0.375 dB/step, set it to 6 dB to help with soft mics +cset "name='ADC Capture Volume' 63" +cset "name='ADC Capture Switch' on" +# Set ADC Boost Gain to 3dB higher vals result in too much noise +cset "name='ADC Boost Gain' 1" +# Set IN1, IN2 and IN3 internal mic boost to 1 +cset "name='IN1 Boost' 1" +cset "name='IN2 Boost' 1" +cset "name='IN3 Boost' 1" + +# 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" +cset "name='Headset Mic Switch' off" +cset "name='Internal Mic Switch' off" +cset "name='Line In Switch' off" diff --git a/src/conf/ucm/codecs/rt5651/HeadPhones-swapped.conf b/src/conf/ucm/codecs/rt5651/HeadPhones-swapped.conf new file mode 100644 index 00000000..e79b40a7 --- /dev/null +++ b/src/conf/ucm/codecs/rt5651/HeadPhones-swapped.conf @@ -0,0 +1,42 @@ +SectionDevice."Headphones" { + Comment "Headphones" + + ConflictingDevice [ + "Speaker" + "MonoSpeaker" + ] + + EnableSequence [ + cdev "hw:bytcrrt5651" + + # Swap left and right + cset "name='Stereo DAC MIXL DAC R1 Switch' on" + cset "name='Stereo DAC MIXL DAC L1 Switch' off" + cset "name='Stereo DAC MIXR DAC L1 Switch' on" + cset "name='Stereo DAC MIXR DAC R1 Switch' off" + + cset "name='Headphone Switch' on" + cset "name='HPO L Playback Switch' on" + cset "name='HPO R Playback Switch' on" + # Done after turning the HP on to keep the bias and clk on + cset "name='Speaker Switch' off" + cset "name='LOUT L Playback Switch' off" + cset "name='LOUT R Playback Switch' off" + ] + + DisableSequence [ + cdev "hw:bytcrrt5651" + # Disabling the HP switches is done by the Speaker EnableSeq + + # Unswap left and right + cset "name='Stereo DAC MIXL DAC L1 Switch' on" + cset "name='Stereo DAC MIXL DAC R1 Switch' off" + cset "name='Stereo DAC MIXR DAC R1 Switch' on" + cset "name='Stereo DAC MIXR DAC L1 Switch' off" + ] + + Value { + PlaybackChannels "2" + JackControl "Headphone Jack" + } +} diff --git a/src/conf/ucm/codecs/rt5651/HeadPhones.conf b/src/conf/ucm/codecs/rt5651/HeadPhones.conf new file mode 100644 index 00000000..eaf5fdfc --- /dev/null +++ b/src/conf/ucm/codecs/rt5651/HeadPhones.conf @@ -0,0 +1,32 @@ +SectionDevice."Headphones" { + Comment "Headphones" + + ConflictingDevice [ + "Speaker" + "MonoSpeaker" + ] + + EnableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Headphone Switch' on" + cset "name='HPO L Playback Switch' on" + cset "name='HPO R Playback Switch' on" + # Done after turning the HP on to keep the bias and clk on + cset "name='Speaker Switch' off" + cset "name='LOUT L Playback Switch' off" + cset "name='LOUT R Playback Switch' off" + ] + + DisableSequence [ + cdev "hw:bytcrrt5651" + # This is done by the Speaker EnableSequence, so that the + # Platform Clock and BIAS do not temporarily get turned off + # as that breaks audio-streams which are playing when + # switching between Speaker/Headphone + ] + + Value { + PlaybackChannels "2" + JackControl "Headphone Jack" + } +} diff --git a/src/conf/ucm/codecs/rt5651/IN1-InternalMic.conf b/src/conf/ucm/codecs/rt5651/IN1-InternalMic.conf new file mode 100644 index 00000000..85e25a5c --- /dev/null +++ b/src/conf/ucm/codecs/rt5651/IN1-InternalMic.conf @@ -0,0 +1,27 @@ +SectionDevice."InternalMic-IN1" { + Comment "Internal Microphone on IN1" + + ConflictingDevice [ + "InternalMic-IN2" + "InternalMic-IN12" + "HeadsetMic-IN3" + ] + + EnableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Internal Mic Switch' on" + cset "name='RECMIXL BST1 Switch' on" + cset "name='RECMIXR BST1 Switch' on" + ] + + DisableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Internal Mic Switch' off" + cset "name='RECMIXL BST1 Switch' off" + cset "name='RECMIXR BST1 Switch' off" + ] + + Value { + CaptureChannels "2" + } +} diff --git a/src/conf/ucm/codecs/rt5651/IN12-InternalMic.conf b/src/conf/ucm/codecs/rt5651/IN12-InternalMic.conf new file mode 100644 index 00000000..f1cc17fe --- /dev/null +++ b/src/conf/ucm/codecs/rt5651/IN12-InternalMic.conf @@ -0,0 +1,31 @@ +SectionDevice."InternalMic-IN12" { + Comment "Internal Microphones on IN1 and IN2" + + ConflictingDevice [ + "InternalMic-IN1" + "InternalMic-IN2" + "HeadsetMic-IN3" + ] + + EnableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Internal Mic Switch' on" + cset "name='RECMIXL BST1 Switch' on" + cset "name='RECMIXR BST1 Switch' on" + cset "name='RECMIXL BST2 Switch' on" + cset "name='RECMIXR BST2 Switch' on" + ] + + DisableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Internal Mic Switch' off" + cset "name='RECMIXL BST1 Switch' off" + cset "name='RECMIXR BST1 Switch' off" + cset "name='RECMIXL BST2 Switch' off" + cset "name='RECMIXR BST2 Switch' off" + ] + + Value { + CaptureChannels "2" + } +} diff --git a/src/conf/ucm/codecs/rt5651/IN2-InternalMic.conf b/src/conf/ucm/codecs/rt5651/IN2-InternalMic.conf new file mode 100644 index 00000000..18f74e1a --- /dev/null +++ b/src/conf/ucm/codecs/rt5651/IN2-InternalMic.conf @@ -0,0 +1,27 @@ +SectionDevice."InternalMic-IN2" { + Comment "Internal Microphone on IN2" + + ConflictingDevice [ + "InternalMic-IN1" + "InternalMic-IN12" + "HeadsetMic-IN3" + ] + + EnableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Internal Mic Switch' on" + cset "name='RECMIXL BST2 Switch' on" + cset "name='RECMIXR BST2 Switch' on" + ] + + DisableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Internal Mic Switch' off" + cset "name='RECMIXL BST2 Switch' off" + cset "name='RECMIXR BST2 Switch' off" + ] + + Value { + CaptureChannels "2" + } +} diff --git a/src/conf/ucm/codecs/rt5651/IN3-HeadsetMic.conf b/src/conf/ucm/codecs/rt5651/IN3-HeadsetMic.conf new file mode 100644 index 00000000..bfd0b009 --- /dev/null +++ b/src/conf/ucm/codecs/rt5651/IN3-HeadsetMic.conf @@ -0,0 +1,28 @@ +SectionDevice."HeadsetMic-IN3" { + Comment "Headset Microphone" + + ConflictingDevice [ + "InternalMic-IN1" + "InternalMic-IN2" + "InternalMic-IN12" + ] + + EnableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Headset Mic Switch' on" + cset "name='RECMIXL BST3 Switch' on" + cset "name='RECMIXR BST3 Switch' on" + ] + + DisableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Headset Mic Switch' off" + cset "name='RECMIXL BST3 Switch' off" + cset "name='RECMIXR BST3 Switch' off" + ] + + Value { + CaptureChannels "2" + JackControl "Headset Mic Jack" + } +} diff --git a/src/conf/ucm/codecs/rt5651/Makefile.am b/src/conf/ucm/codecs/rt5651/Makefile.am new file mode 100644 index 00000000..a68bd7bb --- /dev/null +++ b/src/conf/ucm/codecs/rt5651/Makefile.am @@ -0,0 +1,6 @@ +alsaconfigdir = @ALSA_CONFIG_DIR@ +ucmdir = $(alsaconfigdir)/ucm/codecs/rt5651 +ucm_DATA = EnableSeq.conf HeadPhones.conf HeadPhones-swapped.conf \ + IN1-InternalMic.conf IN2-InternalMic.conf IN12-InternalMic.conf \ + IN3-HeadsetMic.conf Speaker.conf MonoSpeaker.conf +EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/codecs/rt5651/MonoSpeaker.conf b/src/conf/ucm/codecs/rt5651/MonoSpeaker.conf new file mode 100644 index 00000000..0c3492fb --- /dev/null +++ b/src/conf/ucm/codecs/rt5651/MonoSpeaker.conf @@ -0,0 +1,36 @@ +SectionDevice."MonoSpeaker" { + Comment "Mono Speaker" + + ConflictingDevice [ + "Speaker" + "Headphones" + ] + + EnableSequence [ + cdev "hw:bytcrrt5651" + + # Map left and right input on left + cset "name='Stereo DAC MIXR DAC R1 Switch' off" + cset "name='Stereo DAC MIXL DAC R1 Switch' on" + + cset "name='Speaker Switch' on" + cset "name='LOUT L Playback Switch' on" + # Done after turning the speaker on to keep the bias and clk on + cset "name='Headphone Switch' off" + cset "name='HPO L Playback Switch' off" + cset "name='HPO R Playback Switch' off" + ] + + DisableSequence [ + cdev "hw:bytcrrt5651" + # Disabling the switches is done by the Speaker EnableSeq + + # Undo mono mapping + cset "name='Stereo DAC MIXL DAC R1 Switch' off" + cset "name='Stereo DAC MIXR DAC R1 Switch' on" + ] + + Value { + PlaybackChannels "2" + } +} diff --git a/src/conf/ucm/codecs/rt5651/Speaker.conf b/src/conf/ucm/codecs/rt5651/Speaker.conf new file mode 100644 index 00000000..c1091523 --- /dev/null +++ b/src/conf/ucm/codecs/rt5651/Speaker.conf @@ -0,0 +1,31 @@ +SectionDevice."Speaker" { + Comment "Speakers" + + ConflictingDevice [ + "MonoSpeaker" + "Headphones" + ] + + EnableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Speaker Switch' on" + cset "name='LOUT L Playback Switch' on" + cset "name='LOUT R Playback Switch' on" + # Done after turning the speaker on to keep the bias and clk on + cset "name='Headphone Switch' off" + cset "name='HPO L Playback Switch' off" + cset "name='HPO R Playback Switch' off" + ] + + DisableSequence [ + cdev "hw:bytcrrt5651" + # This is done by the Headphones EnableSequence, so that the + # Platform Clock and BIAS do not temporarily get turned off + # as that breaks audio-streams which are playing when + # switching between Speaker/Headphone + ] + + Value { + PlaybackChannels "2" + } +} diff --git a/src/conf/ucm/cube-i1_TF-Defaultstring-CherryTrailCR/HiFi.conf b/src/conf/ucm/cube-i1_TF-Defaultstring-CherryTrailCR/HiFi.conf index 799163db..facc73ac 100644 --- a/src/conf/ucm/cube-i1_TF-Defaultstring-CherryTrailCR/HiFi.conf +++ b/src/conf/ucm/cube-i1_TF-Defaultstring-CherryTrailCR/HiFi.conf @@ -11,18 +11,18 @@ SectionVerb { EnableSequence [ cdev "hw:chtnau8824" - - + + ] DisableSequence [ cdev "hw:chtnau8824" - + ] } - - + + - - + + diff --git a/src/conf/ucm/nau8824/EnableSeq.conf b/src/conf/ucm/nau8824/EnableSeq.conf deleted file mode 100644 index 05f5f0b4..00000000 --- a/src/conf/ucm/nau8824/EnableSeq.conf +++ /dev/null @@ -1,15 +0,0 @@ -# Playback TDM configuration -cset "name='DACL Channel Source' 0" -cset "name='DACR Channel Source' 1" -# Input Configuration -cset "name='DMIC1 Enable Switch' off" -cset "name='DMIC2 Enable Switch' off" -cset "name='DMIC3 Enable Switch' off" -cset "name='DMIC4 Enable Switch' off" -cset "name='MIC1 Volume' 10" -cset "name='MIC2 Volume' 10" -# Button Configuration -cset "name='THD for key media' 10" -cset "name='THD for key voice command' 16" -cset "name='THD for key volume up' 38" -cset "name='THD for key volume down' 115" diff --git a/src/conf/ucm/nau8824/HeadPhones.conf b/src/conf/ucm/nau8824/HeadPhones.conf deleted file mode 100644 index 8ed6f194..00000000 --- a/src/conf/ucm/nau8824/HeadPhones.conf +++ /dev/null @@ -1,25 +0,0 @@ -SectionDevice."Headphones" { - Comment "Headphones" - - Value { - PlaybackChannels "2" - JackControl "Headphone Jack" - } - - ConflictingDevice [ - "MonoSpeaker" - "Speaker" - ] - - EnableSequence [ - cdev "hw:chtnau8824" - - cset "name='Headphone Switch' on" - ] - - DisableSequence [ - cdev "hw:chtnau8824" - - cset "name='Headphone Switch' off" - ] -} diff --git a/src/conf/ucm/nau8824/HeadsetMic.conf b/src/conf/ucm/nau8824/HeadsetMic.conf deleted file mode 100644 index 11b0b52a..00000000 --- a/src/conf/ucm/nau8824/HeadsetMic.conf +++ /dev/null @@ -1,31 +0,0 @@ -SectionDevice."HeadsetMic" { - Comment "Headset Microphone" - - Value { - CaptureChannels "2" - JackControl "Headset Mic Jack" - } - - ConflictingDevice [ - "InternalMic" - ] - - EnableSequence [ - cdev "hw:chtnau8824" - - cset "name='ADC CH0 Select' 1" - cset "name='ADC CH1 Select' 1" - - cset "name='Headset Mic Switch' on" - cset "name='Right ADC HSMIC Switch' on" - cset "name='Left ADC HSMIC Switch' on" - ] - - DisableSequence [ - cdev "hw:chtnau8824" - - cset "name='Headset Mic Switch' off" - cset "name='Right ADC HSMIC Switch' off" - cset "name='Left ADC HSMIC Switch' off" - ] -} diff --git a/src/conf/ucm/nau8824/InternalMic.conf b/src/conf/ucm/nau8824/InternalMic.conf deleted file mode 100644 index c6a741cc..00000000 --- a/src/conf/ucm/nau8824/InternalMic.conf +++ /dev/null @@ -1,31 +0,0 @@ -SectionDevice."InternalMic" { - Comment "Internal Microphone" - - Value { - CaptureChannels "2" - CapturePriority "150" - } - - ConflictingDevice [ - "HeadsetMic" - ] - - EnableSequence [ - cdev "hw:chtnau8824" - - cset "name='ADC CH0 Select' 0" - cset "name='ADC CH1 Select' 0" - - cset "name='Int Mic Switch' on" - cset "name='Right ADC MIC Switch' on" - cset "name='Left ADC MIC Switch' on" - ] - - DisableSequence [ - cdev "hw:chtnau8824" - - cset "name='Int Mic Switch' off" - cset "name='Right ADC MIC Switch' off" - cset "name='Left ADC MIC Switch' off" - ] -} diff --git a/src/conf/ucm/nau8824/Makefile.am b/src/conf/ucm/nau8824/Makefile.am deleted file mode 100644 index b39b8bb4..00000000 --- a/src/conf/ucm/nau8824/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -alsaconfigdir = @ALSA_CONFIG_DIR@ -ucmdir = $(alsaconfigdir)/ucm/nau8824 -ucm_DATA = EnableSeq.conf HeadPhones.conf HeadsetMic.conf InternalMic.conf \ - MonoSpeaker.conf Speaker.conf -EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/nau8824/MonoSpeaker.conf b/src/conf/ucm/nau8824/MonoSpeaker.conf deleted file mode 100644 index 86735181..00000000 --- a/src/conf/ucm/nau8824/MonoSpeaker.conf +++ /dev/null @@ -1,29 +0,0 @@ -SectionDevice."MonoSpeaker" { - Comment "Mono Speaker" - - Value { - PlaybackChannels "2" - } - - ConflictingDevice [ - "Speaker" - "Headphones" - ] - - EnableSequence [ - cdev "hw:chtnau8824" - - # nau8824 mono speaker boards have the speaker on the right chan - cset "name='Speaker Left DACL Volume' 0" - cset "name='Speaker Left DACR Volume' 0" - cset "name='Speaker Right DACL Volume' 1" - cset "name='Speaker Right DACR Volume' 1" - cset "name='Ext Spk Switch' on" - ] - - DisableSequence [ - cdev "hw:chtnau8824" - - cset "name='Ext Spk Switch' off" - ] -} diff --git a/src/conf/ucm/nau8824/Speaker.conf b/src/conf/ucm/nau8824/Speaker.conf deleted file mode 100644 index e4d25b08..00000000 --- a/src/conf/ucm/nau8824/Speaker.conf +++ /dev/null @@ -1,28 +0,0 @@ -SectionDevice."Speaker" { - Comment "Speaker" - - Value { - PlaybackChannels "2" - } - - ConflictingDevice [ - "MonoSpeaker" - "Headphones" - ] - - EnableSequence [ - cdev "hw:chtnau8824" - - cset "name='Speaker Left DACL Volume' 1" - cset "name='Speaker Left DACR Volume' 0" - cset "name='Speaker Right DACL Volume' 0" - cset "name='Speaker Right DACR Volume' 1" - cset "name='Ext Spk Switch' on" - ] - - DisableSequence [ - cdev "hw:chtnau8824" - - cset "name='Ext Spk Switch' off" - ] -} diff --git a/src/conf/ucm/platforms/Makefile.am b/src/conf/ucm/platforms/Makefile.am new file mode 100644 index 00000000..1bf252f0 --- /dev/null +++ b/src/conf/ucm/platforms/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS=\ +bytcr diff --git a/src/conf/ucm/platforms/bytcr/Makefile.am b/src/conf/ucm/platforms/bytcr/Makefile.am new file mode 100644 index 00000000..c53b2143 --- /dev/null +++ b/src/conf/ucm/platforms/bytcr/Makefile.am @@ -0,0 +1,4 @@ +alsaconfigdir = @ALSA_CONFIG_DIR@ +ucmdir = $(alsaconfigdir)/ucm/platforms/bytcr +ucm_DATA = PlatformEnableSeq.conf PlatformDisableSeq.conf +EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/platforms/bytcr/PlatformDisableSeq.conf b/src/conf/ucm/platforms/bytcr/PlatformDisableSeq.conf new file mode 100644 index 00000000..9bb018bc --- /dev/null +++ b/src/conf/ucm/platforms/bytcr/PlatformDisableSeq.conf @@ -0,0 +1,20 @@ +# disable audio output path +cset "name='codec_out0 mix 0 pcm0_in Switch' off" +cset "name='modem_out mix 0 pcm0_in Switch' off" + +cset "name='media0_out mix 0 media0_in Switch' off" +cset "name='media0_out mix 0 media1_in Switch' off" +cset "name='media0_out mix 0 media3_in Switch' off" + +cset "name='media0_in Gain 0 Switch' off" +cset "name='media1_in Gain 0 Switch' off" +cset "name='media3_in Gain 0 Switch' off" + +cset "name='pcm0_in Gain 0 Switch' off" +cset "name='codec_out0 Gain 0 Switch' off" +cset "name='modem_out Gain 0 Switch' off" + +# disable audio input path +cset "name='pcm1_out Gain 0 Switch' off" +cset "name='codec_in0 Gain 0 Switch' off" +cset "name='modem_in Gain 0 Switch' off" diff --git a/src/conf/ucm/platforms/bytcr/PlatformEnableSeq.conf b/src/conf/ucm/platforms/bytcr/PlatformEnableSeq.conf new file mode 100644 index 00000000..b5ee2b41 --- /dev/null +++ b/src/conf/ucm/platforms/bytcr/PlatformEnableSeq.conf @@ -0,0 +1,115 @@ +# 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 (used if SSP2 is connected) +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" + +# modem_out settings (used if SSP0 is connected) +cset "name='modem_out mix 0 codec_in0 Switch' off" +cset "name='modem_out mix 0 codec_in1 Switch' off" +cset "name='modem_out mix 0 media_loop1_in Switch' off" +cset "name='modem_out mix 0 media_loop2_in Switch' off" +cset "name='modem_out mix 0 pcm0_in Switch' on" +cset "name='modem_out mix 0 pcm1_in Switch' off" +cset "name='modem_out mix 0 sprot_loop_in Switch' off" +cset "name='modem_out Gain 0 Switch' on" +cset "name='modem_out Gain 0 Volume' 0" + +# input settings + +# input used when SSP2 is connected +cset "name='codec_in0 Gain 0 Switch' on" +cset "name='codec_in0 Gain 0 Volume' 0" + +# input used when SSP0 is connected +cset "name='modem_in Gain 0 Switch' on" +cset "name='modem_in Gain 0 Volume' 0" + +# pcm1_out settings +cset "name='pcm1_out mix 0 codec_in0 Switch' on" +cset "name='pcm1_out mix 0 modem_in 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" diff --git a/src/conf/ucm/rt5640/DigitalMics.conf b/src/conf/ucm/rt5640/DigitalMics.conf deleted file mode 100644 index 06b42f16..00000000 --- a/src/conf/ucm/rt5640/DigitalMics.conf +++ /dev/null @@ -1,31 +0,0 @@ -SectionDevice."DigitalMics" { - Comment "Internal Digital Microphones" - - ConflictingDevice [ - "IN1-InternalMics" - "IN3-InternalMics" - "HeadsetMic" - ] - - EnableSequence [ - cdev "hw:bytcrrt5640" - - cset "name='Stereo ADC MIXL ADC2 Switch' on" - cset "name='Stereo ADC MIXR ADC2 Switch' on" - cset "name='Internal Mic Switch' on" - - ] - - DisableSequence [ - cdev "hw:bytcrrt5640" - - cset "name='Stereo ADC MIXL ADC2 Switch' off" - cset "name='Stereo ADC MIXR ADC2 Switch' off" - cset "name='Internal Mic Switch' off" - - ] - - Value { - CaptureChannels 2 - } -} diff --git a/src/conf/ucm/rt5640/EnableSeq.conf b/src/conf/ucm/rt5640/EnableSeq.conf deleted file mode 100644 index 62795fa6..00000000 --- a/src/conf/ucm/rt5640/EnableSeq.conf +++ /dev/null @@ -1,41 +0,0 @@ -# RT5640 default output routing -cset "name='OUT MIXL DAC L1 Switch' on" -cset "name='OUT MIXR DAC R1 Switch' on" - -# uncomment for loopback mic->speakers -# cset "name='SPOL MIX BST1 Switch' on" -# cset "name='SPOR MIX BST1 Switch' on" - -# uncomment for loopback playback -> capture -# cset "name='RECMIXL OUT MIXL Switch' on" -# cset "name='RECMIXR OUT MIXR Switch' on" - -# uncomment to enable swap between AIF1 and AIF2 -# warning: can only work with SSP0 firmware enabled -cset "name='SDI select' 0" -cset "name='DAI select' 0" -#cset "name='SDI select' 1" -#cset "name='DAI select' 1" - -cset "name='DAC2 Playback Switch' on" -cset "name='DIG MIXL DAC L2 Switch' on" - -# Input Configuration -cset "name='Stereo ADC1 Mux' ADC" -cset "name='Stereo ADC2 Mux' DMIC1" -cset "name='Mono ADC L1 Mux' 1" -cset "name='Mono ADC R1 Mux' 1" - -# 47=0dB, 0.375 dB/step, set it to 6 dB to help with soft mics -cset "name='ADC Capture Volume' 63" -# Set ADC Boost Gain to 3dB higher vals result in too much noise -cset "name='ADC Boost Gain' 1" -# Set IN1/IN3 internal mic boost to 8 (max) -# Set IN2 headset-mic boost to 1, headset mics are quite loud -cset "name='IN1 Boost' 8" -cset "name='IN2 Boost' 1" -cset "name='IN3 Boost' 8" - -cset "name='Internal Mic Switch' off" -cset "name='Headset Mic Switch' off" -cset "name='ADC Capture Switch' on" diff --git a/src/conf/ucm/rt5640/HeadPhones.conf b/src/conf/ucm/rt5640/HeadPhones.conf deleted file mode 100644 index 38f37a6f..00000000 --- a/src/conf/ucm/rt5640/HeadPhones.conf +++ /dev/null @@ -1,41 +0,0 @@ -SectionDevice."Headphones" { - Comment "Headphones" - - ConflictingDevice [ - "Speaker" - "MonoSpeaker" - ] - - EnableSequence [ - cdev "hw:bytcrrt5640" - - cset "name='DAC MIXL INF1 Switch' on" - cset "name='DAC MIXR INF1 Switch' on" - cset "name='Stereo DAC MIXL DAC L1 Switch' on" - cset "name='Stereo DAC MIXR DAC R1 Switch' on" - cset "name='Stereo DAC MIXL DAC L2 Switch' on" - cset "name='Stereo DAC MIXR DAC R2 Switch' on" - cset "name='HPO MIX HPVOL Switch' on" - cset "name='Headphone Switch' on" - cset "name='HP Channel Switch' on" - cset "name='Speaker Switch' off" - cset "name='HP L Playback Switch' on" - cset "name='HP R Playback Switch' on" - cset "name='HP Playback Volume' 29" - - ] - - DisableSequence [ - cdev "hw:bytcrrt5640" - cset "name='Headphone Switch' off" - cset "name='HP Channel Switch' off" - cset "name='HP L Playback Switch' off" - cset "name='HP R Playback Switch' off" - cset "name='HP Playback Volume' 0" - ] - - Value { - PlaybackChannels "2" - JackControl "Headphone Jack" - } -} diff --git a/src/conf/ucm/rt5640/HeadsetMic.conf b/src/conf/ucm/rt5640/HeadsetMic.conf deleted file mode 100644 index 567d4122..00000000 --- a/src/conf/ucm/rt5640/HeadsetMic.conf +++ /dev/null @@ -1,48 +0,0 @@ -SectionDevice."HeadsetMic" { - Comment "Headset Microphone" - - ConflictingDevice [ - "IN1-InternalMics" - "IN3-InternalMics" - "DigitalMics" - ] - - EnableSequence [ - cdev "hw:bytcrrt5640" - - cset "name='Headset Mic Switch' on" - - cset "name='RECMIXL BST2 Switch' on" - cset "name='RECMIXR BST2 Switch' on" - - cset "name='Stereo ADC MIXL ADC1 Switch' on" - cset "name='Stereo ADC MIXR ADC1 Switch' on" - - cset "name='Mono ADC MIXL ADC1 Switch' on" - cset "name='Mono ADC MIXR ADC1 Switch' on" - - cset "name='Mono ADC Capture Switch' on" - ] - - DisableSequence [ - cdev "hw:bytcrrt5640" - - cset "name='Stereo ADC MIXL ADC1 Switch' off" - cset "name='Stereo ADC MIXR ADC1 Switch' off" - - cset "name='RECMIXL BST2 Switch' off" - cset "name='RECMIXR BST2 Switch' off" - - cset "name='Headset Mic Switch' off" - - cset "name='Mono ADC MIXL ADC1 Switch' off" - cset "name='Mono ADC MIXR ADC1 Switch' off" - - cset "name='Mono ADC Capture Switch' off" - ] - - Value { - CaptureChannels 2 - JackControl "Headset Mic Jack" - } -} diff --git a/src/conf/ucm/rt5640/IN1-InternalMic.conf b/src/conf/ucm/rt5640/IN1-InternalMic.conf deleted file mode 100644 index 3bf31e64..00000000 --- a/src/conf/ucm/rt5640/IN1-InternalMic.conf +++ /dev/null @@ -1,50 +0,0 @@ -SectionDevice."IN1-InternalMics" { - Comment "Internal Microphone on IN1" - - ConflictingDevice [ - "DigitalMics" - "HeadsetMic" - "IN3-InternalMics" - ] - - EnableSequence [ - cdev "hw:bytcrrt5640" - - cset "name='Internal Mic Switch' on" - - cset "name='RECMIXL BST1 Switch' on" - cset "name='RECMIXR BST1 Switch' on" - cset "name='RECMIXL BST3 Switch' off" - cset "name='RECMIXR BST3 Switch' off" - - cset "name='Stereo ADC MIXL ADC1 Switch' on" - cset "name='Stereo ADC MIXR ADC1 Switch' on" - - cset "name='Mono ADC MIXL ADC1 Switch' on" - cset "name='Mono ADC MIXR ADC1 Switch' on" - - cset "name='Mono ADC Capture Switch' on" - ] - - DisableSequence [ - cdev "hw:bytcrrt5640" - - cset "name='Stereo ADC MIXL ADC1 Switch' off" - cset "name='Stereo ADC MIXR ADC1 Switch' off" - - cset "name='RECMIXL BST1 Switch' off" - cset "name='RECMIXR BST1 Switch' off" - - cset "name='Internal Mic Switch' off" - - cset "name='Mono ADC MIXL ADC1 Switch' off" - cset "name='Mono ADC MIXR ADC1 Switch' off" - - cset "name='Mono ADC Capture Switch' off" - - ] - - Value { - CaptureChannels 2 - } -} diff --git a/src/conf/ucm/rt5640/IN3-InternalMic.conf b/src/conf/ucm/rt5640/IN3-InternalMic.conf deleted file mode 100644 index e1a6c49b..00000000 --- a/src/conf/ucm/rt5640/IN3-InternalMic.conf +++ /dev/null @@ -1,50 +0,0 @@ -SectionDevice."IN3-InternalMics" { - Comment "Internal Microphone on IN3" - - ConflictingDevice [ - "DigitalMics" - "HeadsetMic" - "IN1-InternalMics" - ] - - EnableSequence [ - cdev "hw:bytcrrt5640" - - cset "name='Internal Mic Switch' on" - - cset "name='RECMIXL BST1 Switch' off" - cset "name='RECMIXR BST1 Switch' off" - cset "name='RECMIXL BST3 Switch' on" - cset "name='RECMIXR BST3 Switch' on" - - cset "name='Stereo ADC MIXL ADC1 Switch' on" - cset "name='Stereo ADC MIXR ADC1 Switch' on" - - cset "name='Mono ADC MIXL ADC1 Switch' on" - cset "name='Mono ADC MIXR ADC1 Switch' on" - - cset "name='Mono ADC Capture Switch' on" - - ] - - DisableSequence [ - cdev "hw:bytcrrt5640" - - cset "name='Stereo ADC MIXL ADC1 Switch' off" - cset "name='Stereo ADC MIXR ADC1 Switch' off" - - cset "name='RECMIXL BST3 Switch' off" - cset "name='RECMIXR BST3 Switch' off" - - cset "name='Internal Mic Switch' off" - - cset "name='Mono ADC MIXL ADC1 Switch' off" - cset "name='Mono ADC MIXR ADC1 Switch' off" - - cset "name='Mono ADC Capture Switch' off" - ] - - Value { - CaptureChannels 2 - } -} diff --git a/src/conf/ucm/rt5640/Makefile.am b/src/conf/ucm/rt5640/Makefile.am deleted file mode 100644 index a6fbdc57..00000000 --- a/src/conf/ucm/rt5640/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -alsaconfigdir = @ALSA_CONFIG_DIR@ -ucmdir = $(alsaconfigdir)/ucm/rt5640 -ucm_DATA = DigitalMics.conf EnableSeq.conf HeadPhones.conf HeadsetMic.conf \ - IN1-InternalMic.conf IN3-InternalMic.conf MonoSpeaker.conf Speaker.conf -EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/rt5640/MonoSpeaker.conf b/src/conf/ucm/rt5640/MonoSpeaker.conf deleted file mode 100644 index 58ab7807..00000000 --- a/src/conf/ucm/rt5640/MonoSpeaker.conf +++ /dev/null @@ -1,45 +0,0 @@ -SectionDevice."MonoSpeaker" { - Comment "Mono Speaker" - - ConflictingDevice [ - "Headphones" - "Speaker" - ] - - EnableSequence [ - cdev "hw:bytcrrt5640" - - cset "name='DAC MIXL INF1 Switch' on" - cset "name='DAC MIXR INF1 Switch' on" - cset "name='Stereo DAC MIXL DAC L1 Switch' on" - cset "name='Stereo DAC MIXR DAC R1 Switch' on" - cset "name='Stereo DAC MIXL DAC L2 Switch' on" - cset "name='Stereo DAC MIXR DAC R2 Switch' on" - cset "name='SPK MIXL DAC L1 Switch' on" - cset "name='SPK MIXR DAC R1 Switch' on" - cset "name='SPOL MIX SPKVOL L Switch' on" -# for mono speaker we apply left on right -# cset "name='SPOR MIX SPKVOL R Switch' on" - cset "name='SPOL MIX SPKVOL R Switch' on" - cset "name='Speaker Switch' on" - cset "name='Speaker Channel Switch' on" - cset "name='Headphone Switch' off" - cset "name='Speaker L Playback Switch' on" - cset "name='Speaker R Playback Switch' on" - cset "name='Speaker Playback Volume' 35" - - ] - - DisableSequence [ - cdev "hw:bytcrrt5640" - cset "name='Speaker Switch' off" - cset "name='Speaker Channel Switch' off" - cset "name='Speaker L Playback Switch' off" - cset "name='Speaker R Playback Switch' off" - cset "name='Speaker Playback Volume' 0" - ] - - Value { - PlaybackChannels "2" - } -} diff --git a/src/conf/ucm/rt5640/Speaker.conf b/src/conf/ucm/rt5640/Speaker.conf deleted file mode 100644 index a7df9fbf..00000000 --- a/src/conf/ucm/rt5640/Speaker.conf +++ /dev/null @@ -1,45 +0,0 @@ -SectionDevice."Speaker" { - Comment "Speakers" - - ConflictingDevice [ - "Headphones" - "MonoSpeaker" - ] - - EnableSequence [ - cdev "hw:bytcrrt5640" - - cset "name='DAC MIXL INF1 Switch' on" - cset "name='DAC MIXR INF1 Switch' on" - cset "name='Stereo DAC MIXL DAC L1 Switch' on" - cset "name='Stereo DAC MIXR DAC R1 Switch' on" - cset "name='Stereo DAC MIXL DAC L2 Switch' on" - cset "name='Stereo DAC MIXR DAC R2 Switch' on" - cset "name='SPK MIXL DAC L1 Switch' on" - cset "name='SPK MIXR DAC R1 Switch' on" - cset "name='SPOL MIX SPKVOL L Switch' on" - cset "name='SPOR MIX SPKVOL R Switch' on" - # undo MonoSpeaker mixing of right channel to left speaker - cset "name='SPOL MIX SPKVOL R Switch' off" - cset "name='Speaker Switch' on" - cset "name='Speaker Channel Switch' on" - cset "name='Headphone Switch' off" - cset "name='Speaker L Playback Switch' on" - cset "name='Speaker R Playback Switch' on" - cset "name='Speaker Playback Volume' 35" - - ] - - DisableSequence [ - cdev "hw:bytcrrt5640" - cset "name='Speaker Switch' off" - cset "name='Speaker Channel Switch' off" - cset "name='Speaker L Playback Switch' off" - cset "name='Speaker R Playback Switch' off" - cset "name='Speaker Playback Volume' 0" - ] - - Value { - PlaybackChannels "2" - } -} diff --git a/src/conf/ucm/rt5651/EnableSeq.conf b/src/conf/ucm/rt5651/EnableSeq.conf deleted file mode 100644 index 6fb3c1f2..00000000 --- a/src/conf/ucm/rt5651/EnableSeq.conf +++ /dev/null @@ -1,54 +0,0 @@ -# default state -cset "name='HPO MIX DAC1 Switch' on" -cset "name='HPO MIX HPVOL Switch' off" -cset "name='HPO L Playback Switch' off" -cset "name='HPO R Playback Switch' off" -cset "name='HPOVOL L Switch' on" -cset "name='HPOVOL R Switch' on" -cset "name='LOUT MIX DAC L1 Switch' on" -cset "name='LOUT MIX DAC R1 Switch' on" -cset "name='IF1 ASRC Switch' on" -cset "name='LOUT L Playback Switch' off" -cset "name='LOUT R Playback Switch' off" -cset "name='Stereo DAC MIXL DAC L1 Switch' on" -cset "name='Stereo DAC MIXL DAC R1 Switch' off" -cset "name='Stereo DAC MIXR DAC L1 Switch' off" -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" - -# volumes -cset "name='OUT Playback Volume' 31" -cset "name='HP Playback Volume' 31" -cset "name='DAC1 Playback Volume' 175" -cset "name='IN Capture Volume' 23" -# 47=0dB, 0.375 dB/step, set it to 6 dB to help with soft mics -cset "name='ADC Capture Volume' 63" -cset "name='ADC Capture Switch' on" -# Set ADC Boost Gain to 3dB higher vals result in too much noise -cset "name='ADC Boost Gain' 1" -# Set IN1, IN2 and IN3 internal mic boost to 1 -cset "name='IN1 Boost' 1" -cset "name='IN2 Boost' 1" -cset "name='IN3 Boost' 1" - -# 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" -cset "name='Headset Mic Switch' off" -cset "name='Internal Mic Switch' off" -cset "name='Line In Switch' off" diff --git a/src/conf/ucm/rt5651/HeadPhones-swapped.conf b/src/conf/ucm/rt5651/HeadPhones-swapped.conf deleted file mode 100644 index e79b40a7..00000000 --- a/src/conf/ucm/rt5651/HeadPhones-swapped.conf +++ /dev/null @@ -1,42 +0,0 @@ -SectionDevice."Headphones" { - Comment "Headphones" - - ConflictingDevice [ - "Speaker" - "MonoSpeaker" - ] - - EnableSequence [ - cdev "hw:bytcrrt5651" - - # Swap left and right - cset "name='Stereo DAC MIXL DAC R1 Switch' on" - cset "name='Stereo DAC MIXL DAC L1 Switch' off" - cset "name='Stereo DAC MIXR DAC L1 Switch' on" - cset "name='Stereo DAC MIXR DAC R1 Switch' off" - - cset "name='Headphone Switch' on" - cset "name='HPO L Playback Switch' on" - cset "name='HPO R Playback Switch' on" - # Done after turning the HP on to keep the bias and clk on - cset "name='Speaker Switch' off" - cset "name='LOUT L Playback Switch' off" - cset "name='LOUT R Playback Switch' off" - ] - - DisableSequence [ - cdev "hw:bytcrrt5651" - # Disabling the HP switches is done by the Speaker EnableSeq - - # Unswap left and right - cset "name='Stereo DAC MIXL DAC L1 Switch' on" - cset "name='Stereo DAC MIXL DAC R1 Switch' off" - cset "name='Stereo DAC MIXR DAC R1 Switch' on" - cset "name='Stereo DAC MIXR DAC L1 Switch' off" - ] - - Value { - PlaybackChannels "2" - JackControl "Headphone Jack" - } -} diff --git a/src/conf/ucm/rt5651/HeadPhones.conf b/src/conf/ucm/rt5651/HeadPhones.conf deleted file mode 100644 index eaf5fdfc..00000000 --- a/src/conf/ucm/rt5651/HeadPhones.conf +++ /dev/null @@ -1,32 +0,0 @@ -SectionDevice."Headphones" { - Comment "Headphones" - - ConflictingDevice [ - "Speaker" - "MonoSpeaker" - ] - - EnableSequence [ - cdev "hw:bytcrrt5651" - cset "name='Headphone Switch' on" - cset "name='HPO L Playback Switch' on" - cset "name='HPO R Playback Switch' on" - # Done after turning the HP on to keep the bias and clk on - cset "name='Speaker Switch' off" - cset "name='LOUT L Playback Switch' off" - cset "name='LOUT R Playback Switch' off" - ] - - DisableSequence [ - cdev "hw:bytcrrt5651" - # This is done by the Speaker EnableSequence, so that the - # Platform Clock and BIAS do not temporarily get turned off - # as that breaks audio-streams which are playing when - # switching between Speaker/Headphone - ] - - Value { - PlaybackChannels "2" - JackControl "Headphone Jack" - } -} diff --git a/src/conf/ucm/rt5651/IN1-InternalMic.conf b/src/conf/ucm/rt5651/IN1-InternalMic.conf deleted file mode 100644 index 85e25a5c..00000000 --- a/src/conf/ucm/rt5651/IN1-InternalMic.conf +++ /dev/null @@ -1,27 +0,0 @@ -SectionDevice."InternalMic-IN1" { - Comment "Internal Microphone on IN1" - - ConflictingDevice [ - "InternalMic-IN2" - "InternalMic-IN12" - "HeadsetMic-IN3" - ] - - EnableSequence [ - cdev "hw:bytcrrt5651" - cset "name='Internal Mic Switch' on" - cset "name='RECMIXL BST1 Switch' on" - cset "name='RECMIXR BST1 Switch' on" - ] - - DisableSequence [ - cdev "hw:bytcrrt5651" - cset "name='Internal Mic Switch' off" - cset "name='RECMIXL BST1 Switch' off" - cset "name='RECMIXR BST1 Switch' off" - ] - - Value { - CaptureChannels "2" - } -} diff --git a/src/conf/ucm/rt5651/IN12-InternalMic.conf b/src/conf/ucm/rt5651/IN12-InternalMic.conf deleted file mode 100644 index f1cc17fe..00000000 --- a/src/conf/ucm/rt5651/IN12-InternalMic.conf +++ /dev/null @@ -1,31 +0,0 @@ -SectionDevice."InternalMic-IN12" { - Comment "Internal Microphones on IN1 and IN2" - - ConflictingDevice [ - "InternalMic-IN1" - "InternalMic-IN2" - "HeadsetMic-IN3" - ] - - EnableSequence [ - cdev "hw:bytcrrt5651" - cset "name='Internal Mic Switch' on" - cset "name='RECMIXL BST1 Switch' on" - cset "name='RECMIXR BST1 Switch' on" - cset "name='RECMIXL BST2 Switch' on" - cset "name='RECMIXR BST2 Switch' on" - ] - - DisableSequence [ - cdev "hw:bytcrrt5651" - cset "name='Internal Mic Switch' off" - cset "name='RECMIXL BST1 Switch' off" - cset "name='RECMIXR BST1 Switch' off" - cset "name='RECMIXL BST2 Switch' off" - cset "name='RECMIXR BST2 Switch' off" - ] - - Value { - CaptureChannels "2" - } -} diff --git a/src/conf/ucm/rt5651/IN2-InternalMic.conf b/src/conf/ucm/rt5651/IN2-InternalMic.conf deleted file mode 100644 index 18f74e1a..00000000 --- a/src/conf/ucm/rt5651/IN2-InternalMic.conf +++ /dev/null @@ -1,27 +0,0 @@ -SectionDevice."InternalMic-IN2" { - Comment "Internal Microphone on IN2" - - ConflictingDevice [ - "InternalMic-IN1" - "InternalMic-IN12" - "HeadsetMic-IN3" - ] - - EnableSequence [ - cdev "hw:bytcrrt5651" - cset "name='Internal Mic Switch' on" - cset "name='RECMIXL BST2 Switch' on" - cset "name='RECMIXR BST2 Switch' on" - ] - - DisableSequence [ - cdev "hw:bytcrrt5651" - cset "name='Internal Mic Switch' off" - cset "name='RECMIXL BST2 Switch' off" - cset "name='RECMIXR BST2 Switch' off" - ] - - Value { - CaptureChannels "2" - } -} diff --git a/src/conf/ucm/rt5651/IN3-HeadsetMic.conf b/src/conf/ucm/rt5651/IN3-HeadsetMic.conf deleted file mode 100644 index bfd0b009..00000000 --- a/src/conf/ucm/rt5651/IN3-HeadsetMic.conf +++ /dev/null @@ -1,28 +0,0 @@ -SectionDevice."HeadsetMic-IN3" { - Comment "Headset Microphone" - - ConflictingDevice [ - "InternalMic-IN1" - "InternalMic-IN2" - "InternalMic-IN12" - ] - - EnableSequence [ - cdev "hw:bytcrrt5651" - cset "name='Headset Mic Switch' on" - cset "name='RECMIXL BST3 Switch' on" - cset "name='RECMIXR BST3 Switch' on" - ] - - DisableSequence [ - cdev "hw:bytcrrt5651" - cset "name='Headset Mic Switch' off" - cset "name='RECMIXL BST3 Switch' off" - cset "name='RECMIXR BST3 Switch' off" - ] - - Value { - CaptureChannels "2" - JackControl "Headset Mic Jack" - } -} diff --git a/src/conf/ucm/rt5651/Makefile.am b/src/conf/ucm/rt5651/Makefile.am deleted file mode 100644 index acc8ea49..00000000 --- a/src/conf/ucm/rt5651/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -alsaconfigdir = @ALSA_CONFIG_DIR@ -ucmdir = $(alsaconfigdir)/ucm/rt5651 -ucm_DATA = EnableSeq.conf HeadPhones.conf HeadPhones-swapped.conf \ - IN1-InternalMic.conf IN2-InternalMic.conf IN12-InternalMic.conf \ - IN3-HeadsetMic.conf Speaker.conf MonoSpeaker.conf -EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/rt5651/MonoSpeaker.conf b/src/conf/ucm/rt5651/MonoSpeaker.conf deleted file mode 100644 index 0c3492fb..00000000 --- a/src/conf/ucm/rt5651/MonoSpeaker.conf +++ /dev/null @@ -1,36 +0,0 @@ -SectionDevice."MonoSpeaker" { - Comment "Mono Speaker" - - ConflictingDevice [ - "Speaker" - "Headphones" - ] - - EnableSequence [ - cdev "hw:bytcrrt5651" - - # Map left and right input on left - cset "name='Stereo DAC MIXR DAC R1 Switch' off" - cset "name='Stereo DAC MIXL DAC R1 Switch' on" - - cset "name='Speaker Switch' on" - cset "name='LOUT L Playback Switch' on" - # Done after turning the speaker on to keep the bias and clk on - cset "name='Headphone Switch' off" - cset "name='HPO L Playback Switch' off" - cset "name='HPO R Playback Switch' off" - ] - - DisableSequence [ - cdev "hw:bytcrrt5651" - # Disabling the switches is done by the Speaker EnableSeq - - # Undo mono mapping - cset "name='Stereo DAC MIXL DAC R1 Switch' off" - cset "name='Stereo DAC MIXR DAC R1 Switch' on" - ] - - Value { - PlaybackChannels "2" - } -} diff --git a/src/conf/ucm/rt5651/Speaker.conf b/src/conf/ucm/rt5651/Speaker.conf deleted file mode 100644 index c1091523..00000000 --- a/src/conf/ucm/rt5651/Speaker.conf +++ /dev/null @@ -1,31 +0,0 @@ -SectionDevice."Speaker" { - Comment "Speakers" - - ConflictingDevice [ - "MonoSpeaker" - "Headphones" - ] - - EnableSequence [ - cdev "hw:bytcrrt5651" - cset "name='Speaker Switch' on" - cset "name='LOUT L Playback Switch' on" - cset "name='LOUT R Playback Switch' on" - # Done after turning the speaker on to keep the bias and clk on - cset "name='Headphone Switch' off" - cset "name='HPO L Playback Switch' off" - cset "name='HPO R Playback Switch' off" - ] - - DisableSequence [ - cdev "hw:bytcrrt5651" - # This is done by the Headphones EnableSequence, so that the - # Platform Clock and BIAS do not temporarily get turned off - # as that breaks audio-streams which are playing when - # switching between Speaker/Headphone - ] - - Value { - PlaybackChannels "2" - } -} diff --git a/src/ucm/parser.c b/src/ucm/parser.c index 219edb96..2b6f1159 100644 --- a/src/ucm/parser.c +++ b/src/ucm/parser.c @@ -53,6 +53,7 @@ static const char * const component_dir[] = { "codecs", /* for off-soc codecs */ "dsps", /* for DSPs embedded in SoC */ + "platforms", /* for common platform implementations */ NULL, /* terminator */ }; -- cgit v1.2.3 From c9fcf9836907b1ccda0c1f72b698ee5c5dd5199c Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 28 Nov 2018 16:25:41 +0100 Subject: ucm: Set default include path Many UCM profiles include the UCM profile components under ucm/* subdirectories and thusly put at each place. This is rather cumbersome. This patch makes the UCM parser to set the default include path, so that each profile no longer needs to set searchdir. All the lines currently found in the profiles are removed gracefully, too. For the needed implementation, a new helper, _snd_config_load_with_include() is introduced. It's not exported, only for the use inside alsa-lib. Signed-off-by: Takashi Iwai --- include/local.h | 3 ++ src/conf.c | 32 ++++++++++++++++++++-- .../PIPO-W2S-Defaultstring-CherryTrailCR/HiFi.conf | 1 - .../ucm/bytcr-rt5640-mono-spk-dmic1-mic/HiFi.conf | 1 - .../ucm/bytcr-rt5640-mono-spk-in1-mic/HiFi.conf | 1 - .../ucm/bytcr-rt5640-mono-spk-in3-mic/HiFi.conf | 1 - .../bytcr-rt5640-stereo-spk-dmic1-mic/HiFi.conf | 1 - .../ucm/bytcr-rt5640-stereo-spk-in1-mic/HiFi.conf | 1 - .../ucm/bytcr-rt5640-stereo-spk-in3-mic/HiFi.conf | 1 - src/conf/ucm/bytcr-rt5640/HiFi.conf | 1 - .../ucm/bytcr-rt5651-mono-spk-in1-mic/HiFi.conf | 1 - .../HiFi.conf | 1 - .../ucm/bytcr-rt5651-mono-spk-in2-mic/HiFi.conf | 1 - .../ucm/bytcr-rt5651-stereo-spk-in1-mic/HiFi.conf | 1 - .../ucm/bytcr-rt5651-stereo-spk-in12-mic/HiFi.conf | 1 - .../ucm/bytcr-rt5651-stereo-spk-in2-mic/HiFi.conf | 1 - src/conf/ucm/bytcr-rt5651/HiFi.conf | 1 - src/conf/ucm/chtnau8824/HiFi.conf | 1 - src/conf/ucm/chtrt5645/HiFi.conf | 1 - .../HiFi.conf | 1 - src/ucm/parser.c | 3 -- src/ucm/ucm_local.h | 3 ++ src/ucm/utils.c | 7 ++++- 23 files changed, 41 insertions(+), 25 deletions(-) diff --git a/include/local.h b/include/local.h index b5e7b6f0..03d8f0cc 100644 --- a/include/local.h +++ b/include/local.h @@ -354,6 +354,9 @@ int snd_config_search_alias_hooks(snd_config_t *config, int _snd_conf_generic_id(const char *id); +int _snd_config_load_with_include(snd_config_t *config, snd_input_t *in, + const char *default_include_path); + /* convenience macros */ #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) diff --git a/src/conf.c b/src/conf.c index 254c4858..1f9bad7b 100644 --- a/src/conf.c +++ b/src/conf.c @@ -1832,7 +1832,8 @@ int snd_config_top(snd_config_t **config) return _snd_config_make(config, 0, SND_CONFIG_TYPE_COMPOUND); } -static int snd_config_load1(snd_config_t *config, snd_input_t *in, int override) +static int snd_config_load1(snd_config_t *config, snd_input_t *in, int override, + char *default_include_path) { int err; input_t input; @@ -1847,6 +1848,11 @@ static int snd_config_load1(snd_config_t *config, snd_input_t *in, int override) fd->column = 0; fd->next = NULL; INIT_LIST_HEAD(&fd->include_paths); + if (default_include_path) { + err = add_include_path(fd, default_include_path); + if (err < 0) + goto _end; + } input.current = fd; input.unget = 0; err = parse_defs(config, &input, 0, override); @@ -1915,9 +1921,29 @@ static int snd_config_load1(snd_config_t *config, snd_input_t *in, int override) */ int snd_config_load(snd_config_t *config, snd_input_t *in) { - return snd_config_load1(config, in, 0); + return snd_config_load1(config, in, 0, NULL); } +#ifndef DOC_HIDDEN +/* load config with the default include path; used internally for UCM parser */ +int _snd_config_load_with_include(snd_config_t *config, snd_input_t *in, + const char *default_include_path) +{ + int err; + char *s = NULL; + + if (default_include_path) { + s = strdup(default_include_path); + if (!s) + return -ENOMEM; + } + err = snd_config_load1(config, in, 0, s); + if (err < 0) + free(s); + return err; +} +#endif + /** * \brief Loads a configuration tree and overrides existing configuration nodes. * \param config Handle to a top level configuration node. @@ -1930,7 +1956,7 @@ int snd_config_load(snd_config_t *config, snd_input_t *in) */ int snd_config_load_override(snd_config_t *config, snd_input_t *in) { - return snd_config_load1(config, in, 1); + return snd_config_load1(config, in, 1, NULL); } /** diff --git a/src/conf/ucm/PIPO-W2S-Defaultstring-CherryTrailCR/HiFi.conf b/src/conf/ucm/PIPO-W2S-Defaultstring-CherryTrailCR/HiFi.conf index facc73ac..b931b791 100644 --- a/src/conf/ucm/PIPO-W2S-Defaultstring-CherryTrailCR/HiFi.conf +++ b/src/conf/ucm/PIPO-W2S-Defaultstring-CherryTrailCR/HiFi.conf @@ -1,4 +1,3 @@ - SectionVerb { diff --git a/src/conf/ucm/bytcr-rt5640-mono-spk-dmic1-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5640-mono-spk-dmic1-mic/HiFi.conf index c78cdfb8..0e21d6e1 100644 --- a/src/conf/ucm/bytcr-rt5640-mono-spk-dmic1-mic/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5640-mono-spk-dmic1-mic/HiFi.conf @@ -1,6 +1,5 @@ # Use case Configuration for bytcr-rt5640 - SectionVerb { EnableSequence [ diff --git a/src/conf/ucm/bytcr-rt5640-mono-spk-in1-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5640-mono-spk-in1-mic/HiFi.conf index 34a5d53d..d8ca499a 100644 --- a/src/conf/ucm/bytcr-rt5640-mono-spk-in1-mic/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5640-mono-spk-in1-mic/HiFi.conf @@ -1,6 +1,5 @@ # Use case Configuration for bytcr-rt5640 - SectionVerb { EnableSequence [ diff --git a/src/conf/ucm/bytcr-rt5640-mono-spk-in3-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5640-mono-spk-in3-mic/HiFi.conf index 0aa0c026..e4fb28df 100644 --- a/src/conf/ucm/bytcr-rt5640-mono-spk-in3-mic/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5640-mono-spk-in3-mic/HiFi.conf @@ -1,6 +1,5 @@ # Use case Configuration for bytcr-rt5640 - SectionVerb { EnableSequence [ diff --git a/src/conf/ucm/bytcr-rt5640-stereo-spk-dmic1-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5640-stereo-spk-dmic1-mic/HiFi.conf index e358d4f2..bb31bf53 100644 --- a/src/conf/ucm/bytcr-rt5640-stereo-spk-dmic1-mic/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5640-stereo-spk-dmic1-mic/HiFi.conf @@ -1,6 +1,5 @@ # Use case Configuration for bytcr-rt5640 - SectionVerb { EnableSequence [ diff --git a/src/conf/ucm/bytcr-rt5640-stereo-spk-in1-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5640-stereo-spk-in1-mic/HiFi.conf index 097560d0..9474a64e 100644 --- a/src/conf/ucm/bytcr-rt5640-stereo-spk-in1-mic/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5640-stereo-spk-in1-mic/HiFi.conf @@ -1,6 +1,5 @@ # Use case Configuration for bytcr-rt5640 - SectionVerb { EnableSequence [ diff --git a/src/conf/ucm/bytcr-rt5640-stereo-spk-in3-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5640-stereo-spk-in3-mic/HiFi.conf index 8a018f63..478130e6 100644 --- a/src/conf/ucm/bytcr-rt5640-stereo-spk-in3-mic/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5640-stereo-spk-in3-mic/HiFi.conf @@ -1,6 +1,5 @@ # Use case Configuration for bytcr-rt5640 - SectionVerb { EnableSequence [ diff --git a/src/conf/ucm/bytcr-rt5640/HiFi.conf b/src/conf/ucm/bytcr-rt5640/HiFi.conf index 20ebe2dd..54dd2517 100644 --- a/src/conf/ucm/bytcr-rt5640/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5640/HiFi.conf @@ -1,6 +1,5 @@ # Use case Configuration for bytcr-rt5640 - SectionVerb { EnableSequence [ diff --git a/src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/HiFi.conf index ca8a7d90..b93e0be3 100644 --- a/src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/HiFi.conf @@ -1,6 +1,5 @@ # Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651 - SectionVerb { EnableSequence [ diff --git a/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/HiFi.conf b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/HiFi.conf index 60ef6b33..ef048626 100644 --- a/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/HiFi.conf @@ -1,6 +1,5 @@ # Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651 - SectionVerb { EnableSequence [ diff --git a/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/HiFi.conf index e75210d4..c324c14a 100644 --- a/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/HiFi.conf @@ -1,6 +1,5 @@ # Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651 - SectionVerb { EnableSequence [ diff --git a/src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/HiFi.conf index 2b7675bc..aa1a1cde 100644 --- a/src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/HiFi.conf @@ -1,6 +1,5 @@ # Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651 - SectionVerb { EnableSequence [ diff --git a/src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/HiFi.conf index 7a8c94bc..343aed21 100644 --- a/src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/HiFi.conf @@ -1,6 +1,5 @@ # Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651 - SectionVerb { EnableSequence [ diff --git a/src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/HiFi.conf index 45c7837c..6f6d74cf 100644 --- a/src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/HiFi.conf @@ -1,6 +1,5 @@ # Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651 - SectionVerb { EnableSequence [ diff --git a/src/conf/ucm/bytcr-rt5651/HiFi.conf b/src/conf/ucm/bytcr-rt5651/HiFi.conf index d3928e9b..fddd8a3c 100644 --- a/src/conf/ucm/bytcr-rt5651/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5651/HiFi.conf @@ -1,6 +1,5 @@ # Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651 - SectionVerb { EnableSequence [ diff --git a/src/conf/ucm/chtnau8824/HiFi.conf b/src/conf/ucm/chtnau8824/HiFi.conf index 97a7ac7b..845cbcaf 100644 --- a/src/conf/ucm/chtnau8824/HiFi.conf +++ b/src/conf/ucm/chtnau8824/HiFi.conf @@ -1,4 +1,3 @@ - SectionVerb { diff --git a/src/conf/ucm/chtrt5645/HiFi.conf b/src/conf/ucm/chtrt5645/HiFi.conf index 6a3c6875..422f3b7e 100644 --- a/src/conf/ucm/chtrt5645/HiFi.conf +++ b/src/conf/ucm/chtrt5645/HiFi.conf @@ -1,4 +1,3 @@ - SectionVerb { # ALSA PCM diff --git a/src/conf/ucm/cube-i1_TF-Defaultstring-CherryTrailCR/HiFi.conf b/src/conf/ucm/cube-i1_TF-Defaultstring-CherryTrailCR/HiFi.conf index facc73ac..b931b791 100644 --- a/src/conf/ucm/cube-i1_TF-Defaultstring-CherryTrailCR/HiFi.conf +++ b/src/conf/ucm/cube-i1_TF-Defaultstring-CherryTrailCR/HiFi.conf @@ -1,4 +1,3 @@ - SectionVerb { diff --git a/src/ucm/parser.c b/src/ucm/parser.c index 2b6f1159..5e1a8862 100644 --- a/src/ucm/parser.c +++ b/src/ucm/parser.c @@ -34,9 +34,6 @@ #include #include -/** The name of the environment variable containing the UCM directory */ -#define ALSA_CONFIG_UCM_VAR "ALSA_CONFIG_UCM" - /* Directories to store UCM configuration files for components, like * off-soc codecs or embedded DSPs. Components can define their own * devices and sequences, to be reused by sound cards/machines. UCM diff --git a/src/ucm/ucm_local.h b/src/ucm/ucm_local.h index ce2fc6ea..8e7ac7ea 100644 --- a/src/ucm/ucm_local.h +++ b/src/ucm/ucm_local.h @@ -243,3 +243,6 @@ void uc_mgr_free_sequence_element(struct sequence_element *seq); void uc_mgr_free_transition_element(struct transition_sequence *seq); void uc_mgr_free_verb(snd_use_case_mgr_t *uc_mgr); void uc_mgr_free(snd_use_case_mgr_t *uc_mgr); + +/** The name of the environment variable containing the UCM directory */ +#define ALSA_CONFIG_UCM_VAR "ALSA_CONFIG_UCM" diff --git a/src/ucm/utils.c b/src/ucm/utils.c index 18785488..ea5ac5dd 100644 --- a/src/ucm/utils.c +++ b/src/ucm/utils.c @@ -54,6 +54,7 @@ int uc_mgr_config_load(const char *file, snd_config_t **cfg) FILE *fp; snd_input_t *in; snd_config_t *top; + const char *default_path; int err; fp = fopen(file, "r"); @@ -70,7 +71,11 @@ int uc_mgr_config_load(const char *file, snd_config_t **cfg) err = snd_config_top(&top); if (err < 0) return err; - err = snd_config_load(top, in); + + default_path = getenv(ALSA_CONFIG_UCM_VAR); + if (!default_path || !*default_path) + default_path = ALSA_CONFIG_DIR "/ucm"; + err = _snd_config_load_with_include(top, in, default_path); if (err < 0) { uc_error("could not load configuration file %s", file); snd_config_delete(top); -- cgit v1.2.3 From ee64b4b83afc0b1bdf99e1ccf7e6ea4602ef613f Mon Sep 17 00:00:00 2001 From: Timo Wischer Date: Mon, 10 Dec 2018 11:33:16 +0100 Subject: pcm: extplug: Keep format and channels the same if requested Without this patch it is not possible to link the channel and format parameter if snd_pcm_extplug_set_param_*() or snd_pcm_extplug_set_slave_param_*() is called. Therefore the client and slave parameter can differ. So the extplug has to implement conversion. To avoid this the new snd_pcm_extplug_set_param_link() function can be called. As a reproduction sceanrio the following extplug source code can be used: === static snd_pcm_sframes_t my_transfer(snd_pcm_extplug_t *e, const snd_pcm_channel_area_t *da, snd_pcm_uframes_t dof, const snd_pcm_channel_area_t *sa, snd_pcm_uframes_t sof, snd_pcm_uframes_t s) { return s; } static const snd_pcm_extplug_callback_t my_own_callback = { .transfer = my_transfer }; SND_PCM_PLUGIN_DEFINE_FUNC(my_plug) { snd_config_iterator_t i, next; snd_config_t *slave = NULL; snd_pcm_extplug_t *myplug; snd_config_for_each(i, next, conf) { snd_config_t *n = snd_config_iterator_entry(i); const char *id; if (snd_config_get_id(n, &id) < 0) continue; if (strcmp(id, "comment") == 0 || strcmp(id, "type") == 0) continue; if (strcmp(id, "slave") == 0) { slave = n; continue; } return -EINVAL; } myplug = calloc(1, sizeof(*myplug)); myplug->version = SND_PCM_EXTPLUG_VERSION; myplug->callback = &my_own_callback; snd_pcm_extplug_create(myplug, name, root, slave, stream, mode); snd_pcm_extplug_set_param_minmax(myplug, SND_PCM_EXTPLUG_HW_CHANNELS, 1, 16); // snd_pcm_extplug_set_param_link(myplug, SND_PCM_EXTPLUG_HW_CHANNELS, 1); *pcmp = myplug->pcm; return 0; } SND_PCM_PLUGIN_SYMBOL(my_plug); === To use this plugin the following ALSA configuration is required: pcm.myplug { type my_plug slave.pcm hw:Dummy } With this configuration without this patch snd_pcm_hw_params_get_channels_max() will always return 16 channels independent of the supported channels of the dummy device. Due to that for example the start up of JACK would fail: $ modprobe snd_dummy $ jackd -d alsa -P myplug ALSA: cannot set channel count to 16 for playback ALSA: cannot configure playback channel Signed-off-by: Timo Wischer Signed-off-by: Takashi Iwai --- include/pcm_extplug.h | 2 ++ src/pcm/pcm_ext_parm.h | 1 + src/pcm/pcm_extplug.c | 36 +++++++++++++++++++++++++++++++++++- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/include/pcm_extplug.h b/include/pcm_extplug.h index ced934f2..e5c02d4d 100644 --- a/include/pcm_extplug.h +++ b/include/pcm_extplug.h @@ -184,6 +184,8 @@ int snd_pcm_extplug_set_param_list(snd_pcm_extplug_t *extplug, int type, unsigne int snd_pcm_extplug_set_param_minmax(snd_pcm_extplug_t *extplug, int type, unsigned int min, unsigned int max); int snd_pcm_extplug_set_slave_param_list(snd_pcm_extplug_t *extplug, int type, unsigned int num_list, const unsigned int *list); int snd_pcm_extplug_set_slave_param_minmax(snd_pcm_extplug_t *extplug, int type, unsigned int min, unsigned int max); +int snd_pcm_extplug_set_param_link(snd_pcm_extplug_t *extplug, int type, + int keep_link); /** * set the parameter constraint with a single value diff --git a/src/pcm/pcm_ext_parm.h b/src/pcm/pcm_ext_parm.h index d25f2ab6..7b99bef5 100644 --- a/src/pcm/pcm_ext_parm.h +++ b/src/pcm/pcm_ext_parm.h @@ -5,6 +5,7 @@ struct snd_ext_parm { unsigned int *list; unsigned int active: 1; unsigned int integer: 1; + unsigned int keep_link: 1; }; static inline snd_mask_t *hw_param_mask(snd_pcm_hw_params_t *params, diff --git a/src/pcm/pcm_extplug.c b/src/pcm/pcm_extplug.c index 1f887c54..94002dc4 100644 --- a/src/pcm/pcm_extplug.c +++ b/src/pcm/pcm_extplug.c @@ -249,7 +249,7 @@ static unsigned int get_links(struct snd_ext_parm *params) SND_PCM_HW_PARBIT_TICK_TIME); for (i = 0; i < SND_PCM_EXTPLUG_HW_PARAMS; i++) { - if (params[i].active) + if (params[i].active && !params[i].keep_link) links &= ~excl_parbits[i]; } return links; @@ -642,6 +642,17 @@ as former functions. To clear the parameter constraints, call #snd_pcm_extplug_params_reset() function. +When using snd_pcm_extplug_set_param_*() or snd_pcm_extplug_set_slave_param_*() +for any parameter. This parameter is no longer linked between the client and +slave PCM. Therefore it could differ and the extplug has to support conversion +between all valid parameter configurations. To keep the client and slave +parameter linked #snd_pcm_extplug_set_param_link() can be used for the +corresponding parameter. For example if the extplug does not support channel nor +format conversion the supported client parameters can be limited with +snd_pcm_extplug_set_param_*() and afterwards +#snd_pcm_extplug_set_param_link(ext, SND_PCM_EXTPLUG_HW_FORMAT, 1) and +#snd_pcm_extplug_set_param_link(ext, SND_PCM_EXTPLUG_HW_CHANNELS, 1) should be +called to keep the client and slave parameters the same. */ /** @@ -849,3 +860,26 @@ int snd_pcm_extplug_set_param_minmax(snd_pcm_extplug_t *extplug, int type, unsig return snd_ext_parm_set_minmax(&ext->params[type], min, max); } +/** + * @brief Keep the client and slave format/channels the same if requested. This + * is for example useful if this extplug does not support any channel + * conversion. + * @param extplug the extplug handle + * @param type parameter type + * @param keep_link if 1 the parameter identified by type will be kept the same + * for the client and slave PCM of this extplug + * @return 0 if successful, or a negative error code + */ +int snd_pcm_extplug_set_param_link(snd_pcm_extplug_t *extplug, int type, + int keep_link) +{ + extplug_priv_t *ext = extplug->pcm->private_data; + + if (type < 0 || type >= SND_PCM_EXTPLUG_HW_PARAMS) { + SNDERR("EXTPLUG: invalid parameter type %d", type); + return -EINVAL; + } + ext->params[type].keep_link = keep_link ? 1 : 0; + ext->sparams[type].keep_link = keep_link ? 1 : 0; + return 0; +} -- cgit v1.2.3 From d7ba06afce54f386eda1eec462f27824fb4c380f Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 19 Dec 2018 14:23:38 +0100 Subject: pcm: ioplug: Fix the regression of pulse plugin drain The recent change to support the drain via polling caused a regression for pulse plugin; with speaker-test -c2 -twav with pulse, it leads to either no sounds or stall. The only sensible behavior change in the commit wrt pulse plugin is that now it starts the stream before calling drain callback. This supposed to be correct, but it seems hitting a pulse plugin bug. The start before drain callback is only a matter of consistency, and since this doesn't work for the single existing plugin using drain callback, we don't need to stick with this behavior. For addressing the regression, we check the presence of the drain callback and start the stream only when it doesn't exist, i.e. only in drain-via-poll mode. Fixes: ce2095c41f28 ("pcm: ioplug: Implement proper drain behavior") Reported-by: Diego Viola Signed-off-by: Takashi Iwai --- src/pcm/pcm_ioplug.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pcm/pcm_ioplug.c b/src/pcm/pcm_ioplug.c index 881a1a85..1e25190a 100644 --- a/src/pcm/pcm_ioplug.c +++ b/src/pcm/pcm_ioplug.c @@ -537,9 +537,11 @@ static int snd_pcm_ioplug_drain(snd_pcm_t *pcm) return -EBADFD; case SND_PCM_STATE_PREPARED: if (pcm->stream == SND_PCM_STREAM_PLAYBACK) { - err = snd_pcm_ioplug_start(pcm); - if (err < 0) - goto unlock; + if (!io->data->callback->drain) { + err = snd_pcm_ioplug_start(pcm); + if (err < 0) + goto unlock; + } io->data->state = SND_PCM_STATE_DRAINING; } break; -- cgit v1.2.3 From 1da297fa5d41527dc8300b1e080662dbe0478fdb Mon Sep 17 00:00:00 2001 From: Russell Parker Date: Sat, 29 Dec 2018 21:35:26 -0800 Subject: conf/ucm: chtrt5650: Add UCM config for chtrt5650 Add a UCM configuration for the rt5650 codec. Tested on a Samsung Chromebook 3. Adapted with minor modifications from GitHub user evan-a-a's gist: https://gist.github.com/evan-a-a/86b2a698708074530e2d0ee7c6498767 Signed-off-by: Russell Parker Signed-off-by: Jaroslav Kysela --- configure.ac | 1 + src/conf/ucm/Makefile.am | 1 + src/conf/ucm/chtrt5650/HiFi.conf | 203 ++++++++++++++++++++++++++++++++++ src/conf/ucm/chtrt5650/Makefile.am | 4 + src/conf/ucm/chtrt5650/chtrt5650.conf | 5 + 5 files changed, 214 insertions(+) create mode 100644 src/conf/ucm/chtrt5650/HiFi.conf create mode 100644 src/conf/ucm/chtrt5650/Makefile.am create mode 100644 src/conf/ucm/chtrt5650/chtrt5650.conf diff --git a/configure.ac b/configure.ac index d0cab2d6..d524ff4b 100644 --- a/configure.ac +++ b/configure.ac @@ -737,6 +737,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \ src/conf/ucm/chtnau8824/Makefile \ src/conf/ucm/chtrt5645/Makefile \ src/conf/ucm/chtrt5645-mono-speaker-analog-mic/Makefile \ + src/conf/ucm/chtrt5650/Makefile \ src/conf/ucm/cube-i1_TF-Defaultstring-CherryTrailCR/Makefile \ src/conf/ucm/DAISY-I2S/Makefile \ src/conf/ucm/DB410c/Makefile \ diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am index 85c15090..985c460c 100644 --- a/src/conf/ucm/Makefile.am +++ b/src/conf/ucm/Makefile.am @@ -21,6 +21,7 @@ bytcr-rt5651-stereo-spk-in12-mic \ chtnau8824 \ chtrt5645 \ chtrt5645-mono-speaker-analog-mic \ +chtrt5650 \ cube-i1_TF-Defaultstring-CherryTrailCR \ DAISY-I2S \ DB410c \ diff --git a/src/conf/ucm/chtrt5650/HiFi.conf b/src/conf/ucm/chtrt5650/HiFi.conf new file mode 100644 index 00000000..cc3d64bf --- /dev/null +++ b/src/conf/ucm/chtrt5650/HiFi.conf @@ -0,0 +1,203 @@ + +SectionVerb { + # ALSA PCM + Value { + TQ "HiFi" + + # ALSA PCM device for HiFi + PlaybackPCM "hw:chtrt5650" + CapturePCM "hw:chtrt5650" + } + + EnableSequence [ + cdev "hw:chtrt5650" + + + + # Output Configuration + cset "name='DAC1 L Mux' IF1 DAC" + cset "name='DAC1 R Mux' IF1 DAC" + cset "name='DAC1 MIXL DAC1 Switch' 1" + cset "name='DAC1 MIXR DAC1 Switch' 1" + cset "name='Stereo DAC MIXL DAC L1 Switch' 1" + cset "name='Stereo DAC MIXR DAC R1 Switch' 1" + cset "name='Speaker HWEQ' 1,164,237,135,1,165,0,0,1,166,237,135,1,167,0,0,1,192,30,196,1,193,0,0,1,194,30,196,1,195,0,0,1,196,31,180,1,197,0,75,1,198,31,180,1,199,31,180,1,200,0,75,1,201,31,180,0,177,51,224" + cset "name='DAC1 Playback Volume' 77,77" + + cset "name='Speaker ClassD Playback Volume' 4" + + cset "name='DAC L2 Mux' IF2 DAC" + cset "name='DAC R2 Mux' IF2 DAC" + cset "name='Mono DAC MIXL DAC L2 Switch' on" + cset "name='Mono DAC MIXR DAC R2 Switch' on" + cset "name='DAC2 Playback Switch' on" + + cset "name='HPOVOL MIXL DAC1 Switch' on" + cset "name='HPOVOL MIXR DAC1 Switch' on" + cset "name='HPOVOL MIXL DAC2 Switch' on" + cset "name='HPOVOL MIXR DAC2 Switch' on" + cset "name='HPO MIX HPVOL Switch' on" + cset "name='HPOVOL L Switch' on" + cset "name='HPOVOL R Switch' on" + + cset "name='SPK MIXL DAC L1 Switch' on" + cset "name='SPK MIXR DAC R1 Switch' on" + cset "name='SPK MIXL DAC L2 Switch' on" + cset "name='SPK MIXR DAC R2 Switch' on" + cset "name='SPOL MIX SPKVOL L Switch' on" + cset "name='SPOR MIX SPKVOL R Switch' on" + cset "name='SPKVOL L Switch' on" + cset "name='SPKVOL R Switch' on" + + # Input Configuration + cset "name='Stereo1 DMIC Mux' 0" + cset "name='Stereo1 ADC2 Mux' 1" + cset "name='ADC Capture Switch' on" + cset "name='ADC Capture Volume' 74" + cset "name='ADC Boost Capture Volume' 3" + cset "name='Mono ADC Capture Volume' 74" + cset "name='Mono ADC Boost Capture Volume' 2" + cset "name='IN Capture Volume' 63" + cset "name='RT5650 IF1 ADC Mux' 0" + cset "name='I2S2 Func Switch' off" + ] + + DisableSequence [ + cdev "hw:chtrt5650" + + # Disable audio output path + cset "name='codec_out1 mix 0 pcm0_in Switch' off" + cset "name='media0_out mix 0 media1_in Switch' off" + + cset "name='media1_in Gain 0 Switch' off" + cset "name='pcm0_in Gain 0 Switch' off" + cset "name='codec_out1 Gain 0 Switch' off" + + # Disable audio input path + cset "name='pcm1_out mix 0 media_loop2_in Switch' off" + cset "name='media_loop2_out mix 0 codec_in0 Switch' off" + + cset "name='media_loop2_out Gain 0 Switch' off" + cset "name='pcm1_out Gain 0 Switch' off" + cset "name='codec_in0 Gain 0 Switch' off" + ] +} + +SectionDevice."Speaker" { + Comment "Speaker" + + Value { + PlaybackChannels "2" + } + + ConflictingDevice [ + "Headphones" + ] + + EnableSequence [ + cdev "hw:chtrt5650" + + cset "name='Headphone Switch' off" + cset "name='Headphone Channel Switch' off" + + cset "name='Ext Spk Switch' on" + cset "name='Speaker Channel Switch' on" + cset "name='Speaker Playback Volume' 31" + ] + + DisableSequence [ + cdev "hw:chtrt5650" + + cset "name='Ext Spk Switch' off" + cset "name='Speaker Channel Switch' off" + ] +} + +SectionDevice."Headphones" { + Comment "Headphones" + + Value { + PlaybackChannels "2" + JackControl "Headphone Jack" + JackHWMute "Speaker" + } + + ConflictingDevice [ + "Speaker" + ] + + EnableSequence [ + cdev "hw:chtrt5650" + + cset "name='Ext Spk Switch' off" + cset "name='Speaker Channel Switch' off" + + cset "name='Headphone Switch' on" + cset "name='Headphone Channel Switch' on" + cset "name='Headphone Playback Volume' 31" + ] + + DisableSequence [ + cdev "hw:chtrt5650" + + cset "name='Headphone Switch' off" + cset "name='Headphone Channel Switch' off" + ] +} + +SectionDevice."Mic".0 { + Comment "Internal Microphone" + + Value { + CaptureChannels "2" + CapturePriority "150" + } + + EnableSequence [ + cdev "hw:chtrt5650" + + cset "name='Int Mic Switch' on" + cset "name='Sto1 ADC MIXL ADC2 Switch' on" + cset "name='Sto1 ADC MIXR ADC2 Switch' on" + ] + + DisableSequence [ + cdev "hw:chtrt5650" + + cset "name='Sto1 ADC MIXL ADC2 Switch' off" + cset "name='Sto1 ADC MIXR ADC2 Switch' off" + cset "name='Int Mic Switch' off" + ] +} + +SectionDevice."HSMic".0 { + Comment "Headset Microphone" + + Value { + CaptureChannels "2" + JackControl "Headset Mic Jack" + JackHWMute "Mic" + } + + EnableSequence [ + cdev "hw:chtrt5650" + + cset "name='Headset Mic Switch' on" + cset "name='RECMIXL BST1 Switch' on" + cset "name='RECMIXR BST1 Switch' on" + cset "name='Sto1 ADC MIXL ADC1 Switch' on" + cset "name='Sto1 ADC MIXR ADC1 Switch' on" + cset "name='IN1 Boost' 1" + ] + + DisableSequence [ + cdev "hw:chtrt5650" + + cset "name='Headset Mic Switch' off" + cset "name='RECMIXL BST1 Switch' off" + cset "name='RECMIXR BST1 Switch' off" + cset "name='Sto1 ADC MIXL ADC1 Switch' off" + cset "name='Sto1 ADC MIXR ADC1 Switch' off" + cset "name='IN1 Boost' 0" + ] +} diff --git a/src/conf/ucm/chtrt5650/Makefile.am b/src/conf/ucm/chtrt5650/Makefile.am new file mode 100644 index 00000000..f506cd77 --- /dev/null +++ b/src/conf/ucm/chtrt5650/Makefile.am @@ -0,0 +1,4 @@ +alsaconfigdir = @ALSA_CONFIG_DIR@ +ucmdir = $(alsaconfigdir)/ucm/chtrt5650 +ucm_DATA = chtrt5650.conf HiFi.conf +EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/chtrt5650/chtrt5650.conf b/src/conf/ucm/chtrt5650/chtrt5650.conf new file mode 100644 index 00000000..dfc36c89 --- /dev/null +++ b/src/conf/ucm/chtrt5650/chtrt5650.conf @@ -0,0 +1,5 @@ +Comment "Intel SoC Audio Device" +SectionUseCase."HiFi" { + File "HiFi.conf" + Comment "Default" +} -- cgit v1.2.3 From 05aab8deab572c1c4407573e60a217b80ccd7fc5 Mon Sep 17 00:00:00 2001 From: Hui Wang Date: Mon, 24 Dec 2018 16:34:46 +0800 Subject: conf/ucm: kblrt5660: Add ucm setting for Dell Edge IoT platform The new generation of Dell Edge IoT platform is based on Intel Kabylake platform, and the audio codec is ALC3277 which is 100% compatible with RT5660 in I2S mode. The audio design on this IoT platform is as below: - Intel kabylake platform - connect the codec ALC3277 via SSP0 - line-out and line-in with Micbias jacks - line-out mute control and jack detection of line-out and line-in - two HDMI ports with audio capability Signed-off-by: Hui Wang Signed-off-by: Takashi Iwai --- configure.ac | 1 + src/conf/ucm/Makefile.am | 1 + src/conf/ucm/kblrt5660/Hdmi1 | 20 +++++++++ src/conf/ucm/kblrt5660/Hdmi2 | 20 +++++++++ src/conf/ucm/kblrt5660/HiFi | 85 +++++++++++++++++++++++++++++++++++ src/conf/ucm/kblrt5660/Makefile.am | 4 ++ src/conf/ucm/kblrt5660/kblrt5660.conf | 18 ++++++++ 7 files changed, 149 insertions(+) create mode 100755 src/conf/ucm/kblrt5660/Hdmi1 create mode 100755 src/conf/ucm/kblrt5660/Hdmi2 create mode 100755 src/conf/ucm/kblrt5660/HiFi create mode 100755 src/conf/ucm/kblrt5660/Makefile.am create mode 100755 src/conf/ucm/kblrt5660/kblrt5660.conf diff --git a/configure.ac b/configure.ac index d524ff4b..6533e3fe 100644 --- a/configure.ac +++ b/configure.ac @@ -746,6 +746,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \ src/conf/ucm/gpd-win-pocket-rt5645/Makefile \ src/conf/ucm/HDAudio-Gigabyte-ALC1220DualCodecs/Makefile \ src/conf/ucm/HDAudio-Lenovo-DualCodecs/Makefile \ + src/conf/ucm/kblrt5660/Makefile \ src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/Makefile \ src/conf/ucm/PandaBoard/Makefile \ src/conf/ucm/PandaBoardES/Makefile \ diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am index 985c460c..601f7967 100644 --- a/src/conf/ucm/Makefile.am +++ b/src/conf/ucm/Makefile.am @@ -30,6 +30,7 @@ GoogleNyan \ gpd-win-pocket-rt5645 \ HDAudio-Gigabyte-ALC1220DualCodecs \ HDAudio-Lenovo-DualCodecs \ +kblrt5660 \ LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216 \ PandaBoard \ PandaBoardES \ diff --git a/src/conf/ucm/kblrt5660/Hdmi1 b/src/conf/ucm/kblrt5660/Hdmi1 new file mode 100755 index 00000000..95e6187a --- /dev/null +++ b/src/conf/ucm/kblrt5660/Hdmi1 @@ -0,0 +1,20 @@ +# Usecase for device HDMI1/Display Port stereo playback on Intel KABYLAKE platforms +# For Audio in I2S mode + +SectionDevice."Hdmi1" { + Comment "HDMI/Display Port 1 Stereo" + + EnableSequence [ + ] + + DisableSequence [ + ] + + Value { + PlaybackPCM "hw:kblrt5660,2" + PlaybackChannels "2" + PlaybackPriority "2" + JackControl "HDMI/DP, pcm=4 Jack" + } +} + diff --git a/src/conf/ucm/kblrt5660/Hdmi2 b/src/conf/ucm/kblrt5660/Hdmi2 new file mode 100755 index 00000000..f6d2feee --- /dev/null +++ b/src/conf/ucm/kblrt5660/Hdmi2 @@ -0,0 +1,20 @@ +# Usecase for device HDMI2/Display Port stereo playback on Intel KABYLAKE platforms +# For Audio in I2S mode + +SectionDevice."Hdmi2" { + Comment "HDMI/Display Port 2 Stereo" + + EnableSequence [ + ] + + DisableSequence [ + ] + + Value { + PlaybackPCM "hw:kblrt5660,3" + PlaybackChannels "2" + PlaybackPriority "3" + JackControl "HDMI/DP, pcm=5 Jack" + } +} + diff --git a/src/conf/ucm/kblrt5660/HiFi b/src/conf/ucm/kblrt5660/HiFi new file mode 100755 index 00000000..dbdb9006 --- /dev/null +++ b/src/conf/ucm/kblrt5660/HiFi @@ -0,0 +1,85 @@ +# UCM for Intel Kabylake platforms with RT5660 +# For Audio in I2S mode + +SectionVerb { + + EnableSequence [ + ] + + DisableSequence [ + ] + + # ALSA PCM + Value { + # ALSA PCM device for HiFi + PlaybackPCM "hw:kblrt5660,0" + CapturePCM "hw:kblrt5660,1" + } +} + +SectionDevice."LineOut" { + Comment "LineOut playback" + + EnableSequence [ + cdev "hw:kblrt5660" + cset "name='DAC1 Playback Volume' 30" + cset "name='OUT Playback Volume' 19" + cset "name='OUT Playback Switch' on" + cset "name='codec0_out mo media0_in mi Switch' on" + cset "name='DAC1 MIXL DAC1 Switch' on" + cset "name='DAC1 MIXR DAC1 Switch' on" + cset "name='Stereo DAC MIXL DAC L1 Switch' on" + cset "name='Stereo DAC MIXR DAC L1 Switch' off" + cset "name='Stereo DAC MIXR DAC R1 Switch' on" + cset "name='Stereo DAC MIXL DAC R1 Switch' off" + cset "name='LOUT MIX DAC Switch' on" + cset "name='Line Out Switch' on" + ] + + DisableSequence [ + cdev "hw:kblrt5660" + cset "name='Line Out Switch' off" + cset "name='DAC1 MIXL DAC1' off" + cset "name='DAC1 MIXR DAC1' off" + ] + + Value { + PlaybackChannels "2" + JackDev "rt5660-jack" + JackControl "Line Out Jack" + } +} + +SectionDevice."LineIn" { + Comment "LineIn capture" + + EnableSequence [ + cdev "hw:kblrt5660" + + cset "name='ADC Capture Volume' 30" + cset "name='IN1 Boost Volume' 30" + cset "name='IN2 Boost Volume' 30" + cset "name='STO1 ADC Boost Gain Volume' 1" + cset "name='RECMIXL BST1 Switch' off" + cset "name='RECMIXR BST1 Switch' on" + cset "name='RECMIXL BST2 Switch' on" + cset "name='RECMIXR BST2 Switch' off" + cset "name='Line In Switch' on" + cset "name='Sto1 ADC MIXR ADC1 Switch' on" + cset "name='Sto1 ADC MIXL ADC1 Switch' on" + cset "name='media0_out mo codec0_in mi Switch' on" + ] + + DisableSequence [ + cdev "hw:kblrt5660" + cset "name='Line In Switch' off" + cset "name='Sto1 ADC MIXR ADC1 Switch' off" + cset "name='Sto1 ADC MIXL ADC1 Switch' off" + ] + + Value { + CaptureChannels "2" + JackDev "rt5660-jack" + JackControl "Line In Jack" + } +} diff --git a/src/conf/ucm/kblrt5660/Makefile.am b/src/conf/ucm/kblrt5660/Makefile.am new file mode 100755 index 00000000..83c3743a --- /dev/null +++ b/src/conf/ucm/kblrt5660/Makefile.am @@ -0,0 +1,4 @@ +alsaconfigdir = @ALSA_CONFIG_DIR@ +ucmdir = $(alsaconfigdir)/ucm/kblrt5660 +ucm_DATA = kblrt5660.conf HiFi Hdmi1 Hdmi2 +EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/kblrt5660/kblrt5660.conf b/src/conf/ucm/kblrt5660/kblrt5660.conf new file mode 100755 index 00000000..c5e9420e --- /dev/null +++ b/src/conf/ucm/kblrt5660/kblrt5660.conf @@ -0,0 +1,18 @@ +SectionUseCase."HiFi" { + File "HiFi" + Comment "Play HiFi quality Music" +} + +SectionUseCase."Hdmi1" { + File "Hdmi1" + Comment "Play on Hdmi/DP 1" +} + +SectionUseCase."Hdmi2" { + File "Hdmi2" + Comment "Play on Hdmi/DP 2" +} + +SectionDefaults [ + cdev "hw:kblrt5660" +] -- cgit v1.2.3 From d827856fca4541617f5c699223f17435f8789671 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 24 Dec 2018 16:05:01 +0100 Subject: conf/ucm: bytcr-rt5651: Enable Stereo? ADC MIXL ADC? switches when enabling inputs Explicitly enable the right 'Stereo? ADC MIXL ADC?' when selecting an input, rather then just enabling them all in ucm/codecs/rt5651/EnableSeq.conf . This is a preparation patch for adding digital mic support. Signed-off-by: Hans de Goede Signed-off-by: Takashi Iwai --- src/conf/ucm/codecs/rt5651/EnableSeq.conf | 16 ++++++++-------- src/conf/ucm/codecs/rt5651/IN1-InternalMic.conf | 4 ++++ src/conf/ucm/codecs/rt5651/IN12-InternalMic.conf | 4 ++++ src/conf/ucm/codecs/rt5651/IN2-InternalMic.conf | 4 ++++ src/conf/ucm/codecs/rt5651/IN3-HeadsetMic.conf | 4 ++++ 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/conf/ucm/codecs/rt5651/EnableSeq.conf b/src/conf/ucm/codecs/rt5651/EnableSeq.conf index 6fb3c1f2..db2fd328 100644 --- a/src/conf/ucm/codecs/rt5651/EnableSeq.conf +++ b/src/conf/ucm/codecs/rt5651/EnableSeq.conf @@ -14,12 +14,14 @@ cset "name='Stereo DAC MIXL DAC L1 Switch' on" cset "name='Stereo DAC MIXL DAC R1 Switch' off" cset "name='Stereo DAC MIXR DAC L1 Switch' off" 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='Stereo1 ADC MIXL ADC1 Switch' off" +cset "name='Stereo1 ADC MIXR ADC1 Switch' off" +cset "name='Stereo1 ADC MIXL ADC2 Switch' off" +cset "name='Stereo1 ADC MIXR ADC2 Switch' off" +cset "name='Stereo2 ADC MIXL ADC1 Switch' off" +cset "name='Stereo2 ADC MIXR ADC1 Switch' off" +cset "name='Stereo2 ADC MIXL ADC2 Switch' off" +cset "name='Stereo2 ADC MIXR ADC2 Switch' off" cset "name='Headphone Switch' off" cset "name='Speaker Switch' off" @@ -41,8 +43,6 @@ cset "name='IN3 Boost' 1" # 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" diff --git a/src/conf/ucm/codecs/rt5651/IN1-InternalMic.conf b/src/conf/ucm/codecs/rt5651/IN1-InternalMic.conf index 85e25a5c..b2ce17b6 100644 --- a/src/conf/ucm/codecs/rt5651/IN1-InternalMic.conf +++ b/src/conf/ucm/codecs/rt5651/IN1-InternalMic.conf @@ -12,10 +12,14 @@ SectionDevice."InternalMic-IN1" { cset "name='Internal Mic Switch' on" cset "name='RECMIXL BST1 Switch' on" cset "name='RECMIXR BST1 Switch' on" + cset "name='Stereo1 ADC MIXL ADC1 Switch' on" + cset "name='Stereo1 ADC MIXR ADC1 Switch' on" ] DisableSequence [ cdev "hw:bytcrrt5651" + cset "name='Stereo1 ADC MIXL ADC1 Switch' off" + cset "name='Stereo1 ADC MIXR ADC1 Switch' off" cset "name='Internal Mic Switch' off" cset "name='RECMIXL BST1 Switch' off" cset "name='RECMIXR BST1 Switch' off" diff --git a/src/conf/ucm/codecs/rt5651/IN12-InternalMic.conf b/src/conf/ucm/codecs/rt5651/IN12-InternalMic.conf index f1cc17fe..e8041912 100644 --- a/src/conf/ucm/codecs/rt5651/IN12-InternalMic.conf +++ b/src/conf/ucm/codecs/rt5651/IN12-InternalMic.conf @@ -14,10 +14,14 @@ SectionDevice."InternalMic-IN12" { cset "name='RECMIXR BST1 Switch' on" cset "name='RECMIXL BST2 Switch' on" cset "name='RECMIXR BST2 Switch' on" + cset "name='Stereo1 ADC MIXL ADC1 Switch' on" + cset "name='Stereo1 ADC MIXR ADC1 Switch' on" ] DisableSequence [ cdev "hw:bytcrrt5651" + cset "name='Stereo1 ADC MIXL ADC1 Switch' off" + cset "name='Stereo1 ADC MIXR ADC1 Switch' off" cset "name='Internal Mic Switch' off" cset "name='RECMIXL BST1 Switch' off" cset "name='RECMIXR BST1 Switch' off" diff --git a/src/conf/ucm/codecs/rt5651/IN2-InternalMic.conf b/src/conf/ucm/codecs/rt5651/IN2-InternalMic.conf index 18f74e1a..048fcc95 100644 --- a/src/conf/ucm/codecs/rt5651/IN2-InternalMic.conf +++ b/src/conf/ucm/codecs/rt5651/IN2-InternalMic.conf @@ -12,10 +12,14 @@ SectionDevice."InternalMic-IN2" { cset "name='Internal Mic Switch' on" cset "name='RECMIXL BST2 Switch' on" cset "name='RECMIXR BST2 Switch' on" + cset "name='Stereo1 ADC MIXL ADC1 Switch' on" + cset "name='Stereo1 ADC MIXR ADC1 Switch' on" ] DisableSequence [ cdev "hw:bytcrrt5651" + cset "name='Stereo1 ADC MIXL ADC1 Switch' off" + cset "name='Stereo1 ADC MIXR ADC1 Switch' off" cset "name='Internal Mic Switch' off" cset "name='RECMIXL BST2 Switch' off" cset "name='RECMIXR BST2 Switch' off" diff --git a/src/conf/ucm/codecs/rt5651/IN3-HeadsetMic.conf b/src/conf/ucm/codecs/rt5651/IN3-HeadsetMic.conf index bfd0b009..712d14bb 100644 --- a/src/conf/ucm/codecs/rt5651/IN3-HeadsetMic.conf +++ b/src/conf/ucm/codecs/rt5651/IN3-HeadsetMic.conf @@ -12,10 +12,14 @@ SectionDevice."HeadsetMic-IN3" { cset "name='Headset Mic Switch' on" cset "name='RECMIXL BST3 Switch' on" cset "name='RECMIXR BST3 Switch' on" + cset "name='Stereo1 ADC MIXL ADC1 Switch' on" + cset "name='Stereo1 ADC MIXR ADC1 Switch' on" ] DisableSequence [ cdev "hw:bytcrrt5651" + cset "name='Stereo1 ADC MIXL ADC1 Switch' off" + cset "name='Stereo1 ADC MIXR ADC1 Switch' off" cset "name='Headset Mic Switch' off" cset "name='RECMIXL BST3 Switch' off" cset "name='RECMIXR BST3 Switch' off" -- cgit v1.2.3 From 606350a726191f8b40c52fa0520f8642945c79fd Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 24 Dec 2018 16:05:02 +0100 Subject: conf/ucm: bytcr-rt5651: Add support for a headset-mic on IN2 The first design with the headset-mic on IN2 rather then the default / reference-design IN3 has shown up. Add a new ucm/codecs/rt5651/IN2-HeadsetMic.conf snippet to deal with this and include this in the default non board-specific bytcr-rt5651.conf. Signed-off-by: Hans de Goede Signed-off-by: Takashi Iwai --- src/conf/ucm/bytcr-rt5651/HiFi.conf | 1 + src/conf/ucm/codecs/rt5651/IN1-InternalMic.conf | 1 + src/conf/ucm/codecs/rt5651/IN12-InternalMic.conf | 1 + src/conf/ucm/codecs/rt5651/IN2-HeadsetMic.conf | 33 ++++++++++++++++++++++++ src/conf/ucm/codecs/rt5651/IN2-InternalMic.conf | 1 + src/conf/ucm/codecs/rt5651/IN3-HeadsetMic.conf | 3 ++- src/conf/ucm/codecs/rt5651/Makefile.am | 2 +- 7 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 src/conf/ucm/codecs/rt5651/IN2-HeadsetMic.conf diff --git a/src/conf/ucm/bytcr-rt5651/HiFi.conf b/src/conf/ucm/bytcr-rt5651/HiFi.conf index fddd8a3c..37bb1d40 100644 --- a/src/conf/ucm/bytcr-rt5651/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5651/HiFi.conf @@ -26,4 +26,5 @@ SectionVerb { + diff --git a/src/conf/ucm/codecs/rt5651/IN1-InternalMic.conf b/src/conf/ucm/codecs/rt5651/IN1-InternalMic.conf index b2ce17b6..5092809f 100644 --- a/src/conf/ucm/codecs/rt5651/IN1-InternalMic.conf +++ b/src/conf/ucm/codecs/rt5651/IN1-InternalMic.conf @@ -4,6 +4,7 @@ SectionDevice."InternalMic-IN1" { ConflictingDevice [ "InternalMic-IN2" "InternalMic-IN12" + "HeadsetMic-IN2" "HeadsetMic-IN3" ] diff --git a/src/conf/ucm/codecs/rt5651/IN12-InternalMic.conf b/src/conf/ucm/codecs/rt5651/IN12-InternalMic.conf index e8041912..c917e85e 100644 --- a/src/conf/ucm/codecs/rt5651/IN12-InternalMic.conf +++ b/src/conf/ucm/codecs/rt5651/IN12-InternalMic.conf @@ -4,6 +4,7 @@ SectionDevice."InternalMic-IN12" { ConflictingDevice [ "InternalMic-IN1" "InternalMic-IN2" + "HeadsetMic-IN2" "HeadsetMic-IN3" ] diff --git a/src/conf/ucm/codecs/rt5651/IN2-HeadsetMic.conf b/src/conf/ucm/codecs/rt5651/IN2-HeadsetMic.conf new file mode 100644 index 00000000..b6dc0814 --- /dev/null +++ b/src/conf/ucm/codecs/rt5651/IN2-HeadsetMic.conf @@ -0,0 +1,33 @@ +SectionDevice."HeadsetMic-IN2" { + Comment "Headset Microphone on IN2" + + ConflictingDevice [ + "InternalMic-IN1" + "InternalMic-IN2" + "InternalMic-IN12" + "HeadsetMic-IN3" + ] + + EnableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Headset Mic Switch' on" + cset "name='RECMIXL BST2 Switch' on" + cset "name='RECMIXR BST2 Switch' on" + cset "name='Stereo1 ADC MIXL ADC1 Switch' on" + cset "name='Stereo1 ADC MIXR ADC1 Switch' on" + ] + + DisableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Stereo1 ADC MIXL ADC1 Switch' off" + cset "name='Stereo1 ADC MIXR ADC1 Switch' off" + cset "name='Headset Mic Switch' off" + cset "name='RECMIXL BST2 Switch' off" + cset "name='RECMIXR BST2 Switch' off" + ] + + Value { + CaptureChannels "2" + JackControl "Headset Mic Jack" + } +} diff --git a/src/conf/ucm/codecs/rt5651/IN2-InternalMic.conf b/src/conf/ucm/codecs/rt5651/IN2-InternalMic.conf index 048fcc95..bbb713c0 100644 --- a/src/conf/ucm/codecs/rt5651/IN2-InternalMic.conf +++ b/src/conf/ucm/codecs/rt5651/IN2-InternalMic.conf @@ -4,6 +4,7 @@ SectionDevice."InternalMic-IN2" { ConflictingDevice [ "InternalMic-IN1" "InternalMic-IN12" + "HeadsetMic-IN2" "HeadsetMic-IN3" ] diff --git a/src/conf/ucm/codecs/rt5651/IN3-HeadsetMic.conf b/src/conf/ucm/codecs/rt5651/IN3-HeadsetMic.conf index 712d14bb..48f3e463 100644 --- a/src/conf/ucm/codecs/rt5651/IN3-HeadsetMic.conf +++ b/src/conf/ucm/codecs/rt5651/IN3-HeadsetMic.conf @@ -1,10 +1,11 @@ SectionDevice."HeadsetMic-IN3" { - Comment "Headset Microphone" + Comment "Headset Microphone on IN3" ConflictingDevice [ "InternalMic-IN1" "InternalMic-IN2" "InternalMic-IN12" + "HeadsetMic-IN2" ] EnableSequence [ diff --git a/src/conf/ucm/codecs/rt5651/Makefile.am b/src/conf/ucm/codecs/rt5651/Makefile.am index a68bd7bb..889b4fd4 100644 --- a/src/conf/ucm/codecs/rt5651/Makefile.am +++ b/src/conf/ucm/codecs/rt5651/Makefile.am @@ -2,5 +2,5 @@ alsaconfigdir = @ALSA_CONFIG_DIR@ ucmdir = $(alsaconfigdir)/ucm/codecs/rt5651 ucm_DATA = EnableSeq.conf HeadPhones.conf HeadPhones-swapped.conf \ IN1-InternalMic.conf IN2-InternalMic.conf IN12-InternalMic.conf \ - IN3-HeadsetMic.conf Speaker.conf MonoSpeaker.conf + IN2-HeadsetMic.conf IN3-HeadsetMic.conf Speaker.conf MonoSpeaker.conf EXTRA_DIST = $(ucm_DATA) -- cgit v1.2.3 From 8f4e5d0da2613584d0469ed417a614ed54acaa2a Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 24 Dec 2018 16:05:03 +0100 Subject: conf/ucm: bytcr-rt5651: Add digital mic support Add a new ucm/codecs/rt5651/DigitalMic.conf snippet for digital mic support and include this in the default non board-specific bytcr-rt5651.conf. Signed-off-by: Hans de Goede Signed-off-by: Takashi Iwai --- src/conf/ucm/bytcr-rt5651/HiFi.conf | 1 + src/conf/ucm/codecs/rt5651/DigitalMic.conf | 29 ++++++++++++++++++++++++ src/conf/ucm/codecs/rt5651/EnableSeq.conf | 2 ++ src/conf/ucm/codecs/rt5651/IN1-InternalMic.conf | 1 + src/conf/ucm/codecs/rt5651/IN12-InternalMic.conf | 1 + src/conf/ucm/codecs/rt5651/IN2-HeadsetMic.conf | 1 + src/conf/ucm/codecs/rt5651/IN2-InternalMic.conf | 1 + src/conf/ucm/codecs/rt5651/IN3-HeadsetMic.conf | 1 + src/conf/ucm/codecs/rt5651/Makefile.am | 3 ++- 9 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/conf/ucm/codecs/rt5651/DigitalMic.conf diff --git a/src/conf/ucm/bytcr-rt5651/HiFi.conf b/src/conf/ucm/bytcr-rt5651/HiFi.conf index 37bb1d40..8fcc5a8c 100644 --- a/src/conf/ucm/bytcr-rt5651/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5651/HiFi.conf @@ -23,6 +23,7 @@ SectionVerb { + diff --git a/src/conf/ucm/codecs/rt5651/DigitalMic.conf b/src/conf/ucm/codecs/rt5651/DigitalMic.conf new file mode 100644 index 00000000..63ffa9d5 --- /dev/null +++ b/src/conf/ucm/codecs/rt5651/DigitalMic.conf @@ -0,0 +1,29 @@ +SectionDevice."DigitalMic" { + Comment "Internal Digital Microphone" + + ConflictingDevice [ + "InternalMic-IN1" + "InternalMic-IN2" + "InternalMic-IN12" + "HeadsetMic-IN2" + "HeadsetMic-IN3" + ] + + EnableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Stereo1 ADC MIXL ADC2 Switch' on" + cset "name='Stereo1 ADC MIXR ADC2 Switch' on" + cset "name='Internal Mic Switch' on" + ] + + DisableSequence [ + cdev "hw:bytcrrt5651" + cset "name='Stereo1 ADC MIXL ADC2 Switch' off" + cset "name='Stereo1 ADC MIXR ADC2 Switch' off" + cset "name='Internal Mic Switch' off" + ] + + Value { + CaptureChannels 2 + } +} diff --git a/src/conf/ucm/codecs/rt5651/EnableSeq.conf b/src/conf/ucm/codecs/rt5651/EnableSeq.conf index db2fd328..9c1386fa 100644 --- a/src/conf/ucm/codecs/rt5651/EnableSeq.conf +++ b/src/conf/ucm/codecs/rt5651/EnableSeq.conf @@ -43,6 +43,8 @@ cset "name='IN3 Boost' 1" # input cset "name='Stereo1 ADC L1 Mux' ADC" cset "name='Stereo1 ADC R1 Mux' ADC" +cset "name='Stereo1 ADC L2 Mux' DMIC" +cset "name='Stereo1 ADC R2 Mux' DMIC" cset "name='RECMIXL BST1 Switch' off" cset "name='RECMIXR BST1 Switch' off" cset "name='RECMIXL BST3 Switch' off" diff --git a/src/conf/ucm/codecs/rt5651/IN1-InternalMic.conf b/src/conf/ucm/codecs/rt5651/IN1-InternalMic.conf index 5092809f..12ab5cbc 100644 --- a/src/conf/ucm/codecs/rt5651/IN1-InternalMic.conf +++ b/src/conf/ucm/codecs/rt5651/IN1-InternalMic.conf @@ -2,6 +2,7 @@ SectionDevice."InternalMic-IN1" { Comment "Internal Microphone on IN1" ConflictingDevice [ + "DigitalMic" "InternalMic-IN2" "InternalMic-IN12" "HeadsetMic-IN2" diff --git a/src/conf/ucm/codecs/rt5651/IN12-InternalMic.conf b/src/conf/ucm/codecs/rt5651/IN12-InternalMic.conf index c917e85e..c4290b75 100644 --- a/src/conf/ucm/codecs/rt5651/IN12-InternalMic.conf +++ b/src/conf/ucm/codecs/rt5651/IN12-InternalMic.conf @@ -2,6 +2,7 @@ SectionDevice."InternalMic-IN12" { Comment "Internal Microphones on IN1 and IN2" ConflictingDevice [ + "DigitalMic" "InternalMic-IN1" "InternalMic-IN2" "HeadsetMic-IN2" diff --git a/src/conf/ucm/codecs/rt5651/IN2-HeadsetMic.conf b/src/conf/ucm/codecs/rt5651/IN2-HeadsetMic.conf index b6dc0814..8759c274 100644 --- a/src/conf/ucm/codecs/rt5651/IN2-HeadsetMic.conf +++ b/src/conf/ucm/codecs/rt5651/IN2-HeadsetMic.conf @@ -2,6 +2,7 @@ SectionDevice."HeadsetMic-IN2" { Comment "Headset Microphone on IN2" ConflictingDevice [ + "DigitalMic" "InternalMic-IN1" "InternalMic-IN2" "InternalMic-IN12" diff --git a/src/conf/ucm/codecs/rt5651/IN2-InternalMic.conf b/src/conf/ucm/codecs/rt5651/IN2-InternalMic.conf index bbb713c0..c9c11c28 100644 --- a/src/conf/ucm/codecs/rt5651/IN2-InternalMic.conf +++ b/src/conf/ucm/codecs/rt5651/IN2-InternalMic.conf @@ -2,6 +2,7 @@ SectionDevice."InternalMic-IN2" { Comment "Internal Microphone on IN2" ConflictingDevice [ + "DigitalMic" "InternalMic-IN1" "InternalMic-IN12" "HeadsetMic-IN2" diff --git a/src/conf/ucm/codecs/rt5651/IN3-HeadsetMic.conf b/src/conf/ucm/codecs/rt5651/IN3-HeadsetMic.conf index 48f3e463..66af6b9b 100644 --- a/src/conf/ucm/codecs/rt5651/IN3-HeadsetMic.conf +++ b/src/conf/ucm/codecs/rt5651/IN3-HeadsetMic.conf @@ -2,6 +2,7 @@ SectionDevice."HeadsetMic-IN3" { Comment "Headset Microphone on IN3" ConflictingDevice [ + "DigitalMic" "InternalMic-IN1" "InternalMic-IN2" "InternalMic-IN12" diff --git a/src/conf/ucm/codecs/rt5651/Makefile.am b/src/conf/ucm/codecs/rt5651/Makefile.am index 889b4fd4..29b68437 100644 --- a/src/conf/ucm/codecs/rt5651/Makefile.am +++ b/src/conf/ucm/codecs/rt5651/Makefile.am @@ -1,6 +1,7 @@ alsaconfigdir = @ALSA_CONFIG_DIR@ ucmdir = $(alsaconfigdir)/ucm/codecs/rt5651 -ucm_DATA = EnableSeq.conf HeadPhones.conf HeadPhones-swapped.conf \ +ucm_DATA = DigitalMic.conf EnableSeq.conf \ + HeadPhones.conf HeadPhones-swapped.conf \ IN1-InternalMic.conf IN2-InternalMic.conf IN12-InternalMic.conf \ IN2-HeadsetMic.conf IN3-HeadsetMic.conf Speaker.conf MonoSpeaker.conf EXTRA_DIST = $(ucm_DATA) -- cgit v1.2.3 From ce674664d2e0fd02bcbd605bfbbf4a356489175a Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 24 Dec 2018 16:05:04 +0100 Subject: conf/ucm: bytcr-rt5651: Add bytcr-rt5651-stereo-spk-dmic-mic config Add a config for boards which use a digital mic as internal mic, combined with having the headset mic on in2. An example of such a board is the Point of View TAB-P1006W-232 (v1.0) tablet. Signed-off-by: Hans de Goede Signed-off-by: Takashi Iwai --- configure.ac | 1 + src/conf/ucm/Makefile.am | 1 + .../ucm/bytcr-rt5651-stereo-spk-dmic-mic/HiFi.conf | 26 ++++++++++++++++++++++ .../bytcr-rt5651-stereo-spk-dmic-mic/Makefile.am | 4 ++++ .../bytcr-rt5651-stereo-spk-dmic-mic.conf | 10 +++++++++ 5 files changed, 42 insertions(+) create mode 100644 src/conf/ucm/bytcr-rt5651-stereo-spk-dmic-mic/HiFi.conf create mode 100644 src/conf/ucm/bytcr-rt5651-stereo-spk-dmic-mic/Makefile.am create mode 100644 src/conf/ucm/bytcr-rt5651-stereo-spk-dmic-mic/bytcr-rt5651-stereo-spk-dmic-mic.conf diff --git a/configure.ac b/configure.ac index 6533e3fe..a0392bfe 100644 --- a/configure.ac +++ b/configure.ac @@ -731,6 +731,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \ src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/Makefile \ src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/Makefile \ src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/Makefile \ + src/conf/ucm/bytcr-rt5651-stereo-spk-dmic-mic/Makefile \ src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/Makefile \ src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/Makefile \ src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/Makefile \ diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am index 601f7967..c82637fa 100644 --- a/src/conf/ucm/Makefile.am +++ b/src/conf/ucm/Makefile.am @@ -15,6 +15,7 @@ bytcr-rt5651 \ bytcr-rt5651-mono-spk-in1-mic \ bytcr-rt5651-mono-spk-in2-mic \ bytcr-rt5651-mono-spk-in2-mic-hp-swapped \ +bytcr-rt5651-stereo-spk-dmic-mic \ bytcr-rt5651-stereo-spk-in1-mic \ bytcr-rt5651-stereo-spk-in2-mic \ bytcr-rt5651-stereo-spk-in12-mic \ diff --git a/src/conf/ucm/bytcr-rt5651-stereo-spk-dmic-mic/HiFi.conf b/src/conf/ucm/bytcr-rt5651-stereo-spk-dmic-mic/HiFi.conf new file mode 100644 index 00000000..abf5fc75 --- /dev/null +++ b/src/conf/ucm/bytcr-rt5651-stereo-spk-dmic-mic/HiFi.conf @@ -0,0 +1,26 @@ +# Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651 + + +SectionVerb { + EnableSequence [ + cdev "hw:bytcrrt5651" + + + ] + + DisableSequence [ + cdev "hw:bytcrrt5651" + + ] + + Value { + PlaybackPCM "hw:bytcrrt5651" + CapturePCM "hw:bytcrrt5651" + } +} + + + + + + diff --git a/src/conf/ucm/bytcr-rt5651-stereo-spk-dmic-mic/Makefile.am b/src/conf/ucm/bytcr-rt5651-stereo-spk-dmic-mic/Makefile.am new file mode 100644 index 00000000..07054501 --- /dev/null +++ b/src/conf/ucm/bytcr-rt5651-stereo-spk-dmic-mic/Makefile.am @@ -0,0 +1,4 @@ +alsaconfigdir = @ALSA_CONFIG_DIR@ +ucmdir = $(alsaconfigdir)/ucm/bytcr-rt5651-stereo-spk-dmic-mic +ucm_DATA = bytcr-rt5651-stereo-spk-dmic-mic.conf HiFi.conf +EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/bytcr-rt5651-stereo-spk-dmic-mic/bytcr-rt5651-stereo-spk-dmic-mic.conf b/src/conf/ucm/bytcr-rt5651-stereo-spk-dmic-mic/bytcr-rt5651-stereo-spk-dmic-mic.conf new file mode 100644 index 00000000..de8d954a --- /dev/null +++ b/src/conf/ucm/bytcr-rt5651-stereo-spk-dmic-mic/bytcr-rt5651-stereo-spk-dmic-mic.conf @@ -0,0 +1,10 @@ +# Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651 + +SectionUseCase."HiFi" { + File "../bytcr-rt5651-stereo-spk-dmic-mic/HiFi.conf" + Comment "Play HiFi quality Music" +} + +SectionDefaults [ + cdev "hw:bytcrrt5651" +] -- cgit v1.2.3 From 15ccbf303d2724c3633c1056cc526367a6c5ea3f Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 1 Jan 2019 12:32:46 +0100 Subject: conf/ucm: bytcr-rt5651: Document mono speaker wiring During my recent work on the bytcht-es8316 UCM profile I realized that the bytcr-rt5651 devices with a single speaker use a differential setup just like the es8316 does. The tell-tale here is the speaker going quiet when playing the exact same sound on both channels when things are configured for stereo speakers. I've run some tests and the rt5651 does have a special mono balanced out mode for its line-out but using this results in the same sound (and the same loudness / volume of the sound) as our current solution, so adding support for this to the kernel buys us nothing. This commit makes no changes, it just documents my findings in a big comment for future reference. Signed-off-by: Hans de Goede Signed-off-by: Takashi Iwai --- src/conf/ucm/codecs/rt5651/MonoSpeaker.conf | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/conf/ucm/codecs/rt5651/MonoSpeaker.conf b/src/conf/ucm/codecs/rt5651/MonoSpeaker.conf index 0c3492fb..f4181d10 100644 --- a/src/conf/ucm/codecs/rt5651/MonoSpeaker.conf +++ b/src/conf/ucm/codecs/rt5651/MonoSpeaker.conf @@ -9,7 +9,21 @@ SectionDevice."MonoSpeaker" { EnableSequence [ cdev "hw:bytcrrt5651" - # Map left and right input on left + # On most (all?) devices with a single / mono speaker an + # amplifier with a differential input connected between LOUT + # right and left is used. We deal with this by silencing the + # right output and mixing left + right to the left output. + # + # An alternative approach for devices using the differential + # setup would be to set bit 15 of register 5 in the codec, + # which turns the stereo unbalanced line out into a mono + # balanced line out. + # + # This possibility was discovered after we already shipped the + # current solution and the current solution has the advantage + # of also working on devices which only use LOUT left in + # unbalanced mode. The net result is the same for devices using + # the differential setup, so we just stick with what we have. cset "name='Stereo DAC MIXR DAC R1 Switch' off" cset "name='Stereo DAC MIXL DAC R1 Switch' on" -- cgit v1.2.3 From fdc4c17e1c9f4f7591c7fb4f2bc2e0c399d2156e Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 7 Jan 2019 09:08:46 +0100 Subject: control: fix the assert() in snd_ctl_elem_set_bytes Allow to write to the whole array (512 bytes). Signed-off-by: Jaroslav Kysela --- src/control/control.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/control/control.c b/src/control/control.c index 82cd1a05..90fab877 100644 --- a/src/control/control.c +++ b/src/control/control.c @@ -3108,7 +3108,7 @@ void snd_ctl_elem_value_set_byte(snd_ctl_elem_value_t *obj, unsigned int idx, un void snd_ctl_elem_set_bytes(snd_ctl_elem_value_t *obj, void *data, size_t size) { assert(obj); - assert(size < ARRAY_SIZE(obj->value.bytes.data)); + assert(size <= ARRAY_SIZE(obj->value.bytes.data)); memcpy(obj->value.bytes.data, data, size); } -- cgit v1.2.3 From f91cc3c7d6b76d11e8e003abc5aed99ee2cc78bd Mon Sep 17 00:00:00 2001 From: Russell Parker Date: Sat, 5 Jan 2019 19:47:11 -0800 Subject: Update chtrt5645 ucm variants to use bytcr/PlatformEnableSeq.conf component The Lenovo Ideapad Miix 320, Asus T100HA, and chtrt5645 mono variant UCM configurations have not been updated to make use of the shared bytcr/PlatfromEnableSeq.conf sequence. This commit deletes those command sequences and loads the shared component directly. Signed-off-by: Russell Parker Signed-off-by: Jaroslav Kysela --- .../HiFi.conf | 116 +-------------------- .../HiFi.conf | 116 +-------------------- .../chtrt5645-mono-speaker-analog-mic/HiFi.conf | 116 +-------------------- .../ucm/platforms/bytcr/PlatformEnableSeq.conf | 4 +- 4 files changed, 5 insertions(+), 347 deletions(-) diff --git a/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf b/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf index 78bf9823..61848358 100644 --- a/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf +++ b/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf @@ -11,121 +11,7 @@ SectionVerb { EnableSequence [ cdev "hw:chtrt5645" - # 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 (used if ssp2 is connected to aif1) - 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" - - # modem_out settings (used if ssp0 is connected to aif2) - cset "name='modem_out mix 0 codec_in0 Switch' off" - cset "name='modem_out mix 0 codec_in1 Switch' off" - cset "name='modem_out mix 0 media_loop1_in Switch' off" - cset "name='modem_out mix 0 media_loop2_in Switch' off" - cset "name='modem_out mix 0 pcm0_in Switch' on" - cset "name='modem_out mix 0 pcm1_in Switch' off" - cset "name='modem_out mix 0 sprot_loop_in Switch' off" - cset "name='modem_out Gain 0 Switch' on" - cset "name='modem_out Gain 0 Volume' 0" - - # input settings - # pcm1_out settings - - # input used when SSP2 is connected - cset "name='codec_in0 Gain 0 Switch' on" - cset "name='codec_in0 Gain 0 Volume' 0" - - # input used when SSP0 is connected - cset "name='modem_in Gain 0 Switch' on" - cset "name='modem_in Gain 0 Volume' 0" - - cset "name='pcm1_out mix 0 codec_in0 Switch' on" - cset "name='pcm1_out mix 0 modem_in 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" + # Output Configuration cset "name='DAC1 L Mux' IF1 DAC" diff --git a/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf b/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf index 8cc9c7f2..d043f685 100644 --- a/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf +++ b/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf @@ -11,121 +11,7 @@ SectionVerb { EnableSequence [ cdev "hw:chtrt5645" - # 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 (used if ssp2 is connected to aif1) - 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" - - # modem_out settings (used if ssp0 is connected to aif2) - cset "name='modem_out mix 0 codec_in0 Switch' off" - cset "name='modem_out mix 0 codec_in1 Switch' off" - cset "name='modem_out mix 0 media_loop1_in Switch' off" - cset "name='modem_out mix 0 media_loop2_in Switch' off" - cset "name='modem_out mix 0 pcm0_in Switch' on" - cset "name='modem_out mix 0 pcm1_in Switch' off" - cset "name='modem_out mix 0 sprot_loop_in Switch' off" - cset "name='modem_out Gain 0 Switch' on" - cset "name='modem_out Gain 0 Volume' 0" - - # input settings - # pcm1_out settings - - # input used when SSP2 is connected - cset "name='codec_in0 Gain 0 Switch' on" - cset "name='codec_in0 Gain 0 Volume' 0" - - # input used when SSP0 is connected - cset "name='modem_in Gain 0 Switch' on" - cset "name='modem_in Gain 0 Volume' 0" - - cset "name='pcm1_out mix 0 codec_in0 Switch' on" - cset "name='pcm1_out mix 0 modem_in 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" + # Output Configuration cset "name='DAC1 L Mux' IF1 DAC" diff --git a/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf b/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf index 7a0cd51c..c4452a4e 100644 --- a/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf +++ b/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf @@ -11,121 +11,7 @@ SectionVerb { EnableSequence [ cdev "hw:chtrt5645" - # 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 (used if ssp2 is connected to aif1) - 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" - - # modem_out settings (used if ssp0 is connected to aif2) - cset "name='modem_out mix 0 codec_in0 Switch' off" - cset "name='modem_out mix 0 codec_in1 Switch' off" - cset "name='modem_out mix 0 media_loop1_in Switch' off" - cset "name='modem_out mix 0 media_loop2_in Switch' off" - cset "name='modem_out mix 0 pcm0_in Switch' on" - cset "name='modem_out mix 0 pcm1_in Switch' off" - cset "name='modem_out mix 0 sprot_loop_in Switch' off" - cset "name='modem_out Gain 0 Switch' on" - cset "name='modem_out Gain 0 Volume' 0" - - # input settings - # pcm1_out settings - - # input used when SSP2 is connected - cset "name='codec_in0 Gain 0 Switch' on" - cset "name='codec_in0 Gain 0 Volume' 0" - - # input used when SSP0 is connected - cset "name='modem_in Gain 0 Switch' on" - cset "name='modem_in Gain 0 Volume' 0" - - cset "name='pcm1_out mix 0 codec_in0 Switch' on" - cset "name='pcm1_out mix 0 modem_in 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" + # Output Configuration cset "name='DAC1 L Mux' IF1 DAC" diff --git a/src/conf/ucm/platforms/bytcr/PlatformEnableSeq.conf b/src/conf/ucm/platforms/bytcr/PlatformEnableSeq.conf index b5ee2b41..6f5e899c 100644 --- a/src/conf/ucm/platforms/bytcr/PlatformEnableSeq.conf +++ b/src/conf/ucm/platforms/bytcr/PlatformEnableSeq.conf @@ -29,7 +29,7 @@ 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 (used if SSP2 is connected) +# codec0_out settings (used if SSP2 is connected to aif1) 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" @@ -40,7 +40,7 @@ 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" -# modem_out settings (used if SSP0 is connected) +# modem_out settings (used if SSP0 is connected to aif2) cset "name='modem_out mix 0 codec_in0 Switch' off" cset "name='modem_out mix 0 codec_in1 Switch' off" cset "name='modem_out mix 0 media_loop1_in Switch' off" -- cgit v1.2.3 From e850d8e2e3893ac0622ee645bc86ddce0fd59624 Mon Sep 17 00:00:00 2001 From: Russell Parker Date: Sat, 5 Jan 2019 19:47:12 -0800 Subject: Create shared {En,Dis}ableSeq.conf components for rt5645 variants Factor out the common enable and disable sequences used in rt5645 variants, including the rt5650. Move the sequences into a new component directory codecs/rt5645/ along with a Makefile. Some lines like cset "name='Stereo1 ADC1 Mux' 1" and cset "name='I2S2 Func Switch' on" are not set set in the chtrt5650 UCM sequences and thus are not present in the new component, in order to maximize reuse. Signed-off-by: Russell Parker Signed-off-by: Jaroslav Kysela --- configure.ac | 1 + .../HiFi.conf | 62 +-------------------- .../HiFi.conf | 62 +-------------------- .../chtrt5645-mono-speaker-analog-mic/HiFi.conf | 62 +-------------------- src/conf/ucm/chtrt5645/HiFi.conf | 63 +--------------------- src/conf/ucm/chtrt5650/HiFi.conf | 60 ++------------------- src/conf/ucm/codecs/Makefile.am | 1 + src/conf/ucm/codecs/rt5645/DisableSeq.conf | 15 ++++++ src/conf/ucm/codecs/rt5645/EnableSeq.conf | 46 ++++++++++++++++ src/conf/ucm/codecs/rt5645/Makefile.am | 4 ++ 10 files changed, 78 insertions(+), 298 deletions(-) create mode 100644 src/conf/ucm/codecs/rt5645/DisableSeq.conf create mode 100644 src/conf/ucm/codecs/rt5645/EnableSeq.conf create mode 100644 src/conf/ucm/codecs/rt5645/Makefile.am diff --git a/configure.ac b/configure.ac index a0392bfe..89235afc 100644 --- a/configure.ac +++ b/configure.ac @@ -761,6 +761,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \ src/conf/ucm/codecs/Makefile \ src/conf/ucm/codecs/nau8824/Makefile \ src/conf/ucm/codecs/rt5640/Makefile \ + src/conf/ucm/codecs/rt5645/Makefile \ src/conf/ucm/codecs/rt5651/Makefile \ src/conf/ucm/platforms/Makefile \ src/conf/ucm/platforms/bytcr/Makefile \ diff --git a/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf b/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf index 61848358..46084b35 100644 --- a/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf +++ b/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf @@ -12,53 +12,9 @@ SectionVerb { cdev "hw:chtrt5645" + - # Output Configuration - cset "name='DAC1 L Mux' IF1 DAC" - cset "name='DAC1 R Mux' IF1 DAC" - cset "name='DAC1 MIXL DAC1 Switch' 1" - cset "name='DAC1 MIXR DAC1 Switch' 1" - cset "name='Stereo DAC MIXL DAC L1 Switch' 1" - cset "name='Stereo DAC MIXR DAC R1 Switch' 1" - - cset "name='DAC L2 Mux' IF2 DAC" - cset "name='DAC R2 Mux' IF2 DAC" - cset "name='Mono DAC MIXL DAC L2 Switch' on" - cset "name='Mono DAC MIXR DAC R2 Switch' on" - cset "name='DAC2 Playback Switch' on" - - cset "name='HPOVOL MIXL DAC1 Switch' on" - cset "name='HPOVOL MIXR DAC1 Switch' on" - cset "name='HPOVOL MIXL DAC2 Switch' on" - cset "name='HPOVOL MIXR DAC2 Switch' on" - cset "name='HPO MIX HPVOL Switch' on" - cset "name='HPOVOL L Switch' on" - cset "name='HPOVOL R Switch' on" - - cset "name='SPK MIXL DAC L1 Switch' on" - cset "name='SPK MIXR DAC R1 Switch' on" - cset "name='SPK MIXL DAC L2 Switch' on" - cset "name='SPK MIXR DAC R2 Switch' on" - cset "name='SPOL MIX SPKVOL L Switch' on" - cset "name='SPOR MIX SPKVOL R Switch' on" - cset "name='SPKVOL L Switch' on" - cset "name='SPKVOL R Switch' on" - - # Input Configuration - cset "name='Stereo1 DMIC Mux' 0" cset "name='Stereo1 ADC1 Mux' 1" - cset "name='Stereo1 ADC2 Mux' 1" - cset "name='ADC Capture Switch' on" - # 55/63 - cset "name='ADC Capture Volume' 55" - # set ADC Boost to 0/3, higher vals cause a lot of white noise - cset "name='ADC Boost Capture Volume' 0" - # 55/63 - cset "name='Mono ADC Capture Volume' 55" - # 0/3 - cset "name='Mono ADC Boost Capture Volume' 0" - # 27/31 - cset "name='IN Capture Volume' 27" cset "name='I2S2 Func Switch' on" # 3/12 the headphone mic tends to be quite loud cset "name='IN1 Boost' 3" @@ -69,21 +25,7 @@ SectionVerb { DisableSequence [ cdev "hw:chtrt5645" - # Disable audio output path - cset "name='codec_out1 mix 0 pcm0_in Switch' off" - cset "name='media0_out mix 0 media1_in Switch' off" - - cset "name='media1_in Gain 0 Switch' off" - cset "name='pcm0_in Gain 0 Switch' off" - cset "name='codec_out1 Gain 0 Switch' off" - - # Disable audio input path - cset "name='pcm1_out mix 0 media_loop2_in Switch' off" - cset "name='media_loop2_out mix 0 codec_in0 Switch' off" - - cset "name='media_loop2_out Gain 0 Switch' off" - cset "name='pcm1_out Gain 0 Switch' off" - cset "name='codec_in0 Gain 0 Switch' off" + ] } diff --git a/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf b/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf index d043f685..4896a2ac 100644 --- a/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf +++ b/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf @@ -12,53 +12,9 @@ SectionVerb { cdev "hw:chtrt5645" + - # Output Configuration - cset "name='DAC1 L Mux' IF1 DAC" - cset "name='DAC1 R Mux' IF1 DAC" - cset "name='DAC1 MIXL DAC1 Switch' 1" - cset "name='DAC1 MIXR DAC1 Switch' 1" - cset "name='Stereo DAC MIXL DAC L1 Switch' 1" - cset "name='Stereo DAC MIXR DAC R1 Switch' 1" - - cset "name='DAC L2 Mux' IF2 DAC" - cset "name='DAC R2 Mux' IF2 DAC" - cset "name='Mono DAC MIXL DAC L2 Switch' on" - cset "name='Mono DAC MIXR DAC R2 Switch' on" - cset "name='DAC2 Playback Switch' on" - - cset "name='HPOVOL MIXL DAC1 Switch' on" - cset "name='HPOVOL MIXR DAC1 Switch' on" - cset "name='HPOVOL MIXL DAC2 Switch' on" - cset "name='HPOVOL MIXR DAC2 Switch' on" - cset "name='HPO MIX HPVOL Switch' on" - cset "name='HPOVOL L Switch' on" - cset "name='HPOVOL R Switch' on" - - cset "name='SPK MIXL DAC L1 Switch' on" - cset "name='SPK MIXR DAC R1 Switch' on" - cset "name='SPK MIXL DAC L2 Switch' on" - cset "name='SPK MIXR DAC R2 Switch' on" - cset "name='SPOL MIX SPKVOL L Switch' on" - cset "name='SPOR MIX SPKVOL R Switch' on" - cset "name='SPKVOL L Switch' on" - cset "name='SPKVOL R Switch' on" - - # Input Configuration - cset "name='Stereo1 DMIC Mux' 0" cset "name='Stereo1 ADC1 Mux' 1" - cset "name='Stereo1 ADC2 Mux' 1" - cset "name='ADC Capture Switch' on" - # 55/63 - cset "name='ADC Capture Volume' 55" - # set ADC Boost to 0/3, higher vals cause a lot of white noise - cset "name='ADC Boost Capture Volume' 0" - # 55/63 - cset "name='Mono ADC Capture Volume' 55" - # 0/3 - cset "name='Mono ADC Boost Capture Volume' 0" - # 27/31 - cset "name='IN Capture Volume' 27" cset "name='I2S2 Func Switch' on" # 3/12 the headphone mic tends to be quite loud cset "name='IN1 Boost' 3" @@ -69,21 +25,7 @@ SectionVerb { DisableSequence [ cdev "hw:chtrt5645" - # Disable audio output path - cset "name='codec_out1 mix 0 pcm0_in Switch' off" - cset "name='media0_out mix 0 media1_in Switch' off" - - cset "name='media1_in Gain 0 Switch' off" - cset "name='pcm0_in Gain 0 Switch' off" - cset "name='codec_out1 Gain 0 Switch' off" - - # Disable audio input path - cset "name='pcm1_out mix 0 media_loop2_in Switch' off" - cset "name='media_loop2_out mix 0 codec_in0 Switch' off" - - cset "name='media_loop2_out Gain 0 Switch' off" - cset "name='pcm1_out Gain 0 Switch' off" - cset "name='codec_in0 Gain 0 Switch' off" + ] } diff --git a/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf b/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf index c4452a4e..d7d8dfbe 100644 --- a/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf +++ b/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf @@ -12,53 +12,9 @@ SectionVerb { cdev "hw:chtrt5645" + - # Output Configuration - cset "name='DAC1 L Mux' IF1 DAC" - cset "name='DAC1 R Mux' IF1 DAC" - cset "name='DAC1 MIXL DAC1 Switch' 1" - cset "name='DAC1 MIXR DAC1 Switch' 1" - cset "name='Stereo DAC MIXL DAC L1 Switch' 1" - cset "name='Stereo DAC MIXR DAC R1 Switch' 1" - - cset "name='DAC L2 Mux' IF2 DAC" - cset "name='DAC R2 Mux' IF2 DAC" - cset "name='Mono DAC MIXL DAC L2 Switch' on" - cset "name='Mono DAC MIXR DAC R2 Switch' on" - cset "name='DAC2 Playback Switch' on" - - cset "name='HPOVOL MIXL DAC1 Switch' on" - cset "name='HPOVOL MIXR DAC1 Switch' on" - cset "name='HPOVOL MIXL DAC2 Switch' on" - cset "name='HPOVOL MIXR DAC2 Switch' on" - cset "name='HPO MIX HPVOL Switch' on" - cset "name='HPOVOL L Switch' on" - cset "name='HPOVOL R Switch' on" - - cset "name='SPK MIXL DAC L1 Switch' on" - cset "name='SPK MIXR DAC R1 Switch' on" - cset "name='SPK MIXL DAC L2 Switch' on" - cset "name='SPK MIXR DAC R2 Switch' on" - cset "name='SPOL MIX SPKVOL L Switch' on" - cset "name='SPOR MIX SPKVOL R Switch' on" - cset "name='SPKVOL L Switch' on" - cset "name='SPKVOL R Switch' on" - - # Input Configuration - cset "name='Stereo1 DMIC Mux' 0" cset "name='Stereo1 ADC1 Mux' 1" - cset "name='Stereo1 ADC2 Mux' 1" - cset "name='ADC Capture Switch' on" - # 55/63 - cset "name='ADC Capture Volume' 55" - # set ADC Boost to 0/3, higher vals cause a lot of white noise - cset "name='ADC Boost Capture Volume' 0" - # 55/63 - cset "name='Mono ADC Capture Volume' 55" - # 0/3 - cset "name='Mono ADC Boost Capture Volume' 0" - # 27/31 - cset "name='IN Capture Volume' 27" cset "name='I2S2 Func Switch' on" # 3/12 the headphone mic tends to be quite loud cset "name='IN1 Boost' 3" @@ -69,21 +25,7 @@ SectionVerb { DisableSequence [ cdev "hw:chtrt5645" - # Disable audio output path - cset "name='codec_out1 mix 0 pcm0_in Switch' off" - cset "name='media0_out mix 0 media1_in Switch' off" - - cset "name='media1_in Gain 0 Switch' off" - cset "name='pcm0_in Gain 0 Switch' off" - cset "name='codec_out1 Gain 0 Switch' off" - - # Disable audio input path - cset "name='pcm1_out mix 0 media_loop2_in Switch' off" - cset "name='media_loop2_out mix 0 codec_in0 Switch' off" - - cset "name='media_loop2_out Gain 0 Switch' off" - cset "name='pcm1_out Gain 0 Switch' off" - cset "name='codec_in0 Gain 0 Switch' off" + ] } diff --git a/src/conf/ucm/chtrt5645/HiFi.conf b/src/conf/ucm/chtrt5645/HiFi.conf index 422f3b7e..b803cb2a 100644 --- a/src/conf/ucm/chtrt5645/HiFi.conf +++ b/src/conf/ucm/chtrt5645/HiFi.conf @@ -1,4 +1,3 @@ - SectionVerb { # ALSA PCM Value { @@ -13,53 +12,9 @@ SectionVerb { cdev "hw:chtrt5645" + - # Output Configuration - cset "name='DAC1 L Mux' IF1 DAC" - cset "name='DAC1 R Mux' IF1 DAC" - cset "name='DAC1 MIXL DAC1 Switch' 1" - cset "name='DAC1 MIXR DAC1 Switch' 1" - cset "name='Stereo DAC MIXL DAC L1 Switch' 1" - cset "name='Stereo DAC MIXR DAC R1 Switch' 1" - - cset "name='DAC L2 Mux' IF2 DAC" - cset "name='DAC R2 Mux' IF2 DAC" - cset "name='Mono DAC MIXL DAC L2 Switch' on" - cset "name='Mono DAC MIXR DAC R2 Switch' on" - cset "name='DAC2 Playback Switch' on" - - cset "name='HPOVOL MIXL DAC1 Switch' on" - cset "name='HPOVOL MIXR DAC1 Switch' on" - cset "name='HPOVOL MIXL DAC2 Switch' on" - cset "name='HPOVOL MIXR DAC2 Switch' on" - cset "name='HPO MIX HPVOL Switch' on" - cset "name='HPOVOL L Switch' on" - cset "name='HPOVOL R Switch' on" - - cset "name='SPK MIXL DAC L1 Switch' on" - cset "name='SPK MIXR DAC R1 Switch' on" - cset "name='SPK MIXL DAC L2 Switch' on" - cset "name='SPK MIXR DAC R2 Switch' on" - cset "name='SPOL MIX SPKVOL L Switch' on" - cset "name='SPOR MIX SPKVOL R Switch' on" - cset "name='SPKVOL L Switch' on" - cset "name='SPKVOL R Switch' on" - - # Input Configuration - cset "name='Stereo1 DMIC Mux' 0" cset "name='Stereo1 ADC1 Mux' 1" - cset "name='Stereo1 ADC2 Mux' 1" - cset "name='ADC Capture Switch' on" - # 55/63 - cset "name='ADC Capture Volume' 55" - # set ADC Boost to 0/3, higher vals cause a lot of white noise - cset "name='ADC Boost Capture Volume' 0" - # 55/63 - cset "name='Mono ADC Capture Volume' 55" - # 0/3 - cset "name='Mono ADC Boost Capture Volume' 0" - # 27/31 - cset "name='IN Capture Volume' 27" cset "name='I2S2 Func Switch' on" # 3/12 the headphone mic tends to be quite loud cset "name='IN1 Boost' 3" @@ -70,21 +25,7 @@ SectionVerb { DisableSequence [ cdev "hw:chtrt5645" - # Disable audio output path - cset "name='codec_out1 mix 0 pcm0_in Switch' off" - cset "name='media0_out mix 0 media1_in Switch' off" - - cset "name='media1_in Gain 0 Switch' off" - cset "name='pcm0_in Gain 0 Switch' off" - cset "name='codec_out1 Gain 0 Switch' off" - - # Disable audio input path - cset "name='pcm1_out mix 0 media_loop2_in Switch' off" - cset "name='media_loop2_out mix 0 codec_in0 Switch' off" - - cset "name='media_loop2_out Gain 0 Switch' off" - cset "name='pcm1_out Gain 0 Switch' off" - cset "name='codec_in0 Gain 0 Switch' off" + ] } diff --git a/src/conf/ucm/chtrt5650/HiFi.conf b/src/conf/ucm/chtrt5650/HiFi.conf index cc3d64bf..a638da58 100644 --- a/src/conf/ucm/chtrt5650/HiFi.conf +++ b/src/conf/ucm/chtrt5650/HiFi.conf @@ -13,73 +13,19 @@ SectionVerb { cdev "hw:chtrt5650" + - # Output Configuration - cset "name='DAC1 L Mux' IF1 DAC" - cset "name='DAC1 R Mux' IF1 DAC" - cset "name='DAC1 MIXL DAC1 Switch' 1" - cset "name='DAC1 MIXR DAC1 Switch' 1" - cset "name='Stereo DAC MIXL DAC L1 Switch' 1" - cset "name='Stereo DAC MIXR DAC R1 Switch' 1" cset "name='Speaker HWEQ' 1,164,237,135,1,165,0,0,1,166,237,135,1,167,0,0,1,192,30,196,1,193,0,0,1,194,30,196,1,195,0,0,1,196,31,180,1,197,0,75,1,198,31,180,1,199,31,180,1,200,0,75,1,201,31,180,0,177,51,224" cset "name='DAC1 Playback Volume' 77,77" - cset "name='Speaker ClassD Playback Volume' 4" - - cset "name='DAC L2 Mux' IF2 DAC" - cset "name='DAC R2 Mux' IF2 DAC" - cset "name='Mono DAC MIXL DAC L2 Switch' on" - cset "name='Mono DAC MIXR DAC R2 Switch' on" - cset "name='DAC2 Playback Switch' on" - - cset "name='HPOVOL MIXL DAC1 Switch' on" - cset "name='HPOVOL MIXR DAC1 Switch' on" - cset "name='HPOVOL MIXL DAC2 Switch' on" - cset "name='HPOVOL MIXR DAC2 Switch' on" - cset "name='HPO MIX HPVOL Switch' on" - cset "name='HPOVOL L Switch' on" - cset "name='HPOVOL R Switch' on" - - cset "name='SPK MIXL DAC L1 Switch' on" - cset "name='SPK MIXR DAC R1 Switch' on" - cset "name='SPK MIXL DAC L2 Switch' on" - cset "name='SPK MIXR DAC R2 Switch' on" - cset "name='SPOL MIX SPKVOL L Switch' on" - cset "name='SPOR MIX SPKVOL R Switch' on" - cset "name='SPKVOL L Switch' on" - cset "name='SPKVOL R Switch' on" - - # Input Configuration - cset "name='Stereo1 DMIC Mux' 0" - cset "name='Stereo1 ADC2 Mux' 1" - cset "name='ADC Capture Switch' on" - cset "name='ADC Capture Volume' 74" - cset "name='ADC Boost Capture Volume' 3" - cset "name='Mono ADC Capture Volume' 74" - cset "name='Mono ADC Boost Capture Volume' 2" - cset "name='IN Capture Volume' 63" - cset "name='RT5650 IF1 ADC Mux' 0" cset "name='I2S2 Func Switch' off" + cset "name='RT5650 IF1 ADC Mux' 0" ] DisableSequence [ cdev "hw:chtrt5650" - # Disable audio output path - cset "name='codec_out1 mix 0 pcm0_in Switch' off" - cset "name='media0_out mix 0 media1_in Switch' off" - - cset "name='media1_in Gain 0 Switch' off" - cset "name='pcm0_in Gain 0 Switch' off" - cset "name='codec_out1 Gain 0 Switch' off" - - # Disable audio input path - cset "name='pcm1_out mix 0 media_loop2_in Switch' off" - cset "name='media_loop2_out mix 0 codec_in0 Switch' off" - - cset "name='media_loop2_out Gain 0 Switch' off" - cset "name='pcm1_out Gain 0 Switch' off" - cset "name='codec_in0 Gain 0 Switch' off" + ] } diff --git a/src/conf/ucm/codecs/Makefile.am b/src/conf/ucm/codecs/Makefile.am index 2b374acb..4cabba0c 100644 --- a/src/conf/ucm/codecs/Makefile.am +++ b/src/conf/ucm/codecs/Makefile.am @@ -1,4 +1,5 @@ SUBDIRS=\ rt5640 \ +rt5645 \ rt5651 \ nau8824 diff --git a/src/conf/ucm/codecs/rt5645/DisableSeq.conf b/src/conf/ucm/codecs/rt5645/DisableSeq.conf new file mode 100644 index 00000000..5127d1ae --- /dev/null +++ b/src/conf/ucm/codecs/rt5645/DisableSeq.conf @@ -0,0 +1,15 @@ +# Disable audio output path +cset "name='codec_out1 mix 0 pcm0_in Switch' off" +cset "name='media0_out mix 0 media1_in Switch' off" + +cset "name='media1_in Gain 0 Switch' off" +cset "name='pcm0_in Gain 0 Switch' off" +cset "name='codec_out1 Gain 0 Switch' off" + +# Disable audio input path +cset "name='pcm1_out mix 0 media_loop2_in Switch' off" +cset "name='media_loop2_out mix 0 codec_in0 Switch' off" + +cset "name='media_loop2_out Gain 0 Switch' off" +cset "name='pcm1_out Gain 0 Switch' off" +cset "name='codec_in0 Gain 0 Switch' off" diff --git a/src/conf/ucm/codecs/rt5645/EnableSeq.conf b/src/conf/ucm/codecs/rt5645/EnableSeq.conf new file mode 100644 index 00000000..d3ad4cf9 --- /dev/null +++ b/src/conf/ucm/codecs/rt5645/EnableSeq.conf @@ -0,0 +1,46 @@ +# Output Configuration +cset "name='DAC1 L Mux' IF1 DAC" +cset "name='DAC1 R Mux' IF1 DAC" +cset "name='DAC1 MIXL DAC1 Switch' 1" +cset "name='DAC1 MIXR DAC1 Switch' 1" +cset "name='Stereo DAC MIXL DAC L1 Switch' 1" +cset "name='Stereo DAC MIXR DAC R1 Switch' 1" + +cset "name='DAC L2 Mux' IF2 DAC" +cset "name='DAC R2 Mux' IF2 DAC" +cset "name='Mono DAC MIXL DAC L2 Switch' on" +cset "name='Mono DAC MIXR DAC R2 Switch' on" +cset "name='DAC2 Playback Switch' on" + +cset "name='HPOVOL MIXL DAC1 Switch' on" +cset "name='HPOVOL MIXR DAC1 Switch' on" +cset "name='HPOVOL MIXL DAC2 Switch' on" +cset "name='HPOVOL MIXR DAC2 Switch' on" +cset "name='HPO MIX HPVOL Switch' on" +cset "name='HPOVOL L Switch' on" +cset "name='HPOVOL R Switch' on" + +cset "name='SPK MIXL DAC L1 Switch' on" +cset "name='SPK MIXR DAC R1 Switch' on" +cset "name='SPK MIXL DAC L2 Switch' on" +cset "name='SPK MIXR DAC R2 Switch' on" +cset "name='SPOL MIX SPKVOL L Switch' on" +cset "name='SPOR MIX SPKVOL R Switch' on" +cset "name='SPKVOL L Switch' on" +cset "name='SPKVOL R Switch' on" + +# Input Configuration +cset "name='Stereo1 DMIC Mux' 0" +cset "name='Stereo1 ADC2 Mux' 1" +cset "name='ADC Capture Switch' on" + +# 55/63 +cset "name='ADC Capture Volume' 55" +# set ADC Boost to 0/3, higher vals cause a lot of white noise +cset "name='ADC Boost Capture Volume' 0" +# 55/63 +cset "name='Mono ADC Capture Volume' 55" +# 0/3 +cset "name='Mono ADC Boost Capture Volume' 0" +# 27/31 +cset "name='IN Capture Volume' 27" diff --git a/src/conf/ucm/codecs/rt5645/Makefile.am b/src/conf/ucm/codecs/rt5645/Makefile.am new file mode 100644 index 00000000..29ce95cc --- /dev/null +++ b/src/conf/ucm/codecs/rt5645/Makefile.am @@ -0,0 +1,4 @@ +alsaconfigdir = @ALSA_CONFIG_DIR@ +ucmdir = $(alsaconfigdir)/ucm/codecs/rt5645 +ucm_DATA = DisableSeq.conf EnableSeq.conf +EXTRA_DIST = $(ucm_DATA) -- cgit v1.2.3 From d4aa7346b73d483e3a3cfd8cea6464eb40deec6f Mon Sep 17 00:00:00 2001 From: Russell Parker Date: Sat, 5 Jan 2019 19:47:13 -0800 Subject: Factor out rt5645 variants Speaker+Headphones shared UCM enable sequences Move common enable sequences for rt5645 variants and rt5650 UCM configurations into a shared component. The corresponding disable sequences are only two lines each and do not seem worth creating components for. Signed-off-by: Russell Parker Signed-off-by: Jaroslav Kysela --- .../ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf | 15 ++------------- .../LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf | 15 ++------------- src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf | 15 ++------------- src/conf/ucm/chtrt5645/HiFi.conf | 15 ++------------- src/conf/ucm/chtrt5650/HiFi.conf | 14 ++------------ src/conf/ucm/codecs/rt5645/HeadphonesEnableSeq.conf | 7 +++++++ src/conf/ucm/codecs/rt5645/Makefile.am | 3 ++- src/conf/ucm/codecs/rt5645/SpeakerEnableSeq.conf | 6 ++++++ 8 files changed, 25 insertions(+), 65 deletions(-) create mode 100644 src/conf/ucm/codecs/rt5645/HeadphonesEnableSeq.conf create mode 100644 src/conf/ucm/codecs/rt5645/SpeakerEnableSeq.conf diff --git a/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf b/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf index 46084b35..0f09d292 100644 --- a/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf +++ b/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf @@ -43,12 +43,7 @@ SectionDevice."Speaker" { EnableSequence [ cdev "hw:chtrt5645" - cset "name='Headphone Switch' off" - cset "name='Headphone Channel Switch' off" - - cset "name='Ext Spk Switch' on" - cset "name='Speaker Channel Switch' on" - cset "name='Speaker Playback Volume' 31" + ] DisableSequence [ @@ -75,13 +70,7 @@ SectionDevice."Headphones" { EnableSequence [ cdev "hw:chtrt5645" - cset "name='Ext Spk Switch' off" - cset "name='Speaker Channel Switch' off" - - cset "name='Headphone Switch' on" - cset "name='Headphone Channel Switch' on" - # 25/39 higher values cause crackling on some boards - cset "name='Headphone Playback Volume' 25" + ] DisableSequence [ diff --git a/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf b/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf index 4896a2ac..31e06e0d 100644 --- a/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf +++ b/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf @@ -43,12 +43,7 @@ SectionDevice."Speaker" { EnableSequence [ cdev "hw:chtrt5645" - cset "name='Headphone Switch' off" - cset "name='Headphone Channel Switch' off" - - cset "name='Ext Spk Switch' on" - cset "name='Speaker Channel Switch' on" - cset "name='Speaker Playback Volume' 31" + ] DisableSequence [ @@ -75,13 +70,7 @@ SectionDevice."Headphones" { EnableSequence [ cdev "hw:chtrt5645" - cset "name='Ext Spk Switch' off" - cset "name='Speaker Channel Switch' off" - - cset "name='Headphone Switch' on" - cset "name='Headphone Channel Switch' on" - # 25/39 higher values cause crackling on some boards - cset "name='Headphone Playback Volume' 25" + ] DisableSequence [ diff --git a/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf b/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf index d7d8dfbe..36dcca30 100644 --- a/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf +++ b/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf @@ -47,12 +47,7 @@ SectionDevice."Speaker" { cset "name='Stereo DAC MIXL DAC R1 Switch' 1" cset "name='Stereo DAC MIXR DAC R1 Switch' 0" - cset "name='Headphone Switch' off" - cset "name='Headphone Channel Switch' off" - - cset "name='Ext Spk Switch' on" - cset "name='Speaker Channel Switch' on" - cset "name='Speaker Playback Volume' 31" + ] DisableSequence [ @@ -83,13 +78,7 @@ SectionDevice."Headphones" { cset "name='Stereo DAC MIXL DAC R1 Switch' 0" cset "name='Stereo DAC MIXR DAC R1 Switch' 1" - cset "name='Ext Spk Switch' off" - cset "name='Speaker Channel Switch' off" - - cset "name='Headphone Switch' on" - cset "name='Headphone Channel Switch' on" - # 25/39 higher values cause crackling on some boards - cset "name='Headphone Playback Volume' 25" + ] DisableSequence [ diff --git a/src/conf/ucm/chtrt5645/HiFi.conf b/src/conf/ucm/chtrt5645/HiFi.conf index b803cb2a..7d4f0c48 100644 --- a/src/conf/ucm/chtrt5645/HiFi.conf +++ b/src/conf/ucm/chtrt5645/HiFi.conf @@ -43,12 +43,7 @@ SectionDevice."Speaker" { EnableSequence [ cdev "hw:chtrt5645" - cset "name='Headphone Switch' off" - cset "name='Headphone Channel Switch' off" - - cset "name='Ext Spk Switch' on" - cset "name='Speaker Channel Switch' on" - cset "name='Speaker Playback Volume' 31" + ] DisableSequence [ @@ -75,13 +70,7 @@ SectionDevice."Headphones" { EnableSequence [ cdev "hw:chtrt5645" - cset "name='Ext Spk Switch' off" - cset "name='Speaker Channel Switch' off" - - cset "name='Headphone Switch' on" - cset "name='Headphone Channel Switch' on" - # 25/39 higher values cause crackling on some boards - cset "name='Headphone Playback Volume' 25" + ] DisableSequence [ diff --git a/src/conf/ucm/chtrt5650/HiFi.conf b/src/conf/ucm/chtrt5650/HiFi.conf index a638da58..ad138511 100644 --- a/src/conf/ucm/chtrt5650/HiFi.conf +++ b/src/conf/ucm/chtrt5650/HiFi.conf @@ -43,12 +43,7 @@ SectionDevice."Speaker" { EnableSequence [ cdev "hw:chtrt5650" - cset "name='Headphone Switch' off" - cset "name='Headphone Channel Switch' off" - - cset "name='Ext Spk Switch' on" - cset "name='Speaker Channel Switch' on" - cset "name='Speaker Playback Volume' 31" + ] DisableSequence [ @@ -75,12 +70,7 @@ SectionDevice."Headphones" { EnableSequence [ cdev "hw:chtrt5650" - cset "name='Ext Spk Switch' off" - cset "name='Speaker Channel Switch' off" - - cset "name='Headphone Switch' on" - cset "name='Headphone Channel Switch' on" - cset "name='Headphone Playback Volume' 31" + ] DisableSequence [ diff --git a/src/conf/ucm/codecs/rt5645/HeadphonesEnableSeq.conf b/src/conf/ucm/codecs/rt5645/HeadphonesEnableSeq.conf new file mode 100644 index 00000000..6c231da7 --- /dev/null +++ b/src/conf/ucm/codecs/rt5645/HeadphonesEnableSeq.conf @@ -0,0 +1,7 @@ +cset "name='Ext Spk Switch' off" +cset "name='Speaker Channel Switch' off" + +cset "name='Headphone Switch' on" +cset "name='Headphone Channel Switch' on" +# 25/39 higher values cause crackling on some boards +cset "name='Headphone Playback Volume' 25" diff --git a/src/conf/ucm/codecs/rt5645/Makefile.am b/src/conf/ucm/codecs/rt5645/Makefile.am index 29ce95cc..86d3fc81 100644 --- a/src/conf/ucm/codecs/rt5645/Makefile.am +++ b/src/conf/ucm/codecs/rt5645/Makefile.am @@ -1,4 +1,5 @@ alsaconfigdir = @ALSA_CONFIG_DIR@ ucmdir = $(alsaconfigdir)/ucm/codecs/rt5645 -ucm_DATA = DisableSeq.conf EnableSeq.conf +ucm_DATA = DisableSeq.conf EnableSeq.conf HeadphonesEnableSeq.conf \ + SpeakerEnableSeq.conf EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/codecs/rt5645/SpeakerEnableSeq.conf b/src/conf/ucm/codecs/rt5645/SpeakerEnableSeq.conf new file mode 100644 index 00000000..2cc62fc5 --- /dev/null +++ b/src/conf/ucm/codecs/rt5645/SpeakerEnableSeq.conf @@ -0,0 +1,6 @@ +cset "name='Headphone Switch' off" +cset "name='Headphone Channel Switch' off" + +cset "name='Ext Spk Switch' on" +cset "name='Speaker Channel Switch' on" +cset "name='Speaker Playback Volume' 31" -- cgit v1.2.3 From d68adb79ef77060049526c4b819bf7cbf5328b48 Mon Sep 17 00:00:00 2001 From: Russell Parker Date: Sat, 5 Jan 2019 19:47:14 -0800 Subject: Factor out rt5645 variants Headset+Digital Mic UCM shared {en,dis}able sequences Signed-off-by: Russell Parker Signed-off-by: Jaroslav Kysela --- .../HiFi.conf | 32 +++------------------- .../HiFi.conf | 32 +++------------------- .../chtrt5645-mono-speaker-analog-mic/HiFi.conf | 15 ++-------- src/conf/ucm/chtrt5645/HiFi.conf | 15 ++-------- src/conf/ucm/chtrt5650/HiFi.conf | 14 +++------- .../ucm/codecs/rt5645/DigitalMicDisableSeq.conf | 5 ++++ .../ucm/codecs/rt5645/DigitalMicEnableSeq.conf | 10 +++++++ src/conf/ucm/codecs/rt5645/HSMicDisableSeq.conf | 6 ++++ src/conf/ucm/codecs/rt5645/HSMicEnableSeq.conf | 7 +++++ src/conf/ucm/codecs/rt5645/Makefile.am | 4 ++- 10 files changed, 47 insertions(+), 93 deletions(-) create mode 100644 src/conf/ucm/codecs/rt5645/DigitalMicDisableSeq.conf create mode 100644 src/conf/ucm/codecs/rt5645/DigitalMicEnableSeq.conf create mode 100644 src/conf/ucm/codecs/rt5645/HSMicDisableSeq.conf create mode 100644 src/conf/ucm/codecs/rt5645/HSMicEnableSeq.conf diff --git a/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf b/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf index 0f09d292..87e0e4ec 100644 --- a/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf +++ b/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf @@ -92,31 +92,18 @@ SectionDevice."DMic".0 { EnableSequence [ cdev "hw:chtrt5645" - cset "name='Int Mic Switch' on" + cset "name='Stereo1 DMIC Mux' DMIC1" cset "name='Stereo1 ADC2 Mux' DMIC" cset "name='Mono ADC L2 Mux' DMIC" cset "name='Mono ADC R2 Mux' DMIC" - - cset "name='Sto1 ADC MIXL ADC1 Switch' off" - cset "name='Sto1 ADC MIXR ADC1 Switch' off" - cset "name='Sto1 ADC MIXL ADC2 Switch' on" - cset "name='Sto1 ADC MIXR ADC2 Switch' on" - cset "name='Mono ADC MIXL ADC1 Switch' off" - cset "name='Mono ADC MIXR ADC1 Switch' off" - cset "name='Mono ADC MIXL ADC2 Switch' on" - cset "name='Mono ADC MIXR ADC2 Switch' on" ] DisableSequence [ cdev "hw:chtrt5645" - cset "name='Sto1 ADC MIXL ADC2 Switch' off" - cset "name='Sto1 ADC MIXR ADC2 Switch' off" - cset "name='Mono ADC MIXL ADC2 Switch' off" - cset "name='Mono ADC MIXR ADC2 Switch' off" - cset "name='Int Mic Switch' off" + ] } @@ -132,10 +119,8 @@ SectionDevice."HSMic".0 { EnableSequence [ cdev "hw:chtrt5645" - cset "name='Headset Mic Switch' on" + - cset "name='Sto1 ADC MIXL ADC1 Switch' on" - cset "name='Sto1 ADC MIXR ADC1 Switch' on" cset "name='Sto1 ADC MIXL ADC2 Switch' off" cset "name='Sto1 ADC MIXR ADC2 Switch' off" @@ -143,23 +128,14 @@ SectionDevice."HSMic".0 { cset "name='Mono ADC MIXR ADC1 Switch' on" cset "name='Mono ADC MIXL ADC2 Switch' off" cset "name='Mono ADC MIXR ADC2 Switch' off" - - cset "name='RECMIXL BST1 Switch' on" - cset "name='RECMIXR BST1 Switch' on" - ] DisableSequence [ cdev "hw:chtrt5645" - cset "name='Headset Mic Switch' off" + - cset "name='RECMIXL BST1 Switch' off" - cset "name='RECMIXR BST1 Switch' off" - cset "name='Sto1 ADC MIXL ADC1 Switch' off" - cset "name='Sto1 ADC MIXR ADC1 Switch' off" cset "name='Mono ADC MIXL ADC1 Switch' on" cset "name='Mono ADC MIXR ADC1 Switch' on" - ] } diff --git a/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf b/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf index 31e06e0d..8930fe89 100644 --- a/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf +++ b/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf @@ -92,7 +92,7 @@ SectionDevice."DMic".0 { EnableSequence [ cdev "hw:chtrt5645" - cset "name='Int Mic Switch' on" + cset "name='Stereo1 DMIC Mux' DMIC2" cset "name='Stereo1 ADC2 Mux' DMIC" @@ -100,25 +100,12 @@ SectionDevice."DMic".0 { cset "name='Mono DMIC R Mux' DMIC2" cset "name='Mono ADC L2 Mux' DMIC" cset "name='Mono ADC R2 Mux' DMIC" - - cset "name='Sto1 ADC MIXL ADC1 Switch' off" - cset "name='Sto1 ADC MIXR ADC1 Switch' off" - cset "name='Sto1 ADC MIXL ADC2 Switch' on" - cset "name='Sto1 ADC MIXR ADC2 Switch' on" - cset "name='Mono ADC MIXL ADC1 Switch' off" - cset "name='Mono ADC MIXR ADC1 Switch' off" - cset "name='Mono ADC MIXL ADC2 Switch' on" - cset "name='Mono ADC MIXR ADC2 Switch' on" ] DisableSequence [ cdev "hw:chtrt5645" - cset "name='Sto1 ADC MIXL ADC2 Switch' off" - cset "name='Sto1 ADC MIXR ADC2 Switch' off" - cset "name='Mono ADC MIXL ADC2 Switch' off" - cset "name='Mono ADC MIXR ADC2 Switch' off" - cset "name='Int Mic Switch' off" + ] } @@ -134,10 +121,8 @@ SectionDevice."HSMic".0 { EnableSequence [ cdev "hw:chtrt5645" - cset "name='Headset Mic Switch' on" + - cset "name='Sto1 ADC MIXL ADC1 Switch' on" - cset "name='Sto1 ADC MIXR ADC1 Switch' on" cset "name='Sto1 ADC MIXL ADC2 Switch' off" cset "name='Sto1 ADC MIXR ADC2 Switch' off" @@ -145,23 +130,14 @@ SectionDevice."HSMic".0 { cset "name='Mono ADC MIXR ADC1 Switch' on" cset "name='Mono ADC MIXL ADC2 Switch' off" cset "name='Mono ADC MIXR ADC2 Switch' off" - - cset "name='RECMIXL BST1 Switch' on" - cset "name='RECMIXR BST1 Switch' on" - ] DisableSequence [ cdev "hw:chtrt5645" - cset "name='Headset Mic Switch' off" + - cset "name='RECMIXL BST1 Switch' off" - cset "name='RECMIXR BST1 Switch' off" - cset "name='Sto1 ADC MIXL ADC1 Switch' off" - cset "name='Sto1 ADC MIXR ADC1 Switch' off" cset "name='Mono ADC MIXL ADC1 Switch' on" cset "name='Mono ADC MIXR ADC1 Switch' on" - ] } diff --git a/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf b/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf index 36dcca30..f66d09a4 100644 --- a/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf +++ b/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf @@ -145,10 +145,8 @@ SectionDevice."HSMic".0 { EnableSequence [ cdev "hw:chtrt5645" - cset "name='Headset Mic Switch' on" + - cset "name='Sto1 ADC MIXL ADC1 Switch' on" - cset "name='Sto1 ADC MIXR ADC1 Switch' on" cset "name='Sto1 ADC MIXL ADC2 Switch' off" cset "name='Sto1 ADC MIXR ADC2 Switch' off" @@ -156,23 +154,14 @@ SectionDevice."HSMic".0 { cset "name='Mono ADC MIXR ADC1 Switch' on" cset "name='Mono ADC MIXL ADC2 Switch' off" cset "name='Mono ADC MIXR ADC2 Switch' off" - - cset "name='RECMIXL BST1 Switch' on" - cset "name='RECMIXR BST1 Switch' on" - ] DisableSequence [ cdev "hw:chtrt5645" - cset "name='Headset Mic Switch' off" + - cset "name='RECMIXL BST1 Switch' off" - cset "name='RECMIXR BST1 Switch' off" - cset "name='Sto1 ADC MIXL ADC1 Switch' off" - cset "name='Sto1 ADC MIXR ADC1 Switch' off" cset "name='Mono ADC MIXL ADC1 Switch' on" cset "name='Mono ADC MIXR ADC1 Switch' on" - ] } diff --git a/src/conf/ucm/chtrt5645/HiFi.conf b/src/conf/ucm/chtrt5645/HiFi.conf index 7d4f0c48..7250822d 100644 --- a/src/conf/ucm/chtrt5645/HiFi.conf +++ b/src/conf/ucm/chtrt5645/HiFi.conf @@ -136,10 +136,8 @@ SectionDevice."HSMic".0 { EnableSequence [ cdev "hw:chtrt5645" - cset "name='Headset Mic Switch' on" + - cset "name='Sto1 ADC MIXL ADC1 Switch' on" - cset "name='Sto1 ADC MIXR ADC1 Switch' on" cset "name='Sto1 ADC MIXL ADC2 Switch' off" cset "name='Sto1 ADC MIXR ADC2 Switch' off" @@ -147,23 +145,14 @@ SectionDevice."HSMic".0 { cset "name='Mono ADC MIXR ADC1 Switch' on" cset "name='Mono ADC MIXL ADC2 Switch' off" cset "name='Mono ADC MIXR ADC2 Switch' off" - - cset "name='RECMIXL BST1 Switch' on" - cset "name='RECMIXR BST1 Switch' on" - ] DisableSequence [ cdev "hw:chtrt5645" - cset "name='Headset Mic Switch' off" + - cset "name='RECMIXL BST1 Switch' off" - cset "name='RECMIXR BST1 Switch' off" - cset "name='Sto1 ADC MIXL ADC1 Switch' off" - cset "name='Sto1 ADC MIXR ADC1 Switch' off" cset "name='Mono ADC MIXL ADC1 Switch' on" cset "name='Mono ADC MIXR ADC1 Switch' on" - ] } diff --git a/src/conf/ucm/chtrt5650/HiFi.conf b/src/conf/ucm/chtrt5650/HiFi.conf index ad138511..71df1f84 100644 --- a/src/conf/ucm/chtrt5650/HiFi.conf +++ b/src/conf/ucm/chtrt5650/HiFi.conf @@ -118,22 +118,16 @@ SectionDevice."HSMic".0 { EnableSequence [ cdev "hw:chtrt5650" - cset "name='Headset Mic Switch' on" - cset "name='RECMIXL BST1 Switch' on" - cset "name='RECMIXR BST1 Switch' on" - cset "name='Sto1 ADC MIXL ADC1 Switch' on" - cset "name='Sto1 ADC MIXR ADC1 Switch' on" + + cset "name='IN1 Boost' 1" ] DisableSequence [ cdev "hw:chtrt5650" - cset "name='Headset Mic Switch' off" - cset "name='RECMIXL BST1 Switch' off" - cset "name='RECMIXR BST1 Switch' off" - cset "name='Sto1 ADC MIXL ADC1 Switch' off" - cset "name='Sto1 ADC MIXR ADC1 Switch' off" + + cset "name='IN1 Boost' 0" ] } diff --git a/src/conf/ucm/codecs/rt5645/DigitalMicDisableSeq.conf b/src/conf/ucm/codecs/rt5645/DigitalMicDisableSeq.conf new file mode 100644 index 00000000..751f38c0 --- /dev/null +++ b/src/conf/ucm/codecs/rt5645/DigitalMicDisableSeq.conf @@ -0,0 +1,5 @@ +cset "name='Sto1 ADC MIXL ADC2 Switch' off" +cset "name='Sto1 ADC MIXR ADC2 Switch' off" +cset "name='Mono ADC MIXL ADC2 Switch' off" +cset "name='Mono ADC MIXR ADC2 Switch' off" +cset "name='Int Mic Switch' off" diff --git a/src/conf/ucm/codecs/rt5645/DigitalMicEnableSeq.conf b/src/conf/ucm/codecs/rt5645/DigitalMicEnableSeq.conf new file mode 100644 index 00000000..cb243b33 --- /dev/null +++ b/src/conf/ucm/codecs/rt5645/DigitalMicEnableSeq.conf @@ -0,0 +1,10 @@ +cset "name='Int Mic Switch' on" + +cset "name='Sto1 ADC MIXL ADC1 Switch' off" +cset "name='Sto1 ADC MIXR ADC1 Switch' off" +cset "name='Sto1 ADC MIXL ADC2 Switch' on" +cset "name='Sto1 ADC MIXR ADC2 Switch' on" +cset "name='Mono ADC MIXL ADC1 Switch' off" +cset "name='Mono ADC MIXR ADC1 Switch' off" +cset "name='Mono ADC MIXL ADC2 Switch' on" +cset "name='Mono ADC MIXR ADC2 Switch' on" diff --git a/src/conf/ucm/codecs/rt5645/HSMicDisableSeq.conf b/src/conf/ucm/codecs/rt5645/HSMicDisableSeq.conf new file mode 100644 index 00000000..ef42b176 --- /dev/null +++ b/src/conf/ucm/codecs/rt5645/HSMicDisableSeq.conf @@ -0,0 +1,6 @@ +cset "name='Headset Mic Switch' off" + +cset "name='RECMIXL BST1 Switch' off" +cset "name='RECMIXR BST1 Switch' off" +cset "name='Sto1 ADC MIXL ADC1 Switch' off" +cset "name='Sto1 ADC MIXR ADC1 Switch' off" diff --git a/src/conf/ucm/codecs/rt5645/HSMicEnableSeq.conf b/src/conf/ucm/codecs/rt5645/HSMicEnableSeq.conf new file mode 100644 index 00000000..6c26d687 --- /dev/null +++ b/src/conf/ucm/codecs/rt5645/HSMicEnableSeq.conf @@ -0,0 +1,7 @@ +cset "name='Headset Mic Switch' on" + +cset "name='Sto1 ADC MIXL ADC1 Switch' on" +cset "name='Sto1 ADC MIXR ADC1 Switch' on" + +cset "name='RECMIXL BST1 Switch' on" +cset "name='RECMIXR BST1 Switch' on" diff --git a/src/conf/ucm/codecs/rt5645/Makefile.am b/src/conf/ucm/codecs/rt5645/Makefile.am index 86d3fc81..61c483b4 100644 --- a/src/conf/ucm/codecs/rt5645/Makefile.am +++ b/src/conf/ucm/codecs/rt5645/Makefile.am @@ -1,5 +1,7 @@ alsaconfigdir = @ALSA_CONFIG_DIR@ ucmdir = $(alsaconfigdir)/ucm/codecs/rt5645 ucm_DATA = DisableSeq.conf EnableSeq.conf HeadphonesEnableSeq.conf \ - SpeakerEnableSeq.conf + SpeakerEnableSeq.conf DigitalMicDisableSeq.conf \ + DigitalMicEnableSeq.conf HSMicDisableSeq.conf \ + HSMicEnableSeq.conf EXTRA_DIST = $(ucm_DATA) -- cgit v1.2.3 From b4c0a51505520edc86edd74bafd3e6397e3325e0 Mon Sep 17 00:00:00 2001 From: Russell Parker Date: Sat, 5 Jan 2019 19:47:15 -0800 Subject: Create device component for rt5645 Internal Analog Mic UCM Since the Internal Analog Microphone device configuration is identical for the rt5645 and rt5645 mono speaker UCMs, move the entire definition to a component. Signed-off-by: Russell Parker Signed-off-by: Jaroslav Kysela --- .../chtrt5645-mono-speaker-analog-mic/HiFi.conf | 44 +--------------------- src/conf/ucm/chtrt5645/HiFi.conf | 43 +-------------------- src/conf/ucm/codecs/rt5645/AnalogMic.conf | 41 ++++++++++++++++++++ src/conf/ucm/codecs/rt5645/Makefile.am | 2 +- 4 files changed, 44 insertions(+), 86 deletions(-) create mode 100644 src/conf/ucm/codecs/rt5645/AnalogMic.conf diff --git a/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf b/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf index f66d09a4..43cb4d63 100644 --- a/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf +++ b/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf @@ -89,49 +89,7 @@ SectionDevice."Headphones" { ] } -SectionDevice."Mic".0 { - Comment "Internal Analog Microphone" - - Value { - CaptureChannels "2" - CapturePriority "150" - } - - EnableSequence [ - cdev "hw:chtrt5645" - - cset "name='Int Analog Mic Switch' on" - - cset "name='Sto1 ADC MIXL ADC1 Switch' on" - cset "name='Sto1 ADC MIXR ADC1 Switch' on" - cset "name='Sto1 ADC MIXL ADC2 Switch' off" - cset "name='Sto1 ADC MIXR ADC2 Switch' off" - - cset "name='Mono ADC MIXL ADC1 Switch' on" - cset "name='Mono ADC MIXR ADC1 Switch' on" - cset "name='Mono ADC MIXL ADC2 Switch' off" - cset "name='Mono ADC MIXR ADC2 Switch' off" - - cset "name='RECMIXL BST2 Switch' on" - cset "name='RECMIXR BST2 Switch' on" - - ] - - DisableSequence [ - cdev "hw:chtrt5645" - - cset "name='Sto1 ADC MIXL ADC1 Switch' off" - cset "name='Sto1 ADC MIXR ADC1 Switch' off" - cset "name='Mono ADC MIXL ADC1 Switch' off" - cset "name='Mono ADC MIXR ADC1 Switch' off" - - cset "name='RECMIXL BST2 Switch' off" - cset "name='RECMIXR BST2 Switch' off" - - cset "name='Int Analog Mic Switch' off" - ] -} - + SectionDevice."HSMic".0 { Comment "Headset Microphone" diff --git a/src/conf/ucm/chtrt5645/HiFi.conf b/src/conf/ucm/chtrt5645/HiFi.conf index 7250822d..53300f62 100644 --- a/src/conf/ucm/chtrt5645/HiFi.conf +++ b/src/conf/ucm/chtrt5645/HiFi.conf @@ -81,48 +81,7 @@ SectionDevice."Headphones" { ] } -SectionDevice."Mic".0 { - Comment "Internal Analog Microphone" - - Value { - CaptureChannels "2" - CapturePriority "150" - } - - EnableSequence [ - cdev "hw:chtrt5645" - - cset "name='Int Analog Mic Switch' on" - - cset "name='Sto1 ADC MIXL ADC1 Switch' on" - cset "name='Sto1 ADC MIXR ADC1 Switch' on" - cset "name='Sto1 ADC MIXL ADC2 Switch' off" - cset "name='Sto1 ADC MIXR ADC2 Switch' off" - - cset "name='Mono ADC MIXL ADC1 Switch' on" - cset "name='Mono ADC MIXR ADC1 Switch' on" - cset "name='Mono ADC MIXL ADC2 Switch' off" - cset "name='Mono ADC MIXR ADC2 Switch' off" - - cset "name='RECMIXL BST2 Switch' on" - cset "name='RECMIXR BST2 Switch' on" - - ] - - DisableSequence [ - cdev "hw:chtrt5645" - - cset "name='Sto1 ADC MIXL ADC1 Switch' off" - cset "name='Sto1 ADC MIXR ADC1 Switch' off" - cset "name='Mono ADC MIXL ADC1 Switch' off" - cset "name='Mono ADC MIXR ADC1 Switch' off" - - cset "name='RECMIXL BST2 Switch' off" - cset "name='RECMIXR BST2 Switch' off" - - cset "name='Int Analog Mic Switch' off" - ] -} + SectionDevice."HSMic".0 { Comment "Headset Microphone" diff --git a/src/conf/ucm/codecs/rt5645/AnalogMic.conf b/src/conf/ucm/codecs/rt5645/AnalogMic.conf new file mode 100644 index 00000000..cbcefa7a --- /dev/null +++ b/src/conf/ucm/codecs/rt5645/AnalogMic.conf @@ -0,0 +1,41 @@ +SectionDevice."Mic".0 { + Comment "Internal Analog Microphone" + + Value { + CaptureChannels "2" + CapturePriority "150" + } + + EnableSequence [ + cdev "hw:chtrt5645" + + cset "name='Int Analog Mic Switch' on" + + cset "name='Sto1 ADC MIXL ADC1 Switch' on" + cset "name='Sto1 ADC MIXR ADC1 Switch' on" + cset "name='Sto1 ADC MIXL ADC2 Switch' off" + cset "name='Sto1 ADC MIXR ADC2 Switch' off" + + cset "name='Mono ADC MIXL ADC1 Switch' on" + cset "name='Mono ADC MIXR ADC1 Switch' on" + cset "name='Mono ADC MIXL ADC2 Switch' off" + cset "name='Mono ADC MIXR ADC2 Switch' off" + + cset "name='RECMIXL BST2 Switch' on" + cset "name='RECMIXR BST2 Switch' on" + ] + + DisableSequence [ + cdev "hw:chtrt5645" + + cset "name='Sto1 ADC MIXL ADC1 Switch' off" + cset "name='Sto1 ADC MIXR ADC1 Switch' off" + cset "name='Mono ADC MIXL ADC1 Switch' off" + cset "name='Mono ADC MIXR ADC1 Switch' off" + + cset "name='RECMIXL BST2 Switch' off" + cset "name='RECMIXR BST2 Switch' off" + + cset "name='Int Analog Mic Switch' off" + ] +} diff --git a/src/conf/ucm/codecs/rt5645/Makefile.am b/src/conf/ucm/codecs/rt5645/Makefile.am index 61c483b4..203e989e 100644 --- a/src/conf/ucm/codecs/rt5645/Makefile.am +++ b/src/conf/ucm/codecs/rt5645/Makefile.am @@ -3,5 +3,5 @@ ucmdir = $(alsaconfigdir)/ucm/codecs/rt5645 ucm_DATA = DisableSeq.conf EnableSeq.conf HeadphonesEnableSeq.conf \ SpeakerEnableSeq.conf DigitalMicDisableSeq.conf \ DigitalMicEnableSeq.conf HSMicDisableSeq.conf \ - HSMicEnableSeq.conf + HSMicEnableSeq.conf AnalogMic.conf EXTRA_DIST = $(ucm_DATA) -- cgit v1.2.3 From 506cca6eaa01ceb2377a17f202bb2ca9d626de35 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 3 Jan 2019 14:50:14 +0100 Subject: conf/ucm: Add UCM profile for bytcht-es8316 boards Add an UCM profile for Bay Trail and Cherry Trail boards with an ES8316 codec. Re-use the existing platform enable and disable sequences for BYT/CHT SST support and add a codecs/es8316 dir with codec specific enable / disable sequences for the various inputs and outputs. Signed-off-by: Hans de Goede Signed-off-by: Jaroslav Kysela --- configure.ac | 2 ++ src/conf/ucm/Makefile.am | 1 + src/conf/ucm/bytcht-es8316/HiFi.conf | 26 ++++++++++++++++ src/conf/ucm/bytcht-es8316/Makefile.am | 4 +++ src/conf/ucm/bytcht-es8316/bytcht-es8316.conf | 8 +++++ src/conf/ucm/codecs/Makefile.am | 1 + src/conf/ucm/codecs/es8316/EnableSeq.conf | 19 ++++++++++++ src/conf/ucm/codecs/es8316/HeadPhones.conf | 24 +++++++++++++++ src/conf/ucm/codecs/es8316/IN1-HeadsetMic.conf | 25 ++++++++++++++++ src/conf/ucm/codecs/es8316/IN1-InternalMic.conf | 24 +++++++++++++++ src/conf/ucm/codecs/es8316/IN2-HeadsetMic.conf | 25 ++++++++++++++++ src/conf/ucm/codecs/es8316/IN2-InternalMic.conf | 24 +++++++++++++++ src/conf/ucm/codecs/es8316/Makefile.am | 7 +++++ src/conf/ucm/codecs/es8316/MonoSpeaker.conf | 40 +++++++++++++++++++++++++ src/conf/ucm/codecs/es8316/Speaker.conf | 22 ++++++++++++++ 15 files changed, 252 insertions(+) create mode 100644 src/conf/ucm/bytcht-es8316/HiFi.conf create mode 100644 src/conf/ucm/bytcht-es8316/Makefile.am create mode 100644 src/conf/ucm/bytcht-es8316/bytcht-es8316.conf create mode 100644 src/conf/ucm/codecs/es8316/EnableSeq.conf create mode 100644 src/conf/ucm/codecs/es8316/HeadPhones.conf create mode 100644 src/conf/ucm/codecs/es8316/IN1-HeadsetMic.conf create mode 100644 src/conf/ucm/codecs/es8316/IN1-InternalMic.conf create mode 100644 src/conf/ucm/codecs/es8316/IN2-HeadsetMic.conf create mode 100644 src/conf/ucm/codecs/es8316/IN2-InternalMic.conf create mode 100644 src/conf/ucm/codecs/es8316/Makefile.am create mode 100644 src/conf/ucm/codecs/es8316/MonoSpeaker.conf create mode 100644 src/conf/ucm/codecs/es8316/Speaker.conf diff --git a/configure.ac b/configure.ac index 89235afc..a99685d1 100644 --- a/configure.ac +++ b/configure.ac @@ -720,6 +720,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \ src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/Makefile \ src/conf/ucm/broadwell-rt286/Makefile \ src/conf/ucm/broxton-rt298/Makefile \ + src/conf/ucm/bytcht-es8316/Makefile \ src/conf/ucm/bytcr-rt5640/Makefile \ src/conf/ucm/bytcr-rt5640-mono-spk-dmic1-mic/Makefile \ src/conf/ucm/bytcr-rt5640-mono-spk-in1-mic/Makefile \ @@ -759,6 +760,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \ src/conf/ucm/tegraalc5632/Makefile \ src/conf/ucm/VEYRON-I2S/Makefile \ src/conf/ucm/codecs/Makefile \ + src/conf/ucm/codecs/es8316/Makefile \ src/conf/ucm/codecs/nau8824/Makefile \ src/conf/ucm/codecs/rt5640/Makefile \ src/conf/ucm/codecs/rt5645/Makefile \ diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am index c82637fa..b252f258 100644 --- a/src/conf/ucm/Makefile.am +++ b/src/conf/ucm/Makefile.am @@ -4,6 +4,7 @@ platforms \ ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN \ broadwell-rt286 \ broxton-rt298 \ +bytcht-es8316 \ bytcr-rt5640 \ bytcr-rt5640-mono-spk-dmic1-mic \ bytcr-rt5640-mono-spk-in1-mic \ diff --git a/src/conf/ucm/bytcht-es8316/HiFi.conf b/src/conf/ucm/bytcht-es8316/HiFi.conf new file mode 100644 index 00000000..7af3daaf --- /dev/null +++ b/src/conf/ucm/bytcht-es8316/HiFi.conf @@ -0,0 +1,26 @@ +SectionVerb { + EnableSequence [ + cdev "hw:bytchtes8316" + + + ] + + DisableSequence [ + cdev "hw:bytchtes8316" + + ] + + Value { + PlaybackPCM "hw:bytchtes8316" + CapturePCM "hw:bytchtes8316" + } +} + + + + + + + + + diff --git a/src/conf/ucm/bytcht-es8316/Makefile.am b/src/conf/ucm/bytcht-es8316/Makefile.am new file mode 100644 index 00000000..bc8fa669 --- /dev/null +++ b/src/conf/ucm/bytcht-es8316/Makefile.am @@ -0,0 +1,4 @@ +alsaconfigdir = @ALSA_CONFIG_DIR@ +ucmdir = $(alsaconfigdir)/ucm/bytcht-es8316 +ucm_DATA = bytcht-es8316.conf HiFi.conf +EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/bytcht-es8316/bytcht-es8316.conf b/src/conf/ucm/bytcht-es8316/bytcht-es8316.conf new file mode 100644 index 00000000..e77e2977 --- /dev/null +++ b/src/conf/ucm/bytcht-es8316/bytcht-es8316.conf @@ -0,0 +1,8 @@ +SectionUseCase."HiFi" { + File "HiFi.conf" + Comment "Play HiFi quality Music" +} + +SectionDefaults [ + cdev "hw:bytchtes8316" +] diff --git a/src/conf/ucm/codecs/Makefile.am b/src/conf/ucm/codecs/Makefile.am index 4cabba0c..f78fd081 100644 --- a/src/conf/ucm/codecs/Makefile.am +++ b/src/conf/ucm/codecs/Makefile.am @@ -1,4 +1,5 @@ SUBDIRS=\ +es8316 \ rt5640 \ rt5645 \ rt5651 \ diff --git a/src/conf/ucm/codecs/es8316/EnableSeq.conf b/src/conf/ucm/codecs/es8316/EnableSeq.conf new file mode 100644 index 00000000..551b79b7 --- /dev/null +++ b/src/conf/ucm/codecs/es8316/EnableSeq.conf @@ -0,0 +1,19 @@ +# Disable all inputs / outputs +cset "name='Speaker Switch' off" +cset "name='Headphone Switch' off" +cset "name='Headset Mic Switch' off" +cset "name='Internal Mic Switch' off" + +# Set HP vol to 0 dB (3/3) +cset "name='Headphone Playback Volume' 3" +# Set HP mixer vol to -6 dB (4/7) louder does not work +cset "name='Headphone Mixer Volume' 4" +# Set DAC vol to 0 dB (192/192) +cset "name='DAC Playback Volume' 192" +# Set ADC vold to 0 dB (10/10) +cset "name='ADC PGA Gain Volume' 10" + +# Setup muxes / switches +cset "name='Left Headphone Mixer Left DAC Switch' on" +cset "name='Right Headphone Mixer Right DAC Switch' on" +cset "name='ALC Capture Switch' on" diff --git a/src/conf/ucm/codecs/es8316/HeadPhones.conf b/src/conf/ucm/codecs/es8316/HeadPhones.conf new file mode 100644 index 00000000..ff13ef1b --- /dev/null +++ b/src/conf/ucm/codecs/es8316/HeadPhones.conf @@ -0,0 +1,24 @@ +SectionDevice."Headphones" { + Comment "Headphones" + + ConflictingDevice [ + "Speaker" + "MonoSpeaker" + ] + + EnableSequence [ + cdev "hw:bytchtes8316" + cset "name='Headphone Switch' on" + ] + + DisableSequence [ + cdev "hw:bytchtes8316" + cset "name='Headphone Switch' off" + ] + + Value { + PlaybackChannels "2" + JackControl "Headphone Jack" + JackHWMute "Speaker MonoSpeaker" + } +} diff --git a/src/conf/ucm/codecs/es8316/IN1-HeadsetMic.conf b/src/conf/ucm/codecs/es8316/IN1-HeadsetMic.conf new file mode 100644 index 00000000..05016468 --- /dev/null +++ b/src/conf/ucm/codecs/es8316/IN1-HeadsetMic.conf @@ -0,0 +1,25 @@ +SectionDevice."HeadsetMic-IN1" { + Comment "Headset Microphone on IN1" + + ConflictingDevice [ + "InternalMic-IN1" + "InternalMic-IN2" + "HeadsetMic-IN2" + ] + + EnableSequence [ + cdev "hw:bytchtes8316" + cset "name='Differential Mux' lin1-rin1" + cset "name='Headset Mic Switch' on" + ] + + DisableSequence [ + cdev "hw:bytchtes8316" + cset "name='Headset Mic Switch' off" + ] + + Value { + CaptureChannels "2" + JackControl "Headset Mic Jack" + } +} diff --git a/src/conf/ucm/codecs/es8316/IN1-InternalMic.conf b/src/conf/ucm/codecs/es8316/IN1-InternalMic.conf new file mode 100644 index 00000000..5386fda7 --- /dev/null +++ b/src/conf/ucm/codecs/es8316/IN1-InternalMic.conf @@ -0,0 +1,24 @@ +SectionDevice."InternalMic-IN1" { + Comment "Internal Microphone on IN1" + + ConflictingDevice [ + "InternalMic-IN2" + "HeadsetMic-IN1" + "HeadsetMic-IN2" + ] + + EnableSequence [ + cdev "hw:bytchtes8316" + cset "name='Differential Mux' lin1-rin1" + cset "name='Internal Mic Switch' on" + ] + + DisableSequence [ + cdev "hw:bytchtes8316" + cset "name='Internal Mic Switch' off" + ] + + Value { + CaptureChannels "2" + } +} diff --git a/src/conf/ucm/codecs/es8316/IN2-HeadsetMic.conf b/src/conf/ucm/codecs/es8316/IN2-HeadsetMic.conf new file mode 100644 index 00000000..229e7e7b --- /dev/null +++ b/src/conf/ucm/codecs/es8316/IN2-HeadsetMic.conf @@ -0,0 +1,25 @@ +SectionDevice."HeadsetMic-IN2" { + Comment "Headset Microphone on IN2" + + ConflictingDevice [ + "InternalMic-IN1" + "InternalMic-IN2" + "HeadsetMic-IN1" + ] + + EnableSequence [ + cdev "hw:bytchtes8316" + cset "name='Differential Mux' lin2-rin2" + cset "name='Headset Mic Switch' on" + ] + + DisableSequence [ + cdev "hw:bytchtes8316" + cset "name='Headset Mic Switch' off" + ] + + Value { + CaptureChannels "2" + JackControl "Headset Mic Jack" + } +} diff --git a/src/conf/ucm/codecs/es8316/IN2-InternalMic.conf b/src/conf/ucm/codecs/es8316/IN2-InternalMic.conf new file mode 100644 index 00000000..59892fdc --- /dev/null +++ b/src/conf/ucm/codecs/es8316/IN2-InternalMic.conf @@ -0,0 +1,24 @@ +SectionDevice."InternalMic-IN2" { + Comment "Internal Microphone on IN2" + + ConflictingDevice [ + "InternalMic-IN1" + "HeadsetMic-IN1" + "HeadsetMic-IN2" + ] + + EnableSequence [ + cdev "hw:bytchtes8316" + cset "name='Differential Mux' lin2-rin2" + cset "name='Internal Mic Switch' on" + ] + + DisableSequence [ + cdev "hw:bytchtes8316" + cset "name='Internal Mic Switch' off" + ] + + Value { + CaptureChannels "2" + } +} diff --git a/src/conf/ucm/codecs/es8316/Makefile.am b/src/conf/ucm/codecs/es8316/Makefile.am new file mode 100644 index 00000000..36eeebce --- /dev/null +++ b/src/conf/ucm/codecs/es8316/Makefile.am @@ -0,0 +1,7 @@ +alsaconfigdir = @ALSA_CONFIG_DIR@ +ucmdir = $(alsaconfigdir)/ucm/codecs/es8316 +ucm_DATA = EnableSeq.conf HeadPhones.conf \ + IN1-InternalMic.conf IN2-InternalMic.conf \ + IN1-HeadsetMic.conf IN2-HeadsetMic.conf \ + Speaker.conf MonoSpeaker.conf +EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/codecs/es8316/MonoSpeaker.conf b/src/conf/ucm/codecs/es8316/MonoSpeaker.conf new file mode 100644 index 00000000..b1a95a5b --- /dev/null +++ b/src/conf/ucm/codecs/es8316/MonoSpeaker.conf @@ -0,0 +1,40 @@ +SectionDevice."MonoSpeaker" { + Comment "Mono Speaker" + + ConflictingDevice [ + "Speaker" + "Headphones" + ] + + EnableSequence [ + cdev "hw:bytchtes8316" + + # BYT/CHT devices with an ES8316 codec use a single speaker + # connected between the headhpone LOUT and ROUT pins, expecting + # the output to be in a mono differential mode. Presumably this + # is done to use the power of both the left and right headphone + # amplifier channels to allow the speaker to be louder. + # + # The ES8316 codec does not have a differential output mode, but + # we can emulate one by making both channels output the exact + # same signal by setting the "DAC Mono Mix Switch", combined + # with setting the "Playback Polarity" control to "R Invert", + # which applies a 180 degrees phase inversion to the right chan. + cset "name='DAC Mono Mix Switch' on" + cset "name='Playback Polarity' 1" + + cset "name='Speaker Switch' on" + ] + + DisableSequence [ + cdev "hw:bytchtes8316" + cset "name='Speaker Switch' off" + # DAC settings back to normal for stereo headphones output + cset "name='Playback Polarity' 0" + cset "name='DAC Mono Mix Switch' off" + ] + + Value { + PlaybackChannels "2" + } +} diff --git a/src/conf/ucm/codecs/es8316/Speaker.conf b/src/conf/ucm/codecs/es8316/Speaker.conf new file mode 100644 index 00000000..f0894c74 --- /dev/null +++ b/src/conf/ucm/codecs/es8316/Speaker.conf @@ -0,0 +1,22 @@ +SectionDevice."Speaker" { + Comment "Speakers" + + ConflictingDevice [ + "MonoSpeaker" + "Headphones" + ] + + EnableSequence [ + cdev "hw:bytchtes8316" + cset "name='Speaker Switch' on" + ] + + DisableSequence [ + cdev "hw:bytchtes8316" + cset "name='Speaker Switch' off" + ] + + Value { + PlaybackChannels "2" + } +} -- cgit v1.2.3 From f664a7aec9a249503e8523c6d830f60e3eb77cf6 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 3 Jan 2019 14:50:15 +0100 Subject: conf/ucm: bytcht-es8316: Add long-name UCM profiles After recent kernel work, the kernel now sets a long-name for bytcht-es8316 boards which indicates if a single (mono) speaker or stereo speakers are used and if in1 or in2 is used for the internal mic (the headset mic will be on the other input). This commit adds UCM profiles for bytcht-es8316 boards using these new long-names, based on the generic bytcht-es8316 profile. Signed-off-by: Hans de Goede Signed-off-by: Jaroslav Kysela --- configure.ac | 4 ++++ src/conf/ucm/Makefile.am | 4 ++++ .../ucm/bytcht-es8316-mono-spk-in1-mic/HiFi.conf | 23 ++++++++++++++++++++++ .../ucm/bytcht-es8316-mono-spk-in1-mic/Makefile.am | 4 ++++ .../bytcht-es8316-mono-spk-in1-mic.conf | 8 ++++++++ .../ucm/bytcht-es8316-mono-spk-in2-mic/HiFi.conf | 23 ++++++++++++++++++++++ .../ucm/bytcht-es8316-mono-spk-in2-mic/Makefile.am | 4 ++++ .../bytcht-es8316-mono-spk-in2-mic.conf | 8 ++++++++ .../ucm/bytcht-es8316-stereo-spk-in1-mic/HiFi.conf | 23 ++++++++++++++++++++++ .../bytcht-es8316-stereo-spk-in1-mic/Makefile.am | 4 ++++ .../bytcht-es8316-stereo-spk-in1-mic.conf | 8 ++++++++ .../ucm/bytcht-es8316-stereo-spk-in2-mic/HiFi.conf | 23 ++++++++++++++++++++++ .../bytcht-es8316-stereo-spk-in2-mic/Makefile.am | 4 ++++ .../bytcht-es8316-stereo-spk-in2-mic.conf | 8 ++++++++ 14 files changed, 148 insertions(+) create mode 100644 src/conf/ucm/bytcht-es8316-mono-spk-in1-mic/HiFi.conf create mode 100644 src/conf/ucm/bytcht-es8316-mono-spk-in1-mic/Makefile.am create mode 100644 src/conf/ucm/bytcht-es8316-mono-spk-in1-mic/bytcht-es8316-mono-spk-in1-mic.conf create mode 100644 src/conf/ucm/bytcht-es8316-mono-spk-in2-mic/HiFi.conf create mode 100644 src/conf/ucm/bytcht-es8316-mono-spk-in2-mic/Makefile.am create mode 100644 src/conf/ucm/bytcht-es8316-mono-spk-in2-mic/bytcht-es8316-mono-spk-in2-mic.conf create mode 100644 src/conf/ucm/bytcht-es8316-stereo-spk-in1-mic/HiFi.conf create mode 100644 src/conf/ucm/bytcht-es8316-stereo-spk-in1-mic/Makefile.am create mode 100644 src/conf/ucm/bytcht-es8316-stereo-spk-in1-mic/bytcht-es8316-stereo-spk-in1-mic.conf create mode 100644 src/conf/ucm/bytcht-es8316-stereo-spk-in2-mic/HiFi.conf create mode 100644 src/conf/ucm/bytcht-es8316-stereo-spk-in2-mic/Makefile.am create mode 100644 src/conf/ucm/bytcht-es8316-stereo-spk-in2-mic/bytcht-es8316-stereo-spk-in2-mic.conf diff --git a/configure.ac b/configure.ac index a99685d1..18aa9491 100644 --- a/configure.ac +++ b/configure.ac @@ -721,6 +721,10 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \ src/conf/ucm/broadwell-rt286/Makefile \ src/conf/ucm/broxton-rt298/Makefile \ src/conf/ucm/bytcht-es8316/Makefile \ + src/conf/ucm/bytcht-es8316-mono-spk-in1-mic/Makefile \ + src/conf/ucm/bytcht-es8316-mono-spk-in2-mic/Makefile \ + src/conf/ucm/bytcht-es8316-stereo-spk-in1-mic/Makefile \ + src/conf/ucm/bytcht-es8316-stereo-spk-in2-mic/Makefile \ src/conf/ucm/bytcr-rt5640/Makefile \ src/conf/ucm/bytcr-rt5640-mono-spk-dmic1-mic/Makefile \ src/conf/ucm/bytcr-rt5640-mono-spk-in1-mic/Makefile \ diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am index b252f258..ee850ee6 100644 --- a/src/conf/ucm/Makefile.am +++ b/src/conf/ucm/Makefile.am @@ -5,6 +5,10 @@ ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN \ broadwell-rt286 \ broxton-rt298 \ bytcht-es8316 \ +bytcht-es8316-mono-spk-in1-mic \ +bytcht-es8316-mono-spk-in2-mic \ +bytcht-es8316-stereo-spk-in1-mic \ +bytcht-es8316-stereo-spk-in2-mic \ bytcr-rt5640 \ bytcr-rt5640-mono-spk-dmic1-mic \ bytcr-rt5640-mono-spk-in1-mic \ diff --git a/src/conf/ucm/bytcht-es8316-mono-spk-in1-mic/HiFi.conf b/src/conf/ucm/bytcht-es8316-mono-spk-in1-mic/HiFi.conf new file mode 100644 index 00000000..97899495 --- /dev/null +++ b/src/conf/ucm/bytcht-es8316-mono-spk-in1-mic/HiFi.conf @@ -0,0 +1,23 @@ +SectionVerb { + EnableSequence [ + cdev "hw:bytchtes8316" + + + ] + + DisableSequence [ + cdev "hw:bytchtes8316" + + ] + + Value { + PlaybackPCM "hw:bytchtes8316" + CapturePCM "hw:bytchtes8316" + } +} + + + + + + diff --git a/src/conf/ucm/bytcht-es8316-mono-spk-in1-mic/Makefile.am b/src/conf/ucm/bytcht-es8316-mono-spk-in1-mic/Makefile.am new file mode 100644 index 00000000..420592fc --- /dev/null +++ b/src/conf/ucm/bytcht-es8316-mono-spk-in1-mic/Makefile.am @@ -0,0 +1,4 @@ +alsaconfigdir = @ALSA_CONFIG_DIR@ +ucmdir = $(alsaconfigdir)/ucm/bytcht-es8316-mono-spk-in1-mic +ucm_DATA = bytcht-es8316-mono-spk-in1-mic.conf HiFi.conf +EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/bytcht-es8316-mono-spk-in1-mic/bytcht-es8316-mono-spk-in1-mic.conf b/src/conf/ucm/bytcht-es8316-mono-spk-in1-mic/bytcht-es8316-mono-spk-in1-mic.conf new file mode 100644 index 00000000..26d82ead --- /dev/null +++ b/src/conf/ucm/bytcht-es8316-mono-spk-in1-mic/bytcht-es8316-mono-spk-in1-mic.conf @@ -0,0 +1,8 @@ +SectionUseCase."HiFi" { + File "../bytcht-es8316-mono-spk-in1-mic/HiFi.conf" + Comment "Play HiFi quality Music" +} + +SectionDefaults [ + cdev "hw:bytchtes8316" +] diff --git a/src/conf/ucm/bytcht-es8316-mono-spk-in2-mic/HiFi.conf b/src/conf/ucm/bytcht-es8316-mono-spk-in2-mic/HiFi.conf new file mode 100644 index 00000000..2821eb51 --- /dev/null +++ b/src/conf/ucm/bytcht-es8316-mono-spk-in2-mic/HiFi.conf @@ -0,0 +1,23 @@ +SectionVerb { + EnableSequence [ + cdev "hw:bytchtes8316" + + + ] + + DisableSequence [ + cdev "hw:bytchtes8316" + + ] + + Value { + PlaybackPCM "hw:bytchtes8316" + CapturePCM "hw:bytchtes8316" + } +} + + + + + + diff --git a/src/conf/ucm/bytcht-es8316-mono-spk-in2-mic/Makefile.am b/src/conf/ucm/bytcht-es8316-mono-spk-in2-mic/Makefile.am new file mode 100644 index 00000000..939c8b7d --- /dev/null +++ b/src/conf/ucm/bytcht-es8316-mono-spk-in2-mic/Makefile.am @@ -0,0 +1,4 @@ +alsaconfigdir = @ALSA_CONFIG_DIR@ +ucmdir = $(alsaconfigdir)/ucm/bytcht-es8316-mono-spk-in2-mic +ucm_DATA = bytcht-es8316-mono-spk-in2-mic.conf HiFi.conf +EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/bytcht-es8316-mono-spk-in2-mic/bytcht-es8316-mono-spk-in2-mic.conf b/src/conf/ucm/bytcht-es8316-mono-spk-in2-mic/bytcht-es8316-mono-spk-in2-mic.conf new file mode 100644 index 00000000..b9885c2d --- /dev/null +++ b/src/conf/ucm/bytcht-es8316-mono-spk-in2-mic/bytcht-es8316-mono-spk-in2-mic.conf @@ -0,0 +1,8 @@ +SectionUseCase."HiFi" { + File "../bytcht-es8316-mono-spk-in2-mic/HiFi.conf" + Comment "Play HiFi quality Music" +} + +SectionDefaults [ + cdev "hw:bytchtes8316" +] diff --git a/src/conf/ucm/bytcht-es8316-stereo-spk-in1-mic/HiFi.conf b/src/conf/ucm/bytcht-es8316-stereo-spk-in1-mic/HiFi.conf new file mode 100644 index 00000000..9f1801c9 --- /dev/null +++ b/src/conf/ucm/bytcht-es8316-stereo-spk-in1-mic/HiFi.conf @@ -0,0 +1,23 @@ +SectionVerb { + EnableSequence [ + cdev "hw:bytchtes8316" + + + ] + + DisableSequence [ + cdev "hw:bytchtes8316" + + ] + + Value { + PlaybackPCM "hw:bytchtes8316" + CapturePCM "hw:bytchtes8316" + } +} + + + + + + diff --git a/src/conf/ucm/bytcht-es8316-stereo-spk-in1-mic/Makefile.am b/src/conf/ucm/bytcht-es8316-stereo-spk-in1-mic/Makefile.am new file mode 100644 index 00000000..d3fbb9e9 --- /dev/null +++ b/src/conf/ucm/bytcht-es8316-stereo-spk-in1-mic/Makefile.am @@ -0,0 +1,4 @@ +alsaconfigdir = @ALSA_CONFIG_DIR@ +ucmdir = $(alsaconfigdir)/ucm/bytcht-es8316-stereo-spk-in1-mic +ucm_DATA = bytcht-es8316-stereo-spk-in1-mic.conf HiFi.conf +EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/bytcht-es8316-stereo-spk-in1-mic/bytcht-es8316-stereo-spk-in1-mic.conf b/src/conf/ucm/bytcht-es8316-stereo-spk-in1-mic/bytcht-es8316-stereo-spk-in1-mic.conf new file mode 100644 index 00000000..9bd32664 --- /dev/null +++ b/src/conf/ucm/bytcht-es8316-stereo-spk-in1-mic/bytcht-es8316-stereo-spk-in1-mic.conf @@ -0,0 +1,8 @@ +SectionUseCase."HiFi" { + File "../bytcht-es8316-stereo-spk-in1-mic/HiFi.conf" + Comment "Play HiFi quality Music" +} + +SectionDefaults [ + cdev "hw:bytchtes8316" +] diff --git a/src/conf/ucm/bytcht-es8316-stereo-spk-in2-mic/HiFi.conf b/src/conf/ucm/bytcht-es8316-stereo-spk-in2-mic/HiFi.conf new file mode 100644 index 00000000..00d4b7fe --- /dev/null +++ b/src/conf/ucm/bytcht-es8316-stereo-spk-in2-mic/HiFi.conf @@ -0,0 +1,23 @@ +SectionVerb { + EnableSequence [ + cdev "hw:bytchtes8316" + + + ] + + DisableSequence [ + cdev "hw:bytchtes8316" + + ] + + Value { + PlaybackPCM "hw:bytchtes8316" + CapturePCM "hw:bytchtes8316" + } +} + + + + + + diff --git a/src/conf/ucm/bytcht-es8316-stereo-spk-in2-mic/Makefile.am b/src/conf/ucm/bytcht-es8316-stereo-spk-in2-mic/Makefile.am new file mode 100644 index 00000000..f92fab48 --- /dev/null +++ b/src/conf/ucm/bytcht-es8316-stereo-spk-in2-mic/Makefile.am @@ -0,0 +1,4 @@ +alsaconfigdir = @ALSA_CONFIG_DIR@ +ucmdir = $(alsaconfigdir)/ucm/bytcht-es8316-stereo-spk-in2-mic +ucm_DATA = bytcht-es8316-stereo-spk-in2-mic.conf HiFi.conf +EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/bytcht-es8316-stereo-spk-in2-mic/bytcht-es8316-stereo-spk-in2-mic.conf b/src/conf/ucm/bytcht-es8316-stereo-spk-in2-mic/bytcht-es8316-stereo-spk-in2-mic.conf new file mode 100644 index 00000000..a94f0f70 --- /dev/null +++ b/src/conf/ucm/bytcht-es8316-stereo-spk-in2-mic/bytcht-es8316-stereo-spk-in2-mic.conf @@ -0,0 +1,8 @@ +SectionUseCase."HiFi" { + File "../bytcht-es8316-stereo-spk-in2-mic/HiFi.conf" + Comment "Play HiFi quality Music" +} + +SectionDefaults [ + cdev "hw:bytchtes8316" +] -- cgit v1.2.3 From 1e5ecbc806a001f6aca34168e5b7e91ee74d2c62 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 7 Jan 2019 13:15:32 +0100 Subject: conf: rename snd_conf_load1() to _snd_config_load_with_include() Always free the include path which must be mallocated by the caller. Signed-off-by: Jaroslav Kysela --- include/local.h | 2 +- src/conf.c | 39 +++++++++++++-------------------------- src/ucm/utils.c | 29 +++++++++++++++-------------- 3 files changed, 29 insertions(+), 41 deletions(-) diff --git a/include/local.h b/include/local.h index 03d8f0cc..e2cc291e 100644 --- a/include/local.h +++ b/include/local.h @@ -355,7 +355,7 @@ int snd_config_search_alias_hooks(snd_config_t *config, int _snd_conf_generic_id(const char *id); int _snd_config_load_with_include(snd_config_t *config, snd_input_t *in, - const char *default_include_path); + int override, char *default_include_path); /* convenience macros */ #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) diff --git a/src/conf.c b/src/conf.c index 1f9bad7b..b8db490c 100644 --- a/src/conf.c +++ b/src/conf.c @@ -1832,16 +1832,19 @@ int snd_config_top(snd_config_t **config) return _snd_config_make(config, 0, SND_CONFIG_TYPE_COMPOUND); } -static int snd_config_load1(snd_config_t *config, snd_input_t *in, int override, - char *default_include_path) +#ifndef DOC_HIDDEN +int _snd_config_load_with_include(snd_config_t *config, snd_input_t *in, + int override, char *default_include_path) { int err; input_t input; struct filedesc *fd, *fd_next; assert(config && in); fd = malloc(sizeof(*fd)); - if (!fd) - return -ENOMEM; + if (!fd) { + err = -ENOMEM; + goto _end_inc; + } fd->name = NULL; fd->in = in; fd->line = 1; @@ -1852,6 +1855,7 @@ static int snd_config_load1(snd_config_t *config, snd_input_t *in, int override, err = add_include_path(fd, default_include_path); if (err < 0) goto _end; + default_include_path = NULL; } input.current = fd; input.unget = 0; @@ -1900,8 +1904,11 @@ static int snd_config_load1(snd_config_t *config, snd_input_t *in, int override, free_include_paths(fd); free(fd); + _end_inc: + free(default_include_path); return err; } +#endif /** * \brief Loads a configuration tree. @@ -1921,28 +1928,8 @@ static int snd_config_load1(snd_config_t *config, snd_input_t *in, int override, */ int snd_config_load(snd_config_t *config, snd_input_t *in) { - return snd_config_load1(config, in, 0, NULL); -} - -#ifndef DOC_HIDDEN -/* load config with the default include path; used internally for UCM parser */ -int _snd_config_load_with_include(snd_config_t *config, snd_input_t *in, - const char *default_include_path) -{ - int err; - char *s = NULL; - - if (default_include_path) { - s = strdup(default_include_path); - if (!s) - return -ENOMEM; - } - err = snd_config_load1(config, in, 0, s); - if (err < 0) - free(s); - return err; + return _snd_config_load_with_include(config, in, 0, NULL); } -#endif /** * \brief Loads a configuration tree and overrides existing configuration nodes. @@ -1956,7 +1943,7 @@ int _snd_config_load_with_include(snd_config_t *config, snd_input_t *in, */ int snd_config_load_override(snd_config_t *config, snd_input_t *in) { - return snd_config_load1(config, in, 1, NULL); + return _snd_config_load_with_include(config, in, 1, NULL); } /** diff --git a/src/ucm/utils.c b/src/ucm/utils.c index ea5ac5dd..14227e0a 100644 --- a/src/ucm/utils.c +++ b/src/ucm/utils.c @@ -54,17 +54,12 @@ int uc_mgr_config_load(const char *file, snd_config_t **cfg) FILE *fp; snd_input_t *in; snd_config_t *top; - const char *default_path; + char *default_path; int err; fp = fopen(file, "r"); - if (fp == NULL) { - err = -errno; - goto __err; - } - err = snd_input_stdio_attach(&in, fp, 1); + err = fp == NULL ? -errno : snd_input_stdio_attach(&in, fp, 1); if (err < 0) { - __err: uc_error("could not open configuration file %s", file); return err; } @@ -75,19 +70,25 @@ int uc_mgr_config_load(const char *file, snd_config_t **cfg) default_path = getenv(ALSA_CONFIG_UCM_VAR); if (!default_path || !*default_path) default_path = ALSA_CONFIG_DIR "/ucm"; - err = _snd_config_load_with_include(top, in, default_path); + default_path = strdup(default_path); + if (!default_path) { + err = -ENOMEM; + goto __err2; + } + err = _snd_config_load_with_include(top, in, 0, default_path); if (err < 0) { uc_error("could not load configuration file %s", file); - snd_config_delete(top); - return err; + goto __err2; } err = snd_input_close(in); - if (err < 0) { - snd_config_delete(top); - return err; - } + if (err < 0) + goto __err2; *cfg = top; return 0; + + __err2: + snd_config_delete(top); + return err; } void uc_mgr_free_value(struct list_head *base) -- cgit v1.2.3 From ef7b098deb2652cea2659936c96cfe3229c0a782 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 7 Jan 2019 13:55:38 +0100 Subject: Release v1.1.8 Signed-off-by: Jaroslav Kysela --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 18aa9491..a0c346ef 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT(alsa-lib, 1.1.7) +AC_INIT(alsa-lib, 1.1.8) AC_CONFIG_SRCDIR([src/control/control.c]) AC_CONFIG_MACRO_DIR([m4]) -- cgit v1.2.3