From 09505b7b5aced7adad4b2c6146387121311d3cc6acd11f86e175eb84ffda001d Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 17 Jun 2013 09:40:34 +0000 Subject: [PATCH] Accepting request 179268 from home:tiwai:branches:multimedia:libs - Backport upstream fixes wrt chmap handling: 0006-amixer-Print-TLV-of-channel-map-controls.patch 0007-speaker-test-Fix-wrong-wave-file-played-back-in-chma.patch - Backport upstream fixes wrt amixer: 0004-amixer-Fix-the-hctl-elem-search-bug.patch 0005-amixer-fix-print_dB-for-0.99-.-0.01-range.patch OBS-URL: https://build.opensuse.org/request/show/179268 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa-utils?expand=0&rev=83 --- ...-amixer-Fix-the-hctl-elem-search-bug.patch | 25 +++++++++ ...r-fix-print_dB-for-0.99-.-0.01-range.patch | 34 +++++++++++ ...er-Print-TLV-of-channel-map-controls.patch | 56 +++++++++++++++++++ ...-wrong-wave-file-played-back-in-chma.patch | 49 ++++++++++++++++ alsa-utils.changes | 14 +++++ alsa-utils.spec | 8 +++ 6 files changed, 186 insertions(+) create mode 100644 0004-amixer-Fix-the-hctl-elem-search-bug.patch create mode 100644 0005-amixer-fix-print_dB-for-0.99-.-0.01-range.patch create mode 100644 0006-amixer-Print-TLV-of-channel-map-controls.patch create mode 100644 0007-speaker-test-Fix-wrong-wave-file-played-back-in-chma.patch diff --git a/0004-amixer-Fix-the-hctl-elem-search-bug.patch b/0004-amixer-Fix-the-hctl-elem-search-bug.patch new file mode 100644 index 0000000..0b671eb --- /dev/null +++ b/0004-amixer-Fix-the-hctl-elem-search-bug.patch @@ -0,0 +1,25 @@ +From d61924fd247c2cf0280391e076c439c9427732aa Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 27 May 2013 16:40:26 +0200 +Subject: [PATCH] amixer: Fix the hctl elem search bug + +Signed-off-by: Jaroslav Kysela +--- + amixer/amixer.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/amixer/amixer.c b/amixer/amixer.c +index 2f1521b..92b0f83 100644 +--- a/amixer/amixer.c ++++ b/amixer/amixer.c +@@ -1105,6 +1105,7 @@ static int cset(int argc, char *argv[], int roflag, int keep_handle) + } + return err; + } ++ snd_ctl_elem_info_get_id(info, id); /* FIXME: Remove it when hctl find works ok !!! */ + if (!roflag) { + snd_ctl_elem_value_set_id(control, id); + if ((err = snd_ctl_elem_read(handle, control)) < 0) { +-- +1.8.2.3 + diff --git a/0005-amixer-fix-print_dB-for-0.99-.-0.01-range.patch b/0005-amixer-fix-print_dB-for-0.99-.-0.01-range.patch new file mode 100644 index 0000000..aaeac1a --- /dev/null +++ b/0005-amixer-fix-print_dB-for-0.99-.-0.01-range.patch @@ -0,0 +1,34 @@ +From c80a38dbf53531d57c9bd4ccdc05553bd7fb79a1 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 28 May 2013 08:43:30 +0200 +Subject: [PATCH] amixer: fix print_dB for -0.99 .. -0.01 range + +The first number is 0 when input dB (hundreds) is in range -99 .. -1 . +The printed number was positive in this case. This patch fixes this issue. + +Reported-by: Tom Becker +Signed-off-by: Jaroslav Kysela +--- + amixer/amixer.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/amixer/amixer.c b/amixer/amixer.c +index 92b0f83..fe83b49 100644 +--- a/amixer/amixer.c ++++ b/amixer/amixer.c +@@ -431,7 +431,11 @@ static void print_spaces(unsigned int spaces) + + static void print_dB(long dB) + { +- printf("%li.%02lidB", dB / 100, (dB < 0 ? -dB : dB) % 100); ++ if (dB < 0) { ++ printf("-%li.%02lidB", -dB / 100, -dB % 100); ++ } else { ++ printf("%li.%02lidB", dB / 100, dB % 100); ++ } + } + + static void decode_tlv(unsigned int spaces, unsigned int *tlv, unsigned int tlv_size) +-- +1.8.2.3 + diff --git a/0006-amixer-Print-TLV-of-channel-map-controls.patch b/0006-amixer-Print-TLV-of-channel-map-controls.patch new file mode 100644 index 0000000..abbb571 --- /dev/null +++ b/0006-amixer-Print-TLV-of-channel-map-controls.patch @@ -0,0 +1,56 @@ +From 9fe90a020ccd2662120b498e9a5cdd4ea1b959ba Mon Sep 17 00:00:00 2001 +From: David Henningsson +Date: Fri, 14 Jun 2013 11:41:01 +0200 +Subject: [PATCH] amixer: Print TLV of channel map controls + +Previously these were written as "unk-25..." which wasn't very user friendly. + +Signed-off-by: David Henningsson +Signed-off-by: Jaroslav Kysela +--- + amixer/amixer.c | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/amixer/amixer.c b/amixer/amixer.c +index fe83b49..7727943 100644 +--- a/amixer/amixer.c ++++ b/amixer/amixer.c +@@ -443,6 +443,7 @@ static void decode_tlv(unsigned int spaces, unsigned int *tlv, unsigned int tlv_ + unsigned int type = tlv[0]; + unsigned int size; + unsigned int idx = 0; ++ const char *chmap_type = NULL; + + if (tlv_size < 2 * sizeof(unsigned int)) { + printf("TLV size error!\n"); +@@ -541,6 +542,27 @@ static void decode_tlv(unsigned int spaces, unsigned int *tlv, unsigned int tlv_ + } + break; + #endif ++#ifdef SND_CTL_TLVT_CHMAP_FIXED ++ case SND_CTL_TLVT_CHMAP_FIXED: ++ chmap_type = "fixed"; ++ /* Fall through */ ++ case SND_CTL_TLVT_CHMAP_VAR: ++ if (!chmap_type) ++ chmap_type = "variable"; ++ /* Fall through */ ++ case SND_CTL_TLVT_CHMAP_PAIRED: ++ if (!chmap_type) ++ chmap_type = "paired"; ++ printf("chmap-%s=", chmap_type); ++ ++ while (size > 0) { ++ printf("%s", snd_pcm_chmap_name(tlv[idx++])); ++ size -= sizeof(unsigned int); ++ if (size > 0) ++ printf(","); ++ } ++ break; ++#endif + default: + printf("unk-%i-", type); + while (size > 0) { +-- +1.8.3 + diff --git a/0007-speaker-test-Fix-wrong-wave-file-played-back-in-chma.patch b/0007-speaker-test-Fix-wrong-wave-file-played-back-in-chma.patch new file mode 100644 index 0000000..52a6ddd --- /dev/null +++ b/0007-speaker-test-Fix-wrong-wave-file-played-back-in-chma.patch @@ -0,0 +1,49 @@ +From 7ac9508c4e20097290b322c661f550e7c24bfa44 Mon Sep 17 00:00:00 2001 +From: David Henningsson +Date: Mon, 10 Jun 2013 16:42:48 +0200 +Subject: [PATCH] speaker-test: Fix wrong wave file played back in chmap setup + +When explicitly specifying channel maps, we need to use that when +loading wave files so the correct file is played back. + +Signed-off-by: David Henningsson +Signed-off-by: Jaroslav Kysela +--- + speaker-test/speaker-test.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/speaker-test/speaker-test.c b/speaker-test/speaker-test.c +index a41b5bd..d35065f 100644 +--- a/speaker-test/speaker-test.c ++++ b/speaker-test/speaker-test.c +@@ -771,8 +771,16 @@ static int setup_wav_file(int chn) + + if (given_test_wav_file) + return check_wav_file(chn, given_test_wav_file); +- else +- return check_wav_file(chn, wavs[chn]); ++ ++#ifdef CONFIG_SUPPORT_CHMAP ++ if (channel_map_set && chn < channel_map->channels) { ++ int channel = channel_map->pos[chn] - SND_CHMAP_FL; ++ if (channel >= 0 && channel < MAX_CHANNELS) ++ return check_wav_file(chn, wavs[channel]); ++ } ++#endif ++ ++ return check_wav_file(chn, wavs[chn]); + } + + static int read_wav(uint16_t *buf, int channel, int offset, int bufsize) +@@ -1179,7 +1187,7 @@ int main(int argc, char *argv[]) { + + if (test_type == TEST_WAV) { + for (chn = 0; chn < channels; chn++) { +- if (setup_wav_file(chn) < 0) ++ if (setup_wav_file(get_speaker_channel(chn)) < 0) + prg_exit(EXIT_FAILURE); + } + } +-- +1.8.3 + diff --git a/alsa-utils.changes b/alsa-utils.changes index 76fc4d0..19c2f97 100644 --- a/alsa-utils.changes +++ b/alsa-utils.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Mon Jun 17 10:14:18 CEST 2013 - tiwai@suse.de + +- Backport upstream fixes wrt chmap handling: + 0006-amixer-Print-TLV-of-channel-map-controls.patch + 0007-speaker-test-Fix-wrong-wave-file-played-back-in-chma.patch + +------------------------------------------------------------------- +Wed May 29 11:03:43 CEST 2013 - tiwai@suse.de + +- Backport upstream fixes wrt amixer: + 0004-amixer-Fix-the-hctl-elem-search-bug.patch + 0005-amixer-fix-print_dB-for-0.99-.-0.01-range.patch + ------------------------------------------------------------------- Mon May 27 09:42:39 CEST 2013 - tiwai@suse.de diff --git a/alsa-utils.spec b/alsa-utils.spec index ef372ff..3db4d25 100644 --- a/alsa-utils.spec +++ b/alsa-utils.spec @@ -63,6 +63,10 @@ Source99: ca0106 Patch1: 0001-Require-alsa-lib-1.0.27.patch Patch2: 0002-alsactl-init-ca0106-file-was-omitted.patch Patch3: 0003-alsactl-return-back-the-udevrules_DATA-rule-for-90-a.patch +Patch4: 0004-amixer-Fix-the-hctl-elem-search-bug.patch +Patch5: 0005-amixer-fix-print_dB-for-0.99-.-0.01-range.patch +Patch6: 0006-amixer-Print-TLV-of-channel-map-controls.patch +Patch7: 0007-speaker-test-Fix-wrong-wave-file-played-back-in-chma.patch # Patch99: alsa-utils-gettext-version-removal.diff Url: http://www.alsa-project.org/ @@ -81,6 +85,10 @@ sed -i -e's/EXTRA_DIST= config.rpath /EXTRA_DIST=/' Makefile.am %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 cp %{S:99} alsactl/init # %if %suse_version < 1020