From ee491b3e2fe1e35f43095d63ea7dfbbe355413ac Mon Sep 17 00:00:00 2001 From: jungsup lee Date: Mon, 27 Sep 2021 18:36:39 +0900 Subject: [PATCH] alsa-card: use tizen_usb.conf if profile set is not exist [Version] 13.0-37 [Issue Type] Bug fix Change-Id: Idde4aefcaa8718e26b6119147d2644685c8272b2 --- packaging/pulseaudio.spec | 2 +- src/modules/alsa/module-alsa-card.c | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) mode change 100644 => 100755 src/modules/alsa/module-alsa-card.c diff --git a/packaging/pulseaudio.spec b/packaging/pulseaudio.spec index 9f97e11..c9edbd6 100644 --- a/packaging/pulseaudio.spec +++ b/packaging/pulseaudio.spec @@ -3,7 +3,7 @@ Name: pulseaudio Summary: Improved Linux sound server Version: 13.0 -Release: 36 +Release: 37 Group: Multimedia/Audio License: LGPL-2.1 URL: http://pulseaudio.org diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c old mode 100644 new mode 100755 index e92b07f..e73ea98 --- a/src/modules/alsa/module-alsa-card.c +++ b/src/modules/alsa/module-alsa-card.c @@ -834,11 +834,31 @@ int pa__init(pa_module *m) { #ifdef HAVE_UDEV fn = pa_udev_get_property(u->alsa_card_index, "PULSE_PROFILE_SET"); #ifdef TIZEN_UDEV_USB_ONLY + FILE *f; pa_log("PULSE_PROFILE_SET = %s", fn); if (fn == NULL) { - fn = strdup ("tizen_usb.conf"); + fn = strdup("tizen_usb.conf"); pa_log("(new) PULSE_PROFILE_SET = %s", fn); } + else { + char *file_path = pa_maybe_prefix_path(fn, +#ifdef HAVE_RUNNING_FROM_BUILD_TREE + pa_run_from_build_tree() ? PA_SRCDIR "/modules/alsa/mixer/profile-sets/" : +#endif + PA_ALSA_PROFILE_SETS_DIR); + + if (!(f = pa_fopen_cloexec(file_path, "r"))) { + pa_log_info("Failed to open file : %s", fn); + pa_xfree(fn); + fn = strdup("tizen_usb.conf"); + pa_log("(new) PULSE_PROFILE_SET = %s", fn); + } + else { + fclose(f); + } + + pa_xfree(file_path); + } #endif #endif -- 2.7.4