From e370021c685a2676786d2e742f05a81a8b708f1e Mon Sep 17 00:00:00 2001 From: Palo Kisa Date: Thu, 29 Nov 2018 15:36:17 +0100 Subject: audio: Fix parameter setting failure with alsa v1.1.7 --- src/audio/audio_device.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/audio/audio_device.cpp') diff --git a/src/audio/audio_device.cpp b/src/audio/audio_device.cpp index 593c0d8..dd61e8d 100644 --- a/src/audio/audio_device.cpp +++ b/src/audio/audio_device.cpp @@ -540,7 +540,6 @@ bool t_alsa_io::open(const string& device, bool playback, bool capture, bool blo // Note: The buffersize is in FRAMES, not BYTES (one frame = sizeof(sample) * channels) snd_pcm_uframes_t buffersize; unsigned int periods = 8; // Double buffering - int dir = 1; // Set the size of one period in samples if (short_latency) { @@ -553,7 +552,7 @@ bool t_alsa_io::open(const string& device, bool playback, bool capture, bool blo buffersize = 1024; } if ((err = snd_pcm_hw_params_set_period_size_near (pcm_ptr, hw_params, - &buffersize, &dir)) < 0) + &buffersize, nullptr)) < 0) { HANDLE_ALSA_ERROR("snd_pcm_hw_params_set_period_size_near"); } @@ -569,10 +568,9 @@ bool t_alsa_io::open(const string& device, bool playback, bool capture, bool blo periods *= 4; } - dir = 1; - if ((err = snd_pcm_hw_params_set_periods(pcm_ptr, hw_params, periods, dir)) < 0) { + if ((err = snd_pcm_hw_params_set_periods(pcm_ptr, hw_params, periods, 1)) < 0) { if ((err = snd_pcm_hw_params_set_periods_near(pcm_ptr, hw_params, - &periods, &dir)) < 0) + &periods, nullptr)) < 0) { HANDLE_ALSA_ERROR("snd_pcm_hw_params_set_periods"); } -- cgit v1.2.3