Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in lib airspy? Incorrect Sample_Count value in packing mode. #37

Closed
gssbox opened this issue Jul 26, 2016 · 1 comment
Closed

Comments

@gssbox
Copy link

gssbox commented Jul 26, 2016

Good afternoon!

I think I found a bug in the code in LibAirSpy Packing mode on.

When allocating memory:
static int allocate_transfers (airspy_device_t * const device)
{
...
if (device-> packing_enabled)
{
//Error! Invalid considered the number of unpacked samples
// sample_count = ((device-> buffer_size / 2) * 4) / 3; // packed_sample_count = 98304
sample_count = (((device-> buffer_size / 2) * 4) / 3)/0.75; // unpacked_sample_count = 131072
}
else
{
sample_count = device-> buffer_size / 2;
}
...
}

Also in
static void * consumer_threadproc (void * arg)
{
....

if (device-> packing_enabled)
{
sample_count = ((device-> buffer_size / 2) * 4) / 3; // packed_sample_count = 98304

if (device-> sample_type! = AIRSPY_SAMPLE_RAW)
{
unpack_samples ((uint32_t *) input_samples, device-> unpacked_samples, sample_count);

input_samples = device-> unpacked_samples;
// Here you need to add a new SampleCount
sample_count = sample_count / 0,75; // unpacked_sample_count = 131072
}
}
else
{
sample_count = device-> buffer_size / 2;
}
....

This is mistake? Or am I wrong understand unpacking operation 12 to 16 bit.

@touil
Copy link
Member

touil commented Jul 26, 2016

Make sure you understand the code before filing an issue. This is not a discussion tool.

@touil touil closed this as completed Jul 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants