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

FCDPro+ support #88

Merged
merged 1 commit into from
Jul 16, 2013
Merged

FCDPro+ support #88

merged 1 commit into from
Jul 16, 2013

Conversation

bazuchan
Copy link
Contributor

FCDPro+ support was added to gr-osmosdr
http://cgit.osmocom.org/gr-osmosdr/commit/?id=3ce7c3398102e49f5fe7411a8e0fb5700236a3c7
gqrx needs to set correct sample rate for FCDPro+

@csete
Copy link
Collaborator

csete commented Jul 16, 2013

Thanks, I have been waiting for this ;-)
Can you tell me which linux distribution you are using? I am having trouble using my FCD Pro+ on Xubuntu 13.04 with kernel 3.8 - USB audio seems to be broken for devices with internal clocks (the original FCD Pro works fine).

csete added a commit that referenced this pull request Jul 16, 2013
Add support for Funcube Dongle Pro+
@csete csete merged commit 31420fd into gqrx-sdr:master Jul 16, 2013
@bazuchan
Copy link
Contributor Author

On Tue, 16 Jul 2013 07:08:57 -0700
Alexandru Csete notifications@github.com wrote:

Thanks, I have been waiting for this ;-)
Can you tell me which linux distribution you are using? I am having
trouble using my FCD Pro+ on Xubuntu 13.04 with kernel 3.8
Exactly the one I'm using.

  • USB
    audio seems to be broken for devices with internal clocks (the origin
    FCD Pro works fine).
    I don't see any problems with audio (although I have had some problems
    with hid device). How do you check for this borkage?

Alexey Bazhin
mailto:baz@yume.ru
ICQ 125125882

@csete
Copy link
Collaborator

csete commented Jul 16, 2013

On Tue, Jul 16, 2013 at 4:18 PM, bazuchan notifications@github.com wrote:

On Tue, 16 Jul 2013 07:08:57 -0700
Alexandru Csete notifications@github.com wrote:

Thanks, I have been waiting for this ;-)
Can you tell me which linux distribution you are using? I am having
trouble using my FCD Pro+ on Xubuntu 13.04 with kernel 3.8
Exactly the one I'm using.

  • USB
    audio seems to be broken for devices with internal clocks (the origin
    FCD Pro works fine).
    I don't see any problems with audio (although I have had some problems
    with hid device). How do you check for this borkage?

I kept getting aOaOaO... and kernel messages:
cannot submit urb 0, error -28: not enough bandwidth
5:1:1: cannot get freq at ep 0x81

I have just applied your the patch you posted on the FCD Pro+ list on
July 1 and it works! So it must be the problem.
Thanks a lot!

Alex

@bazuchan
Copy link
Contributor Author

On Tue, 16 Jul 2013 07:25:56 -0700
Alexandru Csete notifications@github.com wrote:

On Tue, Jul 16, 2013 at 4:18 PM, bazuchan notifications@github.com
wrote:

On Tue, 16 Jul 2013 07:08:57 -0700
Alexandru Csete notifications@github.com wrote:

Thanks, I have been waiting for this ;-)
Can you tell me which linux distribution you are using? I am
having trouble using my FCD Pro+ on Xubuntu 13.04 with kernel 3.8
Exactly the one I'm using.

  • USB
    audio seems to be broken for devices with internal clocks (the
    origin FCD Pro works fine).
    I don't see any problems with audio (although I have had some
    problems with hid device). How do you check for this borkage?

I kept getting aOaOaO... and kernel messages:
cannot submit urb 0, error -28: not enough bandwidth
5:1:1: cannot get freq at ep 0x81

I have just applied your the patch you posted on the FCD Pro+ list on
July 1 and it works! So it must be the problem.
Thanks a lot!

