diff options
Diffstat (limited to 'meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/periodfix.patch')
-rw-r--r-- | meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/periodfix.patch | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/periodfix.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/periodfix.patch deleted file mode 100644 index 4fc6c15f02..0000000000 --- a/meta/recipes-multimedia/pulseaudio/pulseaudio-0.9.15/periodfix.patch +++ /dev/null | |||
@@ -1,75 +0,0 @@ | |||
1 | X-Git-Url: http://git.0pointer.de/?p=pulseaudio.git;a=blobdiff_plain;f=src%2Fmodules%2Falsa%2Falsa-util.c;h=107bec357c7889f0197853f5e5f1951a5a2f5be0;hp=a3a045080dac0e1b30e8671443ce73a03337cf14;hb=4bffc7849f7898fa85dd6ac8e735db86b57814b3;hpb=d2b5ae5525e9036c4f91b1615879a5a07aac5bf2 | ||
2 | |||
3 | Upstream-Status: Backport | ||
4 | |||
5 | diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c | ||
6 | index a3a0450..107bec3 100644 | ||
7 | --- a/src/modules/alsa/alsa-util.c | ||
8 | +++ b/src/modules/alsa/alsa-util.c | ||
9 | @@ -334,7 +334,6 @@ int pa_alsa_set_hw_params( | ||
10 | int ret = -1; | ||
11 | snd_pcm_uframes_t _period_size = period_size ? *period_size : 0; | ||
12 | unsigned int _periods = periods ? *periods : 0; | ||
13 | - snd_pcm_uframes_t buffer_size; | ||
14 | unsigned int r = ss->rate; | ||
15 | unsigned int c = ss->channels; | ||
16 | pa_sample_format_t f = ss->format; | ||
17 | @@ -390,39 +389,47 @@ int pa_alsa_set_hw_params( | ||
18 | goto finish; | ||
19 | |||
20 | if (_period_size && tsched_size && _periods) { | ||
21 | + | ||
22 | /* Adjust the buffer sizes, if we didn't get the rate we were asking for */ | ||
23 | _period_size = (snd_pcm_uframes_t) (((uint64_t) _period_size * r) / ss->rate); | ||
24 | tsched_size = (snd_pcm_uframes_t) (((uint64_t) tsched_size * r) / ss->rate); | ||
25 | |||
26 | if (_use_tsched) { | ||
27 | - _period_size = tsched_size; | ||
28 | - _periods = 1; | ||
29 | + snd_pcm_uframes_t buffer_size; | ||
30 | |||
31 | pa_assert_se(snd_pcm_hw_params_get_buffer_size_max(hwparams, &buffer_size) == 0); | ||
32 | pa_log_debug("Maximum hw buffer size is %u ms", (unsigned) buffer_size * 1000 / r); | ||
33 | + | ||
34 | + _period_size = tsched_size; | ||
35 | + _periods = 1; | ||
36 | } | ||
37 | |||
38 | + if (_period_size > 0 && _periods > 0) { | ||
39 | + snd_pcm_uframes_t buffer_size; | ||
40 | + | ||
41 | buffer_size = _periods * _period_size; | ||
42 | |||
43 | + if ((ret = snd_pcm_hw_params_set_buffer_size_near(pcm_handle, hwparams, &buffer_size)) < 0) | ||
44 | + pa_log_info("snd_pcm_hw_params_set_buffer_size_near() failed: %s", pa_alsa_strerror(ret)); | ||
45 | + } | ||
46 | + | ||
47 | if (_periods > 0) { | ||
48 | |||
49 | - /* First we pass 0 as direction to get exactly what we asked | ||
50 | - * for. That this is necessary is presumably a bug in ALSA */ | ||
51 | + /* First we pass 0 as direction to get exactly what we | ||
52 | + * asked for. That this is necessary is presumably a bug | ||
53 | + * in ALSA. All in all this is mostly a hint to ALSA, so | ||
54 | + * we don't care if this fails. */ | ||
55 | |||
56 | dir = 0; | ||
57 | - if ((ret = snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &_periods, &dir)) < 0) { | ||
58 | + if (snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &_periods, &dir) < 0) { | ||
59 | dir = 1; | ||
60 | - if ((ret = snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &_periods, &dir)) < 0) { | ||
61 | + if (snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &_periods, &dir) < 0) { | ||
62 | dir = -1; | ||
63 | if ((ret = snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &_periods, &dir)) < 0) | ||
64 | - goto finish; | ||
65 | + pa_log_info("snd_pcm_hw_params_set_periods_near() failed: %s", pa_alsa_strerror(ret)); | ||
66 | } | ||
67 | } | ||
68 | } | ||
69 | - | ||
70 | - if (_period_size > 0) | ||
71 | - if ((ret = snd_pcm_hw_params_set_buffer_size_near(pcm_handle, hwparams, &buffer_size)) < 0) | ||
72 | - goto finish; | ||
73 | } | ||
74 | |||
75 | if ((ret = snd_pcm_hw_params(pcm_handle, hwparams)) < 0) | ||