hackrf: don't skip first samples when streaming

This commit is contained in:
Dimitri Stolnikov 2013-04-26 21:04:30 +02:00
parent 98a805481e
commit e157449a9e
2 changed files with 1 additions and 10 deletions

View File

@ -44,7 +44,6 @@ using namespace boost::assign;
#define BUF_LEN (16 * 32 * 512) /* must be multiple of 512 */ #define BUF_LEN (16 * 32 * 512) /* must be multiple of 512 */
#define BUF_NUM 32 #define BUF_NUM 32
#define BUF_SKIP 1 // buffers to skip due to initial garbage
#define BYTES_PER_SAMPLE 2 // HackRF device delivers 8 bit unsigned IQ data #define BYTES_PER_SAMPLE 2 // HackRF device delivers 8 bit unsigned IQ data
@ -85,8 +84,7 @@ hackrf_source_c::hackrf_source_c (const std::string &args)
_auto_gain(false), _auto_gain(false),
_amp_gain(0), _amp_gain(0),
_lna_gain(0), _lna_gain(0),
_vga_gain(0), _vga_gain(0)
_skipped(0)
{ {
int ret; int ret;
uint16_t val; uint16_t val;
@ -227,11 +225,6 @@ int hackrf_source_c::_hackrf_rx_callback(hackrf_transfer *transfer)
int hackrf_source_c::hackrf_rx_callback(unsigned char *buf, uint32_t len) int hackrf_source_c::hackrf_rx_callback(unsigned char *buf, uint32_t len)
{ {
if (_skipped < BUF_SKIP) {
_skipped++;
return 0;
}
{ {
boost::mutex::scoped_lock lock( _buf_mutex ); boost::mutex::scoped_lock lock( _buf_mutex );

View File

@ -137,7 +137,6 @@ private:
unsigned int _buf_used; unsigned int _buf_used;
boost::mutex _buf_mutex; boost::mutex _buf_mutex;
boost::condition_variable _buf_cond; boost::condition_variable _buf_cond;
bool _running;
unsigned int _buf_offset; unsigned int _buf_offset;
int _samp_avail; int _samp_avail;
@ -149,7 +148,6 @@ private:
double _amp_gain; double _amp_gain;
double _lna_gain; double _lna_gain;
double _vga_gain; double _vga_gain;
unsigned int _skipped;
double _bandwidth; double _bandwidth;
}; };