From a8705ee2f61d561efb9e53d3ff616a4d1e13f9e8c584e2ddf936efeefbb00387 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Mon, 5 Nov 2007 23:05:07 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/alsa?expand=0&rev=24 --- alsa-lib-ioplug-fix.diff | 50 ++++++++++++++++++++++++++++++++++++++++ alsa.changes | 6 +++++ alsa.spec | 7 +++++- 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 alsa-lib-ioplug-fix.diff diff --git a/alsa-lib-ioplug-fix.diff b/alsa-lib-ioplug-fix.diff new file mode 100644 index 0000000..f001f83 --- /dev/null +++ b/alsa-lib-ioplug-fix.diff @@ -0,0 +1,50 @@ +# HG changeset patch +# User tiwai +# Date 1194263206 -3600 +# Node ID c82755151f76b40eb0f99dec961b073f450763bb +# Parent 8069595414f25236461492265786670352ac4d3a +ioplug - Fix the refinement of period_* after periods + +When changing only PERIODS after BUFFER_*, ioplug doesn't update +the corresponding PERIOD_* parameters properly. This should fix +ALSA bug#2601. + +diff -r 8069595414f2 -r c82755151f76 src/pcm/pcm_ioplug.c +--- a/src/pcm/pcm_ioplug.c Tue Oct 30 14:28:30 2007 +0100 ++++ b/src/pcm/pcm_ioplug.c Mon Nov 05 12:46:46 2007 +0100 +@@ -313,7 +313,7 @@ static int snd_pcm_ioplug_hw_refine(snd_ + if (err < 0) + return err; + change2 |= err; +- /* periods = buffer_bytes / periods */ ++ /* periods = buffer_bytes / period_bytes */ + err = rule_div(params, SND_PCM_HW_PARAM_PERIODS, + SND_PCM_HW_PARAM_BUFFER_BYTES, + SND_PCM_HW_PARAM_PERIOD_BYTES); +@@ -340,6 +340,26 @@ static int snd_pcm_ioplug_hw_refine(snd_ + err = refine_back_time_and_size(params, SND_PCM_HW_PARAM_BUFFER_TIME, + SND_PCM_HW_PARAM_BUFFER_SIZE, + SND_PCM_HW_PARAM_BUFFER_BYTES); ++ if (err < 0) ++ return err; ++ } ++ ++ /* period_bytes = buffer_bytes / periods */ ++ err = rule_div(params, SND_PCM_HW_PARAM_PERIOD_BYTES, ++ SND_PCM_HW_PARAM_BUFFER_BYTES, ++ SND_PCM_HW_PARAM_PERIODS); ++ if (err < 0) ++ return err; ++ if (err) { ++ /* update period_size and period_time */ ++ change |= err; ++ err = snd_ext_parm_interval_refine(hw_param_interval(params, SND_PCM_HW_PARAM_PERIOD_BYTES), ++ io->params, SND_PCM_IOPLUG_HW_PERIOD_BYTES); ++ if (err < 0) ++ return err; ++ err = refine_back_time_and_size(params, SND_PCM_HW_PARAM_PERIOD_TIME, ++ SND_PCM_HW_PARAM_PERIOD_SIZE, ++ SND_PCM_HW_PARAM_PERIOD_BYTES); + if (err < 0) + return err; + } diff --git a/alsa.changes b/alsa.changes index feed29b..02cc651 100644 --- a/alsa.changes +++ b/alsa.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Nov 5 17:29:33 CET 2007 - tiwai@suse.de + +- fix ioplug plugin (for pulse or others) to adjust period hw + params properly. + ------------------------------------------------------------------- Tue Oct 30 14:32:59 CET 2007 - tiwai@suse.de diff --git a/alsa.spec b/alsa.spec index 638d767..cd47b35 100644 --- a/alsa.spec +++ b/alsa.spec @@ -21,7 +21,7 @@ PreReq: %insserv_prereq %fillup_prereq AutoReqProv: on Summary: Advanced Linux Sound Architecture Version: 1.0.15 -Release: 5 +Release: 7 Source: ftp://ftp.alsa-project.org/pub/lib/alsa-lib-%{package_version}.tar.bz2 Source8: 40-alsa.rules Source11: alsasound @@ -36,6 +36,7 @@ Source30: all_notes_off Source31: all_notes_off.bin Source32: all_notes_off.mid Patch: alsa-lib-hg-fixes.diff +Patch1: alsa-lib-ioplug-fix.diff Url: http://www.alsa-project.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -108,6 +109,7 @@ Authors: %prep %setup -q -n alsa-lib-%{package_version} %patch -p1 +%patch1 -p1 %{?suse_update_config:%{suse_update_config -f .}} %build @@ -248,6 +250,9 @@ exit 0 %{_libdir}/alsa-lib %{_datadir}/alsa %changelog +* Mon Nov 05 2007 - tiwai@suse.de +- fix ioplug plugin (for pulse or others) to adjust period hw + params properly. * Tue Oct 30 2007 - tiwai@suse.de - re-add assert.h to asoundlib.h since some packages got broken * Mon Oct 29 2007 - tiwai@suse.de