Yes, it's seems to be a bug in ehci_hcd, it reserves too much bandwidth
for hid device (because it interprets timings given by fcdp+ like it is
usb high speed device and not like full speed, ms vs us). And originally
gr-fcdproplus keeps the device open instead of open/close when it needs
to do something. I was talking about this with Volker (author of
gr-fcdproplus) and on his system he is having occasional segfaults when
he opens device frequently (and I don't have those segfaults) and he
don't have this problem with bandwidth. So for now it's unclear how to
make it work for both of us.

Alexey Bazhin baz@irc.msk.ru

@csete
Copy link
Collaborator

csete commented Jul 16, 2013

Ok, thanks for the info. we'll work on resolving this issue together with Volker @dl1ksv .
For now I have put your patch (modified to work with latest 3.7 code) here: https://gist.github.com/csete/6009541

@dl1ksv
Copy link
Contributor

dl1ksv commented Jul 16, 2013

Well, the message "5:1:1: cannot get freq at ep 0x81" is a kernel message from sound/usb/clock.c as some devices don't support reading the sample rate. It's no error and no problem.

At the moment I have no real idea how to solve the problem of bandwidth. I saw some discussion on this topic. Some people were of the opinion, that it's a driver error. But there was no fix proposed.
As I got a fix for the segfault in hid together with the use of libusb, I'll setup a branch with hid and libusb instead of hidraw.
I'll try to realeas this evening on github.

Volker

@csete
Copy link
Collaborator

csete commented Jul 16, 2013

On Tue, Jul 16, 2013 at 5:24 PM, Volker Schroer notifications@github.comwrote:

Well, the message "5:1:1: cannot get freq at ep 0x81" is a kernel message
from sound/usb/clock.c as some devices don't support reading the sample
rate. It's no error and no problem.

At the moment I have no real idea how to solve the problem of bandwidth. I
saw some discussion on this topic. Some people were of the opinion, that
it's a driver error. But there was no fix proposed.
As I got a fix for the segfault in hid together with the use of libusb,
I'll setup a branch with hid and libusb instead of hidraw.
I'll try to realeas this evening on github.

A fix for using libusb would be great! Let me know when you have something
to test :)
If you update your hiadpi files, could you please include the mac/hid.c
file as hid-mac.c or something like that in your tree? I will then later
send you a patch to make it also work on OS X.

Alex

@dl1ksv
Copy link
Contributor

dl1ksv commented Jul 16, 2013

I 've now setup a branch hid-usb on gr-fcdproplus. It contains a file hidmac.c, too.
The patch I got does not patch libusb but hidapi. It works for me together with libusb.
Using libusb the ohci_hid driver instead of the ehcI_driver is invoöved, so I hope the bandwidth problem is gone.

In my gnuradio fork on github you'll find a patched version hid-libusb.c

@csete
Copy link
Collaborator

csete commented Jul 16, 2013

Volker:
I tested your hid-usb branch on one of the computers where I was having problems and it seems to work fine! On the same computer I can crash qthid 4.1 confirming that your patch does indeed make a difference. So thumbs up from me! This was a good find
I will also test your patch for gr-fcd and give feedback.
Alex

@bazuchan
Copy link
Contributor Author

hid-usb branch have the same bandwidth problem for me :(

But confirming that this hid-libusb.c fixes segfaults (tested with
fcdcontrol-proplus).

On Tue, 16 Jul 2013 13:18:27 -0700
Volker Schroer notifications@github.com wrote:

I 've now setup a branch hid-usb on gr-fcdproplus. It contains a file
hidmac.c, too. The patch I got does not patch libusb but hidapi. It
works for me together with libusb. Using libusb the ohci_hid driver
instead of the ehcI_driver is invoöved, so I hope the bandwidth
problem is gone.

In my gnuradio fork on github you'll find a patched version
hid-libusb.c


Reply to this email directly or view it on GitHub:
#88 (comment)

Alexey Bazhin baz@irc.msk.ru

@csete
Copy link
Collaborator

csete commented Jul 17, 2013

Hmm, strange. I have tried it on two computers, both running Xubuntu 13.04 64 bit. I will try on a 32 bit PC later today. I suppose there are two issues in play, the original libusb issue which is solved by the patched hid-libusb.c and a another one with the bandwidth.

@csete
Copy link
Collaborator

csete commented Jul 17, 2013

I take it back. I too have the bandwidth problem but not always.
Volker, which kernel are you using?

@bazuchan
Copy link
Contributor Author

You most probably won't have the bandwidth problem if you have sucessfully used (with another software which also uses both audio and hid) fcdpro+ after plugging it and before using gr-fcdproplus.

Also Volker seems to have ohci_hcd hardware (which is usb1.1 only?) while I have ehci_hcd (which is usb2). So I think that this is the difference rather than kernel.

Alexandru Csete notifications@github.com wrote:

I take it back. I too have the bandwidth problem but not always.
Volker, which kernel are you using?


Reply to this email directly or view it on GitHub:
#88 (comment)

Sent from my Android phone with K-9 Mail. Please excuse my brevity.

@csete
Copy link
Collaborator

csete commented Jul 17, 2013

On Wed, Jul 17, 2013 at 8:31 PM, bazuchan notifications@github.com wrote:

You most probably won't have the bandwidth problem if you have sucessfully
used (with another software which also uses both audio and hid) fcdpro+
after plugging it and before using gr-fcdproplus.

Also Volker seems to have ohci_hcd hardware (which is usb1.1 only?) while
I have ehci_hcd (which is usb2). So I think that this is the difference
rather than kernel.

You are so right! I tried on a different computer with kernel 3.2: Fcdpp in
USB2 port has the bandwidth issue. I then moved it into an USB3 port and it
works fine.

Alex

@dl1ksv
Copy link
Contributor

dl1ksv commented Jul 17, 2013

No, I don't have usb1.1 hardware only. I saw that using the hidraw the ehci_hcd driver was involved while using hid driver with lib-usb the ohci_hcd driver seemed to be involved.
I'm using gentoo and build my own kernels from the vanilla sources.
I checked kernel 3.8.x 3.9.x and 3.10.0. 3.10.0 is the version I'm working with. I never got this problem.
I'm using libusbx-1.0.15, although I don't believe that the problem depends on the libusb version.

@dl1ksv
Copy link
Contributor

dl1ksv commented Jul 17, 2013

Alex,
can you have a look which kernel drivers are active for your usb components ( lspci -v ).
I tried with usb3 and without usb3 support. How behaves an usb3 port without usb3 driver ?

Volker

@csete
Copy link
Collaborator

csete commented Jul 17, 2013

According to lspci -v I have both ehci, ohci and xhci, but I have no idea how to make usb3 (xhci?) use usb2 driver.

00:10.0 USB controller: Advanced Micro Devices [AMD] Hudson USB XHCI Controller (rev 03) (prog-if 30 [XHCI])
Subsystem: Micro-Star International Co., Ltd. Device 7800
Flags: bus master, fast devsel, latency 0, IRQ 18
Memory at fef4a000 (64-bit, non-prefetchable) [size=8K]
Capabilities:
Kernel driver in use: xhci_hcd

00:10.1 USB controller: Advanced Micro Devices [AMD] Hudson USB XHCI Controller (rev 03) (prog-if 30 [XHCI])
Subsystem: Micro-Star International Co., Ltd. Device 7800
Flags: bus master, fast devsel, latency 0, IRQ 17
Memory at fef48000 (64-bit, non-prefetchable) [size=8K]
Capabilities:
Kernel driver in use: xhci_hcd

00:12.0 USB controller: Advanced Micro Devices [AMD] Hudson USB OHCI Controller (rev 11) (prog-if 10 [OHCI])
Subsystem: Micro-Star International Co., Ltd. Device 7800
Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 18
Memory at fef50000 (32-bit, non-prefetchable) [size=4K]
Kernel driver in use: ohci_hcd

00:12.2 USB controller: Advanced Micro Devices [AMD] Hudson USB EHCI Controller (rev 11) (prog-if 20 [EHCI])
Subsystem: Micro-Star International Co., Ltd. Device 7800
Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 17
Memory at fef4f000 (32-bit, non-prefetchable) [size=256]
Capabilities:
Kernel driver in use: ehci_hcd

00:13.0 USB controller: Advanced Micro Devices [AMD] Hudson USB OHCI Controller (rev 11) (prog-if 10 [OHCI])
Subsystem: Micro-Star International Co., Ltd. Device 7800
Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 18
Memory at fef4e000 (32-bit, non-prefetchable) [size=4K]
Kernel driver in use: ohci_hcd

00:13.2 USB controller: Advanced Micro Devices [AMD] Hudson USB EHCI Controller (rev 11) (prog-if 20 [EHCI])
Subsystem: Micro-Star International Co., Ltd. Device 7800
Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 17
Memory at fef4d000 (32-bit, non-prefetchable) [size=256]
Capabilities:
Kernel driver in use: ehci_hcd

00:14.5 USB controller: Advanced Micro Devices [AMD] Hudson USB OHCI Controller (rev 11) (prog-if 10 [OHCI])
Subsystem: Micro-Star International Co., Ltd. Device 7800
Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 18
Memory at fef4c000 (32-bit, non-prefetchable) [size=4K]
Kernel driver in use: ohci_hcd

@csete
Copy link
Collaborator

csete commented Jul 17, 2013

Fortunately, I have many USB ports on the PC and it seems one of them loads the ohci_hcd driver that works too.

dmesg output:
[628097.204175] usb 8-1: new full-speed USB device number 2 using xhci_hcd
[628097.328759] 2:1:1: cannot get freq at ep 0x81
[628097.342064] generic-usb 0003:04D8:FB31.0019: hiddev0,hidraw3: USB HID v1.11 Device [Hanlincrest Ltd. FUNcube Dongle V2.0 ] on usb-0000:00:10.1-1/input2
[628097.425809] 2:1:1: cannot get freq at ep 0x81
[628097.476808] 2:1:1: cannot get freq at ep 0x81
[628131.093671] 2:1:1: cannot get freq at ep 0x81
[628165.737857] usb 8-1: USB disconnect, device number 2
[628168.348039] usb 3-3: new full-speed USB device number 3 using ohci_hcd
[628168.558644] 3:1:1: cannot get freq at ep 0x81
[628168.567875] generic-usb 0003:04D8:FB31.001A: hiddev0,hidraw3: USB HID v1.11 Device [Hanlincrest Ltd. FUNcube Dongle V2.0 ] on usb-0000:00:12.0-3/input2
[628168.670651] 3:1:1: cannot get freq at ep 0x81
[628168.716653] 3:1:1: cannot get freq at ep 0x81
[628183.019159] 3:1:1: cannot get freq at ep 0x81
[628194.813946] usb 3-3: USB disconnect, device number 3
[628207.924491] usb 1-5.1: new full-speed USB device number 17 using ehci_hcd
[628208.054837] 17:1:1: cannot get freq at ep 0x81
[628208.057699] generic-usb 0003:04D8:FB31.001B: hiddev0,hidraw3: USB HID v1.11 Device [Hanlincrest Ltd. FUNcube Dongle V2.0 ] on usb-0000:00:12.2-5.1/input2
[628208.159318] 17:1:1: cannot get freq at ep 0x81
[628208.202810] 17:1:1: cannot get freq at ep 0x81
[628236.572245] cannot submit datapipe for urb 0, error -28: not enough bandwidth
... and so it continues ...

So, xhci_hcd and ohci_hcd are good, ehci_hcd is bad because, as Alexey noted before, it reserves too much bandwidth for hid device.

@dl1ksv
Copy link
Contributor

dl1ksv commented Jul 18, 2013

Thanks Alex,
the situation gets more and more complicated.
I now testet against my different usb ports:
ohci_hcd and ehci_hcd work, but xhci_hcd does not.
Guess the error:
[ 305.346184] hid-generic 0003:04D8:FB31.0004: hiddev0,hidraw3: USB HID v1.11 Device [Hanlincrest Ltd. FUNcube Dongle V2.0 ] on usb-0000:02:00.0-1/input2
[ 305.369218] snd-usb-audio 8-1:1.0: usb_probe_interface
[ 305.369224] snd-usb-audio 8-1:1.0: usb_probe_interface - got id
[ 305.384960] xhci_hcd 0000:02:00.0: ERROR: unexpected command completion code 0x11.
[ 305.384968] usb 8-1: Not enough bandwidth for altsetting 1
[ 305.421964] ALSA sound/usb/clock.c:309 2:1:1: cannot get freq at ep 0x81
[ 305.424395] usbcore: registered new interface driver snd-usb-audio
[ 380.430079] usbhid 8-1:1.2: disconnect by usbfs
[ 380.430146] usbhid 8-1:1.2: removing 97 minor
[ 380.455385] xhci_hcd 0000:02:00.0: ERROR: unexpected command completion code 0x11.
[ 380.455404] usb 8-1: Not enough bandwidth for altsetting 1
[ 380.455414] ALSA sound/usb/pcm.c:345 2:1:1: usb_set_interface failed (-22)
[ 380.571222] xhci_hcd 0000:02:00.0: shutdown urb ffff8801c6f4e6c0 ep2in-intr
But now I have the chance to test and perhaps I find out a solution that works for all.

Volker

@csete
Copy link
Collaborator

csete commented Jul 21, 2013

In the meanwhile, do you intend to make the hid-usb branch the default?

@dl1ksv
Copy link
Contributor

dl1ksv commented Jul 22, 2013

I just merged hid-usb into master. The bandwidth problem is independent from hidraw or hid-libusb. It seems to be a kernel driver problem, so I filed a bug.

@bazuchan
Copy link
Contributor Author

bazuchan commented Sep 2, 2013

Interesting, looks like guys on windows having same problems
http://uk.groups.yahoo.com/group/Fcdproplus/message/2148

@NewtMan
Copy link

NewtMan commented Oct 20, 2013

Recently purchased a Pro+ and am experiencing the "bandwidth" problem described here. When attached, dmesg reports:

[92087.515857] usb 2-1.5: new full-speed USB device number 17 using ehci_hcd
[92087.610475] usb 2-1.5: New USB device found, idVendor=04d8, idProduct=fb31
[92087.610662] usb 2-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[92087.610665] usb 2-1.5: Product: FUNcube Dongle V2.0
[92087.610668] usb 2-1.5: Manufacturer: Hanlincrest Ltd.
[92087.645723] 17:1:1: cannot get freq at ep 0x81
[92087.648522] generic-usb 0003:04D8:FB31.000B: hiddev0,hidraw4: USB HID v1.11 Device [Hanlincrest Ltd. FUNcube Dongle V2.0 ] on usb-0000:00:1d.0-1.5/input2
[92087.738136] 17:1:1: cannot get freq at ep 0x81
[92087.776719] 17:1:1: cannot get freq at ep 0x81
[92087.813470] 17:1:1: cannot get freq at ep 0x81
[92087.814293] cannot submit datapipe for urb 0, error -28: not enough bandwidth

I'm assuming it's because the ehci driver is being used. I'm running gnuradio 3.7 and fcdproplus "master" branch, and the latest branch of gqrx. Other than trying to find a USB1.1 hub somewhere, is there any patch/fix? BTW, I'm running Debian "wheezy" and vmlinuz-3.2.0-4-amd64.

@csete
Copy link
Collaborator

csete commented Oct 20, 2013

Yes, there is a fix. No, we do not have it (if we had it we would make it available ;-)
Status of this issue is tracked in bug #91

@bazuchan
Copy link
Contributor Author

Actually you can workaround this by opening the hid device each time. Here is my workaround bazuchan/gr-fcdproplus@3a887f2

@csete
Copy link
Collaborator

csete commented Oct 21, 2013

Hmmm, I thought that worked around another problem but indeed, it appears to work for this issue as well. I will update my PPA to include the patch.

@dl1ksv
Copy link
Contributor

dl1ksv commented Oct 21, 2013

It's a bit more weird. I think it is highly dependend on the hardware. I have an usb3 controller on my system (Etron Technology, Inc. EJ168 USB 3.0 Host Controller ) and here neither the fcd nor the fcdp+ work with gqrx.
In the system log I see
[ 1339.252890] usbhid 8-2:1.2: looking for a minor, starting at 96
[ 1339.253099] hid-generic 0003:04D8:FB56.0004: hiddev0,hidraw3: USB HID v1.11 Device [Hanlincrest Ltd. FUNcube Dongle V1.0 ] on usb-0000:02:00.0-2/input2
[ 1339.291688] snd-usb-audio 8-2:1.0: usb_probe_interface
[ 1339.291709] snd-usb-audio 8-2:1.0: usb_probe_interface - got id
[ 1339.308068] xhci_hcd 0000:02:00.0: ERROR: unexpected command completion code 0x11.
[ 1339.308087] usb 8-2: Not enough bandwidth for altsetting 1
[ 1339.310353] usbcore: registered new interface driver snd-usb-audio
[ 1445.801961] usbhid 8-2:1.2: disconnect by usbfs
[ 1445.801998] usbhid 8-2:1.2: removing 97 minor
[ 1449.562195] xhci_hcd 0000:02:00.0: ERROR: unexpected command completion code 0x11.
[ 1449.562202] usb 8-2: Not enough bandwidth for altsetting 1
[ 1449.562205] ALSA sound/usb/pcm.c:372 2:1:1: usb_set_interface failed (-22)
[ 1847.121880] hub 8-0:1.0: state 7 ports 2 chg 0000 evt 0004
[ 1847.121899] hub 8-0:1.0: port 2, status 0100, change 0001, 12 Mb/s

and gqrx reports

audio_alsa_source[hw:3]: using S16_LE
audio_alsa_sink[default]: sample resolution = 32 bits
audio_alsa_source[hw:3]: snd_pcm_hw_params failed: Eingabe-/Ausgabefehler
Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt. You must
reimplement QApplication::notify() and catch all exceptions there.

terminate called after throwing an instance of 'std::runtime_error'
what(): check topology failed on audio_alsa_source(42) using ninputs=0, noutputs=2

But if I connect the fcd or fcdp+ to an usb 2 port both work.
But my system uses the ohci-pci driver and the hardware is USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller.

I reported a bug to kernel.org and to the usb mailing list but nobody cared. Perhaps someone could report a bug for the ehci driver.

Apart from that I'll wait for a 3.12 kernel and see what happens.

@MadBoat
Copy link

MadBoat commented Feb 4, 2014

I am seeing the bandwidth problem as well, on an ARM port (the specific hardware is a Zynq), with v3.6.5 gnuradio and 3.6 gr-fcdproplus. I attempted bazuchan's open/close workaround, to no effect.

The thread is a little confusing to a newbie to FCD and git alike, so I apologize for having to ask...
Is there anything else I should try? (aside from upgrading to 3.7; I'll try that if no other options present themselves.)

@csete
Copy link
Collaborator

csete commented Feb 4, 2014

I don't think it will make any difference whether you are running gnuradio 3.6 or 3.7 except that gqrx only works with 3.7 (this issue tracker is for gqrx ;-)

@AshleighAdams
Copy link
Contributor

@MadBoat Just curious if you could try this, as I have to do it to get my FCDPro+ to work:

IO devices
Select Other...
Set device string to fcd=0,type=2
Click OK

The device should work now, but things are broken...

Start the DSP
IO devices
Select FUNcube Dongle V2.0

@MadBoat
Copy link

MadBoat commented Feb 5, 2014

@Kateadams I'm guessing those are instructions specific to gqrx? I don't think there is a parallel operation for gr-fcdproplus.

@AshleighAdams
Copy link
Contributor

@MadBoat Actually, no; to get GNU Radio to work with my Pro+, I need to do that first, I've no idea why.

@MadBoat
Copy link

MadBoat commented Feb 6, 2014

@Kateadams I am chasing another lead, but if it doesn't pan out I will try your suggestion. Was my guess correct? Those instructions will make sense if I use gqrx?

@AshleighAdams
Copy link
Contributor

@MadBoat

Those instructions will make sense if I use gqrx?

Not sure I understand the question, but, they're UI elements you need to select/click.

@MadBoat
Copy link

MadBoat commented Feb 24, 2014

Ok. I finally cracked it. What was happening was, csete's gr-fcdproplus gnuradio block was queueing a second periodic transfer (for real time radio control?). Both transfers wanted to happen in every single frame, with no gaps. The ehci driver refused to schedule both, even though it had the bandwidth... I still don't really understand why. The comments I read suggest its to prevent delaying a transfer that is already queued.... or perhaps the USB stack, when it is dealing with a 1.1 device, just can't schedule an operation to begin at a time other than the beginning of a frame...

In any case, to fix it, I just removed the gr-fcdproplus block and put in the generic audio block, and I'll use fcdcontrol, or something equivalent, for configuration. Still futzing with it to get the quality right... I think my flowchart as it stands is throwing away either the I or Q portions of the data as it comes out of the generic audio block.

@csete
Copy link
Collaborator

csete commented Feb 24, 2014

gr-fcdproplus is not my block, though it reuses some code written by me in the past. As far as I know it doesn't do any periodic scheduling; it merely sets and reads settings as requested by the GUI. You may see several requests during startup since the application has to set the frequency and gains and these requests are probably queued as asynchronous messages ad the hidapi/libusb layer.

Since gr-fcdproplus and fcdctl uses practically the same code, I wouldn't expect to see any difference between the two.

The "not enough bandwidth" message comes in the syslog when you plug in the dongle before you load any application and, as I recall, the audio interface is not usable either. Perhaps your issue is a different one?

@MadBoat
Copy link

MadBoat commented Feb 24, 2014

@csete

"gr-fcdproplus is not my block, though it reuses some code written by me in the past."

Oh, sorry, I guess I conflated your name and this project.

"As far as I know it doesn't do any periodic scheduling; it merely sets and reads settings as requested by the GUI. You may see several requests during startup since the application has to set the frequency and gains and these requests are probably queued as asynchronous messages ad the hidapi/libusb layer."

All I can tell you that, according to my hacked driver, the scheduler ehci-hcd uses reports that there is no bandwidth used when the initial device open occurs, and when I come down to set the first of the radio properties (lna gain, I think), there is a periodic transfer scheduled. Either I'm writing/interpreting my hacks wrong (which is very possible; that driver is the biggest rat's nest I've ever had to wrap my head around), or gr-fcdproplus does indeed caused periodic traffic to be scheduled.

I should mention also that it is inheriting some functionality from gnuradio (specifically, the start() and stop() functions). Does the possibility for this error exist in those gnuradio functions?

"Since gr-fcdproplus and fcdctl uses practically the same code, I wouldn't expect to see any difference between the two."

I cannot do a definitive test until I fix the quality problem I mentioned, but I can say that on my PC, with the dongle in a 2.0 slot, fcdctl does not cause this problem when I change the frequency. Might be that its doing nothing at all for some reason, but I don't think that's likely.

"The "not enough bandwidth" message comes in the syslog when you plug in the dongle before you load any application and, as I recall, the audio interface is not usable either. Perhaps your issue is a different one?"

If I do not load an application layer program, I do not see a "not enough bandwidth" error at all.

@csete
Copy link
Collaborator

csete commented Feb 24, 2014

Interesting, thanks for the info.

Btw. I use a setup for receiving telemetry from the Funcube satellite (http://flic.kr/p/jeJZYf) where I control using fcdctl and record raw IQ samples from the FCD Pro using sox:

sox -r 96k -e signed-integer -b 16 --endian little -c 2 -t alsa hw:2 somefile.raw

The file will then contain interleaved IQIQIQ... samples. The same command works with the Pro+ using "-r 192k".

@MadBoat
Copy link

MadBoat commented Feb 24, 2014

Ooo! Might be thats useful. Thanks.

@bazuchan
Copy link
Contributor Author

For me the "bandwidth" problem starts only when hid device is open and
then trying to open audio device without closing hid device (and
gr-fcdproplus does it this way).

Btw, can somebody who has the "bandwidth" problem try following:

  1. start recording from audio device with sox or arecord
  2. issue any command with fcdctl (without stopping recording)
  3. stop recording and then try to use gr-fcdproplus
    Afair this sequence was helping me too.

Alexey Bazhin baz@irc.msk.ru

@csete
Copy link
Collaborator

csete commented Feb 25, 2014

@bazuchan
I tried your steps (except 3 as I don't have gnuradio on this PC) and it works. But I have to say that I no longer see the bandwidth error on this PC, even though I used to see it. In fact, I can no longer find a PC in my range where I have this problem!?

All these PCs have been upgraded to Xubuntu 13.10 and perhaps the drivers got fixed for the controllers that I have.

@csete
Copy link
Collaborator

csete commented Feb 26, 2014

I tried it on a computer that reports not enough bandwidth when the FCDPP is plugged in and I can not capture audio using sox.

@dl1ksv
Copy link
Contributor

dl1ksv commented Feb 26, 2014

Do you see this problem with an FCD, too ?
On my usb3 controller not working with fcdpp fcp does not work, too, and I reported a bug to kernel.org
https://bugzilla.kernel.org/show_bug.cgi?id=70531

@csete
Copy link
Collaborator

csete commented Feb 26, 2014

I have never seen this issue with plain Pro models; only with the Pro+.

@dl1ksv
Copy link
Contributor

dl1ksv commented Feb 26, 2014

Am 26.02.2014 17:39, schrieb Alexandru Csete:

I have never seen this issue with a plain Pro models; only with the Pro+.


Reply to this email directly or view it on GitHub
#88 (comment).

But depending on your hardware it really happens with both devices. You
can controll the devies with qthid, but the alsa part fails.

@djacobow
Copy link

djacobow commented May 8, 2014

First, I am so glad I finally found this thread, because I spent an entire day pulling my hair out on this and have gotten nowhere.

I've got a brand-new FCDPP and I'm running Ubuntu 14.04, install gnuradio, gqrx from apt, also tried gqrx from source, and have built qthid and fcdctl from source from git. In reality, I was not even planning to try ANY of that software, intending instead to do very minimalist driver myself for a project that will eventually have to run on a very lightweight system.

Basically, I have found that that sometimes on some USB ports I can open the audio and read samples out of the FCDPP. grc (using gr-fcdproplus) worked once or twice, but mostly does not work. I never saw gqrx work. I can open up the audio in ALSA and that also worked a few times, but it's not reliably. Unplugging and re-plugging the device helps and oddly, leaving it unplugged longer seems to make a difference. Starting up qthid or running fctctl even once makes the audio stop working, and nothing will make it work again, short of a unplug/replug, and even that not usually.

My dmesg is filled with:

[31403.428013] 10:1:1: cannot get freq at ep 0x81
[31403.428038] cannot submit urb 0, error -28: not enough bandwidth

Anyway, i'm really stuck! I thought this was going to be easy! Open up an audio interface and a hid interface and send a poke through the latter every time I wanted to change freqs!

Is there any progress on this issue? Is there a known workaround? Did I hear that if I just plug in through a physical USB hub it might work?

Regards,
Dave J

@MadBoat
Copy link

MadBoat commented May 8, 2014

@djacobow

Its been a while since I looked at this problem, but IIRC, the standard work around was to use a 3.0 slot rather than a 2.0 slot; doing so will load the xhci driver rather than the ehci driver, which doesn't have this problem. What is your success rate like if you restrict yourself to 3.0 slots?

@djacobow
Copy link

djacobow commented May 8, 2014

Thanks, MadBoat. This PC is a bit older (was top end in its time Core2-i7, 16GiB RAM, etc) but AFAIK doesn't have any 3.0 ports. Those are the blue ones right?

@MadBoat
Copy link

MadBoat commented May 8, 2014

yessir.

@djacobow
Copy link

djacobow commented May 8, 2014

Now I'll go scrounging for an old USB hub that only does 1.1 (or maybe an add-in USB3 card).... this receiver is getting expensive. I hope it's really better than the RTL2832 devices. :-)

@csete
Copy link
Collaborator

csete commented May 8, 2014

Try all USB ports on your computer. I have a computer where it works on the ports in the front, but not the ones in the back, even though they are all USB 2 ports. Test it using sox or similar.

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

Successfully merging this pull request may close these issues.

None yet

7 participants