]> code.delx.au - pulseaudio/commit
alsa-util: Reset hwparams_copy before the second try of buffer setup
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Fri, 21 Mar 2014 07:18:40 +0000 (09:18 +0200)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Mon, 24 Mar 2014 08:24:00 +0000 (10:24 +0200)
commit3c73e2130fd65e147c487b0b84c1a8b6a8afa04c
treedc3e216776d8cb518b3c100958093d2cf152c50b
parente7a77384fb6a034cde1975dc0b212ba7a9d9a93e
alsa-util: Reset hwparams_copy before the second try of buffer setup

hwparams_copy needs to be reset (as it is also reset for the third and
fourth try) before the second try.

If the reset is not done and the first try fails:
D: [lt-pulseaudio] alsa-util.c: Maximum hw buffer size is 743 ms
I: [lt-pulseaudio] alsa-util.c: snd_pcm_hw_params_set_buffer_size_near() failed: Invalid argument
I: [lt-pulseaudio] alsa-util.c: snd_pcm_hw_params_set_period_size_near() failed: Invalid argument
I: [lt-pulseaudio] alsa-util.c: snd_pcm_hw_params_set_buffer_size_near() failed: Invalid argument
D: [lt-pulseaudio] alsa-util.c: Set only period size (to 1102 samples).

We have three failures and finally the fourth (only period size) succeed.

With this patch:
D: [lt-pulseaudio] alsa-util.c: Maximum hw buffer size is 743 ms
I: [lt-pulseaudio] alsa-util.c: snd_pcm_hw_params_set_buffer_size_near() failed: Invalid argument
D: [lt-pulseaudio] alsa-util.c: Set period size first (to 1102 samples), buffer size second (to 4408 samples).

We only fail with the first try, the second (period followed by buffer) is
fine.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
src/modules/alsa/alsa-util.c