[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss-gnuradio] openSUSE x86_64 build with changes for HiQSDR
From: |
Sid Boyce |
Subject: |
[Discuss-gnuradio] openSUSE x86_64 build with changes for HiQSDR |
Date: |
Thu, 28 Mar 2013 16:28:29 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 |
These changes were made for version 1.2.15 to support the HiQSDR program
qsdr.
I have been able to hand patch them into master and next where the
filenames change from "audio_alsa_source.*" to "alsa_source.*" and they
both build without problems.
The problem I have with qsdr -- the audio always runs for around 30
seconds then goes silent until qsdr is restarted and it happens again.
The waterfall, graph and all controls in the qsdr app continue to work.
This is just a **heads up** in case someone can see a problem with them
included.
I shall take this up with the author of qsdr to see if he can see a
problem in qsdr that may have been introduced by including this patch in
later than 1.2.15 and if changes to qsdr are needed.
73 ... Sid.
# 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 */
--
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] |
- [Discuss-gnuradio] openSUSE x86_64 build with changes for HiQSDR,
Sid Boyce <=