alsa/0033-pcm-restore-hw-params-on-set-latency-failed.patch
OBS User mrdocs 37a7c30e09 Accepting request 320429 from home:tiwai:branches:multimedia:libs
- Backport upstream fixes: surround41/50 chmap fix, UCM documents,
  config string fix, PCM timestamp query API, replacement of list.h
  with LGPL:
  0023-surround41-50.conf-Use-chmap-syntax-for-better-flexi.patch
  0024-ucm-docs-fix-doxygen-exclude-patch-for-UCM-local-hea.patch
  0025-ucm-docs-Fix-doxygen-formatting-for-UCM-main-page.patch
  0026-docs-Add-UCM-link-to-main-doxygen-page.patch
  0027-Replace-unsafe-characters-with-_-in-card-name.patch
  0028-pcm-add-helper-functions-to-query-timestamping-capab.patch
  0029-pcm-add-support-for-get-set_audio_htstamp_config.patch
  0030-pcm-add-support-for-new-STATUS_EXT-ioctl.patch
  0031-test-fix-audio_time-with-new-get-set-audio_tstamp_co.patch
  0032-test-audio_time-show-report-validity-and-accuracy.patch
  0033-pcm-restore-hw-params-on-set-latency-failed.patch
  0034-Replace-list.h-with-its-own-version.patch
- Backport topology API addition patches:
  0035-topology-uapi-Add-UAPI-headers-for-topology-ABI.patch
  0036-topology-Add-topology-core-parser.patch
  0037-topology-Add-text-section-parser.patch
  0038-topology-Add-PCM-parser.patch
  0039-topology-Add-operations-parser.patch
  0040-topology-Add-private-data-parser.patch
  0041-topology-Add-DAPM-object-parser.patch
  0042-topology-Add-CTL-parser.patch
  0043-topology-Add-Channel-map-parser.patch
  0044-topology-Add-binary-file-builder.patch
  0045-topology-autotools-Add-build-support-for-topology-co.patch
  0046-topology-doxygen-Add-doxygen-support-for-topology-co.patch
  0047-conf-topology-Add-topology-file-for-broadwell-audio-.patch
  0048-topology-Fix-missing-inclusion-of-ctype.h.patch

OBS-URL: https://build.opensuse.org/request/show/320429
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=186
2015-08-05 05:28:10 +00:00

45 lines
1.7 KiB
Diff

From 77b6be63876ee46a95320e77735d977edeedd44a Mon Sep 17 00:00:00 2001
From: Martin Geier <martin.geier@streamunlimited.com>
Date: Fri, 24 Jul 2015 09:30:57 +0200
Subject: [PATCH 33/49] pcm: restore hw params on set latency failed
When method snd_pcm_set_params sets sample rate to 22050 and latency to 50000
to davinci soc driver method snd_pcm_hw_params_set_buffer_time_near fails
and variable params is already changed in the method so the next method
snd_pcm_hw_params_set_period_time_near fails also.
Signed-off-by: Martin Geier <martin.geier@streamunlimited.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index bae1d1653904..f5fc728518d8 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -8004,7 +8004,7 @@ int snd_pcm_set_params(snd_pcm_t *pcm,
int soft_resample,
unsigned int latency)
{
- snd_pcm_hw_params_t *params;
+ snd_pcm_hw_params_t *params, params_saved;
snd_pcm_sw_params_t *swparams;
const char *s = snd_pcm_stream_name(snd_pcm_stream(pcm));
snd_pcm_uframes_t buffer_size, period_size;
@@ -8057,9 +8057,11 @@ int snd_pcm_set_params(snd_pcm_t *pcm,
return -EINVAL;
}
/* set the buffer time */
+ params_saved = *params;
err = INTERNAL(snd_pcm_hw_params_set_buffer_time_near)(pcm, params, &latency, NULL);
if (err < 0) {
/* error path -> set period size as first */
+ *params = params_saved;
/* set the period time */
period_time = latency / 4;
err = INTERNAL(snd_pcm_hw_params_set_period_time_near)(pcm, params, &period_time, NULL);
--
2.5.0