quisk - Software Defined Radio (SDR)
Quisk uses ALSA sound drivers or PortAudio and offers these capabilities:
* Quisk can control the HiQSDR.
* As a receiver it can use the SDR-IQ by RfSpace as a sample
source. There are several decimation rates available. The QUISK
receiver will read the sample data, tune it, filter it, demodulate
it, and send the audio to the sound card for output to external
headphones or speakers.
* As a receiver it can use your soundcard as a sample source. You
supply a complex (I/Q) mixer to convert radio spectrum to a low
IF, and send that IF to the left and right inputs of the sound
card in your computer. The demodulated audio goes to the same
soundcard for output.
* Quisk can control SoftRock hardware for both receive and transmit...etc
On Jul 4, 2013, at 8:18, Alexandru Csete <oz9...@gmail.com> wrote:I just tested:
> I have just pushed a change which may fix this problem. The hint came
> from Elias (who makes the mac binary) suggesting that we need to reset
> the audio otherwise it will make noise. This is basically what you
> observed in python. Can anybody test to see if it fixes the problem?
commit fd40e97e8b86f126c05315b6c9c02e8efb1212d5
Author: Alexandru Csete <oz9...@gmail.com>
Date: Thu Jul 4 08:11:22 2013
Always reset audio output device on Mac OS X.
This hopefully fixes issue #66 and issue #78.
and it does NOT fix the problem. However, the reason it does not fix the problem is that there is no Q_WS_MAC macro, so the conditional is not having the effect you intended. (I also ran gcc -E -dM and did not find any defined macro at all similar, so I don't know what the condition should be.) If I arrange so the return is in fact disabled, then it does eliminate the problem.
I see gnuradio itself uses a Q_WS_MAC macro, but I don't see where it becomes defined.
However, this is arguably not the right fix. For example, the same problem will occur if I change the state of the “Swap I/Q” option. This is because the underlying failure occurs (as I have since found out myself) not just on stop() and start(), but also any time the flow graph is reconfigured (which in this example occurs inside of the iq_swap_cc). Which, now that I look at gnuradio source, is not surprising since unlock() actually restarts internally.
So, to do the entire job, gqrx would need a hook which rebuilds the audio sink after (rather, just before the unlock() of) any reconfiguration.
Of course, the real “right fix” is to fix gnuradio's OS X audio blocks. I suppose I should look into that. In fact, this code (3.7, but 3.6 is basically the same) looks suspicious:
bool
osx_sink::start()
{
if(!IsRunning()) {
OSStatus err = AudioOutputUnitStart(d_OutputAU);
CheckErrorAndThrow(err, "AudioOutputUnitStart",
"audio_osx_sink::start");
}
return (true);
}
bool
osx_sink::stop()
{
if(IsRunning ()) {
OSStatus err = AudioOutputUnitStop(d_OutputAU);
CheckErrorAndThrow(err, "AudioOutputUnitStop",
"audio_osx_sink::stop");
for(UInt32 n = 0; n < d_n_channels; n++) {
d_buffers[n]->abort();
}
}
return (true);
}
I don't know how these components are supposed to be used, but the circular_buffer abort() sets a flag d_doAbort which isn't cleared except by reset(), so maybe start() should include a matching reset(). I don't know whether that would be sufficient.
I'll try to find out.
On Jul 4, 2013, at 11:25, Alexandru Csete <oz9...@gmail.com> wrote:According to gcc -E -dM (disclaimer: the build chose clang++ as compiler rather than gcc, but it doesn't document a comparable option), these are the only macros starting with Q defined:
> Thanks for the quick feedback. Q_WS_MAC should be defined in Qt:
> http://qt-project.org/doc/qt-4.8/qtglobal.html
> I believe the WS stands for Window System. I see there is also a Q_OS_MAC - maybe that is defined and could be used instead? Or maybe my use of #ifndef is incorrect because there are other places (e.g. dockuirxopt.cpp) where it seems to work.
#define QT_GUI_LIB 1
#define QUAD_MAX LLONG_MAX
#define QUAD_MIN LLONG_MIN
#define QT_CORE_LIB 1
#define QT_SHARED 1
#define QT_SVG_LIB 1
#define QT_NO_DEBUG 1
#define QT_NO_DEBUG_OUTPUT 1
On the other hand, if I do the same thing to qtgui/dockrxopt.cpp, then Q_WS_MAC *is* defined. And I now observe that no Qt header file is included by receiver.cpp, so I think that explains why it isn't defined in receiver.cpp.
Perhaps the condition in receiver.cpp should depend on some sort of test for whether the audio sink is in fact an audio_osx_sink?
Are you replying to my below comments about the audio sink? I didn't mention reset() in regard to the above fix in gqrx. gqrx wouldn't be doing anything with gnuradio it isn't _already doing_ -- just at different times.
>> So, to do the entire job, gqrx would need a hook which rebuilds the audio sink after (rather, just before the unlock() of) any reconfiguration.
>
> I've been told that doing this .reset() thing on boost shared pointers is
> wrong and may not have the effect one hopes for.