|
From: | Sid Boyce |
Subject: | Re: [Discuss-gnuradio] gnuradio-companion |
Date: | Tue, 23 Apr 2013 16:57:09 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 |
I always build from source as there are
some additions from dl2stg needed for HiQSDR support.
I think I'll ask him to submit them upstream. # cat /usr/src/gnuradio_audio.diff diff --git a/gr-audio/lib/alsa/audio_alsa_source.cc b/gr-audio/lib/alsa/audio_alsa_source.cc index 4f0042b..fe41e43 100644 --- a/gr-audio/lib/alsa/audio_alsa_source.cc +++ b/gr-audio/lib/alsa/audio_alsa_source.cc @@ -95,6 +95,7 @@ audio_alsa_source::audio_alsa_source (int sampling_rate, int error; int dir; + hwParamsSet = false; // open the device for capture error = snd_pcm_open(&d_pcm_handle, d_device_name.c_str (), SND_PCM_STREAM_CAPTURE, 0); @@ -231,11 +232,15 @@ audio_alsa_source::check_topology (int ninputs, int noutputs) return false; } - // set the parameters into the driver... - err = snd_pcm_hw_params(d_pcm_handle, d_hw_params); - if (err < 0){ - output_error_msg ("snd_pcm_hw_params failed", err); - return false; + // SG + if (!hwParamsSet) { + // set the parameters into the driver... + err = snd_pcm_hw_params(d_pcm_handle, d_hw_params); + if (err < 0){ + output_error_msg ("snd_pcm_hw_params failed", err); + return false; + } + hwParamsSet = true; } d_buffer_size_bytes = diff --git a/gr-audio/lib/alsa/audio_alsa_source.h b/gr-audio/lib/alsa/audio_alsa_source.h index e38af38..7fdcdb5 100644 --- a/gr-audio/lib/alsa/audio_alsa_source.h +++ b/gr-audio/lib/alsa/audio_alsa_source.h @@ -101,6 +101,9 @@ protected: int work_s32_2x1 (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + +private: + bool hwParamsSet; }; #endif /* INCLUDED_AUDIO_ALSA_SOURCE_H */ 73 ... Sid. On 23/04/13 15:55, address@hidden wrote:
-- Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support Senior Staff Specialist, Cricket Coach Microsoft Windows Free Zone - Linux used for all Computing Tasks |
[Prev in Thread] | Current Thread | [Next in Thread] |