Hi, I've compiled osmo-fl2k with libusb-1.0.22-1 and this happens when I tried to start fl2k_test:
feanor@silmaril ~> fl2k_test -s 162e6 Using 6 zero-copy buffers libusb: error [op_dev_mem_alloc] alloc dev mem failed errno 12 Failed to allocate zero-copy buffer for transfer 4 Reporting PPM error measurement every 10 seconds... Press ^C after a few minutes. real sample rate: 15372775 current PPM: -905106 cumulative PPM: -905106
then when I try to connect red and ground output to oscilloscope, there is no output at all, even if I use fl2k_fm
Hi Ignatius,
On 01.05.2018 07:16, Ignatius Rivaldi wrote:
feanor@silmaril ~> fl2k_test -s 162e6 Using 6 zero-copy buffers libusb: error [op_dev_mem_alloc] alloc dev mem failed errno 12 Failed to allocate zero-copy buffer for transfer 4
The lib will try to allocate contiguous device memory from the Kernel through libusb, this may fail for various reasons (not enough contiguous DMA-capable memory because CONFIG_CMA_SIZE_MBYTES is set too low etc).
However, osmo-fl2k falls back to buffers in userspace should the zero-copy buffer allocation fail, so no need to worry here.
real sample rate: 15372775 current PPM: -905106 cumulative PPM: -905106
From the output above it seems that your FL2000 device is connected to a
USB 2.0 port, so it only can achieve 14-15 MS/s. You need a USB 3.0 port for higher rates.
then when I try to connect red and ground output to oscilloscope, there is no output at all, even if I use fl2k_fm
Yes, if the sample rate the host can supply does not match the PLL frequency of the FL2000, the line buffer in the chip will underrun and then there is no output anymore until re-initializing the device.
Regards, Steve
not enough contiguous DMA-capable memory because CONFIG_CMA_SIZE_MBYTES is set too low etc
I have the same error message running a standard ubuntu kernel 4.15.0-21-generic with 16 GB RAM. I'm not familiar with setting the right kernel options. My config file for the kernel just shows:
CONFIG_CMA=y # CONFIG_CMA_DEBUG is not set # CONFIG_CMA_DEBUGFS is not set CONFIG_CMA_AREAS=7
I haven't been able to receive a FM signal yet. My output from the fl2k_test shows:
sudo fl2k_test -s 162e6 Allocating 6 zero-copy buffers libusb: error [op_dev_mem_alloc] alloc dev mem failed errno 12 Failed to allocate zero-copy buffer for transfer 4 Falling back to buffers in userspace Reporting PPM error measurement every 10 seconds... Press ^C after a few minutes. real sample rate: 113962068 current PPM: -296530 cumulative PPM: -296530 real sample rate: 113975309 current PPM: -296449 cumulative PPM: -296489 real sample rate: 114139355 current PPM: -295436 cumulative PPM: -296136
Do I need to change my kernel settings or will the device simply won't work?
Am Mittwoch, den 30.05.2018, 17:57 +0200 schrieb Hannes Wagner:
sudo fl2k_test -s 162e6 […] real sample rate: 113962068 current PPM: -296530 cumulative PPM: -296530
^^^^^^^
Try to decrease your samplerate. 162 MHz is to much. I have to use about 140 MHz on ASMedia/AMD.
See: http://osmocom.org/projects/osmo-fl2k/wiki#USB-Host-Controller-comparison
Hi,
On 30.05.2018 17:57, Hannes Wagner wrote:
I haven't been able to receive a FM signal yet. My output from the fl2k_test shows:
What are the commandline parameters you are using for fl2k_fm? As you can see below, you need to limit your samplerate to < 114 MS/s.
sudo fl2k_test -s 162e6 Allocating 6 zero-copy buffers libusb: error [op_dev_mem_alloc] alloc dev mem failed errno 12 Failed to allocate zero-copy buffer for transfer 4 Falling back to buffers in userspace Reporting PPM error measurement every 10 seconds... Press ^C after a few minutes. real sample rate: 113962068 current PPM: -296530 cumulative PPM: -296530 real sample rate: 113975309 current PPM: -296449 cumulative PPM: -296489 real sample rate: 114139355 current PPM: -295436 cumulative PPM: -296136
Do I need to change my kernel settings or will the device simply won't work?
What happens according to the output: libfl2k is running on a system that seems to support zero-copy transfers, but fails during allocation. Probably there is not enough DMA-able contiguous memory present for the Kernel. This is no big deal, as libfl2k will then de-allocate the already allocated zero-copy buffers, and then fall back to buffers allocated with malloc() (which of course then will require copy_from_user() in the Kernel). So it should work just fine, you just won't get the performance benefit of zero-copy buffers. And according to the output of fl2k_test, you are getting around 114 MS/s, as you are probably using a Renesas uPD7202xx controller. If you want to generate any output, you need to set the sample rate to a value below that.
Regards, Steve