lib: change default number of transfers to 15

So far we had 32 * 256KB which was a bit overkill,
15 are more than enough.

15 was chosen instead of 16 because at least on Linux
there seems to be a system-wide limit of 63 transfers
(when they are 256KB large), so 4 dongles can be used
on a single machine without lowering the default transfer
number.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
This commit is contained in:
Steve Markgraf 2014-02-10 23:57:19 +01:00
parent 5b0137abaf
commit 89f73b183f
6 changed files with 8 additions and 11 deletions

View File

@ -351,9 +351,10 @@ RTLSDR_API int rtlsdr_wait_async(rtlsdr_dev_t *dev, rtlsdr_read_async_cb_t cb, v
* \param cb callback function to return received samples
* \param ctx user specific context to pass via the callback function
* \param buf_num optional buffer count, buf_num * buf_len = overall buffer size
* set to 0 for default buffer count (32)
* set to 0 for default buffer count (15)
* \param buf_len optional buffer length, must be multiple of 512,
* set to 0 for default buffer length (16 * 32 * 512)
* should be a multiple of 16384 (URB size), set to 0
* for default buffer length (16 * 32 * 512)
* \return 0 on success
*/
RTLSDR_API int rtlsdr_read_async(rtlsdr_dev_t *dev,

View File

@ -338,7 +338,7 @@ static rtlsdr_dongle_t known_devices[] = {
{ 0x1f4d, 0xd803, "PROlectrix DV107669" },
};
#define DEFAULT_BUF_NUMBER 32
#define DEFAULT_BUF_NUMBER 15
#define DEFAULT_BUF_LENGTH (16 * 32 * 512)
#define DEF_RTL_XTAL_FREQ 28800000

View File

@ -76,7 +76,6 @@
#include "convenience/convenience.h"
#define DEFAULT_SAMPLE_RATE 24000
#define DEFAULT_ASYNC_BUF_NUMBER 32
#define DEFAULT_BUF_LENGTH (1 * 16384)
#define MAXIMUM_OVERSAMPLE 16
#define MAXIMUM_BUF_LENGTH (MAXIMUM_OVERSAMPLE * DEFAULT_BUF_LENGTH)
@ -807,8 +806,7 @@ static void rtlsdr_callback(unsigned char *buf, uint32_t len, void *ctx)
static void *dongle_thread_fn(void *arg)
{
struct dongle_state *s = arg;
rtlsdr_read_async(s->dev, rtlsdr_callback, s,
DEFAULT_ASYNC_BUF_NUMBER, s->buf_len);
rtlsdr_read_async(s->dev, rtlsdr_callback, s, 0, s->buf_len);
return 0;
}

View File

@ -35,7 +35,6 @@
#include "convenience/convenience.h"
#define DEFAULT_SAMPLE_RATE 2048000
#define DEFAULT_ASYNC_BUF_NUMBER 32
#define DEFAULT_BUF_LENGTH (16 * 16384)
#define MINIMAL_BUF_LENGTH 512
#define MAXIMAL_BUF_LENGTH (256 * 16384)
@ -261,7 +260,7 @@ int main(int argc, char **argv)
} else {
fprintf(stderr, "Reading samples in async mode...\n");
r = rtlsdr_read_async(dev, rtlsdr_callback, (void *)file,
DEFAULT_ASYNC_BUF_NUMBER, out_block_size);
0, out_block_size);
}
if (do_exit)

View File

@ -92,7 +92,7 @@ void usage(void)
"\t[-f frequency to tune to [Hz]]\n"
"\t[-g gain (default: 0 for auto)]\n"
"\t[-s samplerate in Hz (default: 2048000 Hz)]\n"
"\t[-b number of buffers (default: 32, set by library)]\n"
"\t[-b number of buffers (default: 15, set by library)]\n"
"\t[-n max number of linked list buffers to keep (default: 500)]\n"
"\t[-d device index (default: 0)]\n"
"\t[-P ppm_error (default: 0)]\n");

View File

@ -44,7 +44,6 @@
#include "convenience/convenience.h"
#define DEFAULT_SAMPLE_RATE 2048000
#define DEFAULT_ASYNC_BUF_NUMBER 32
#define DEFAULT_BUF_LENGTH (16 * 16384)
#define MINIMAL_BUF_LENGTH 512
#define MAXIMAL_BUF_LENGTH (256 * 16384)
@ -406,7 +405,7 @@ int main(int argc, char **argv)
} else {
fprintf(stderr, "Reading samples in async mode...\n");
r = rtlsdr_read_async(dev, rtlsdr_callback, NULL,
DEFAULT_ASYNC_BUF_NUMBER, out_block_size);
0, out_block_size);
}
if (do_exit) {