LMSDevice: Print sample rate range + actual sample rate after setting it

Change-Id: I19c1a5b2d2431b8d39e277244e313f6e559e4d25
This commit is contained in:
Harald Welte 2018-04-28 21:41:07 +02:00
parent 9cb4f27112
commit a438114173
1 changed files with 9 additions and 0 deletions

View File

@ -118,9 +118,18 @@ int LMSDevice::open(const std::string &args, int ref, bool swap_channels)
return -1;
}
lms_range_t range;
if (LMS_GetSampleRateRange(m_lms_dev, LMS_CH_RX, &range))
goto out_close;
LOG(DEBUG) << "Sample Rate: Min=" << range.min << " Max=" << range.max << " Step=" << range.step;
LOG(DEBUG) << "Setting sample rate to " << GSMRATE*sps << " " << sps;
if (LMS_SetSampleRate(m_lms_dev, GSMRATE*sps, 32) < 0)
goto out_close;
float_type sr_host, sr_rf;
if (LMS_GetSampleRate(m_lms_dev, LMS_CH_RX, 0, &sr_host, &sr_rf))
goto out_close;
LOG(DEBUG) << "Sample Rate: Host=" << sr_host << " RF=" << sr_rf;
/* FIXME: make this device/model dependent, like UHDDevice:dev_param_map! */
ts_offset = static_cast<TIMESTAMP>(8.9e-5 * GSMRATE);