Page 1 of 1

Pi 3 bluetooth not working when usb webcam is accessed

Posted: Mon May 29, 2017 3:15 pm
by ddmitry1973
Hi everyone, got mysterious problem.
Can anyone help?

In brief: onboard BT adapter works very poor when external USB webcam is being used to capture video.

In details: when I try to capture video from webcam, connected via usb to my Pi 3, bluetooth transmission hangs due errors in kernel. When I stop capture, everything is fine again.

syslog output:

Code: Select all

May 29 10:33:24 raspberrypi kernel: [  180.866013] Bluetooth: hci0 SCO packet for unknown connection handle 2
May 29 10:33:24 raspberrypi kernel: [  180.866080] Bluetooth: hci0: Frame reassembly failed (-84)
May 29 10:33:24 raspberrypi kernel: [  180.866142] Bluetooth: hci0: Frame reassembly failed (-84)
May 29 10:33:31 raspberrypi kernel: [  187.890840] Bluetooth: hci0: Frame reassembly failed (-84)
May 29 10:33:33 raspberrypi kernel: [  189.890289] Bluetooth: hci0 command 0x0411 tx timeout
May 29 10:33:33 raspberrypi kernel: [  190.132443] Bluetooth: hci0: Frame reassembly failed (-84)
May 29 10:33:33 raspberrypi kernel: [  190.338437] Bluetooth: hci0: Frame reassembly failed (-84)
May 29 10:33:38 raspberrypi bluetoothd[613]: HUP or ERR on socket: Connection timed out (110)
This "Frame reassembly failed (-84)" message could be repeated literally hundreds of times as long as capture goes on.

environment details:
- raspbian image 2017-01-11-raspbian-jessie-lite
- 'uname -a' => Linux raspberrypi 4.4.34-v7+ #930 SMP Wed Nov 23 15:20:41 GMT 2016 armv7l GNU/Linux
- bluez 5.23-2+rpi2
- I'm using Pi in console mode, no gui installed. Error happens with either ffmpeg or gstreamer being used to capture - I tried both.
- Stream captured: 640x480x10fps

I suppose this bug is not related to capture software. I'm not so familiar with gstreamer, but when I launch ffmpeg to encode some test video in parallel with BT transmission , all works fine. So, It's somehow connected to camera access.
First thought was may be camera is taking all usb bandwidth, so almost nothing left for bluetooth, but I can do capture from TWO cameras in parallel with no errors in output videos. Very strange...

regarding possible proposals:
- yes, I tried to upgrade system 'sudo apt-get upgrade' - it changes nothing
- and, yes, I tried different webcam (three, actually)
- more, I tried another Pi 3 box with same results
- and tried on 'fresh' system
- and with different capture settings

Ready to provide further details if needed.

Please, advice
Thanks in advance
BR, D.

Re: Pi 3 bluetooth not working when usb webcam is accessed

Posted: Mon May 29, 2017 3:20 pm
by B.Goode
Possibly power starvation when the external camera is active?

What arrangements do you have for powering your RPi and its attached devices?

Re: Pi 3 bluetooth not working when usb webcam is accessed

Posted: Mon May 29, 2017 3:23 pm
by ddmitry1973
Hi, I'm using Official Raspberry Pi 3 Universal Power Supply,
camera receives supply through usb port

Re: Pi 3 bluetooth not working when usb webcam is accessed

Posted: Mon May 29, 2017 3:30 pm
by B.Goode
Hopefully not power then.

Some sort of radiated interference from the usb cable to the camera? Does re-routing the camera cable make any difference?

You have tried more than one camera: have you also tried more than one usb cable?

Re: Pi 3 bluetooth not working when usb webcam is accessed

Posted: Mon May 29, 2017 3:39 pm
by ddmitry1973
Some sort of radiated interference from the usb cable to the camera? Does re-routing the camera cable make any difference?

You have tried more than one camera: have you also tried more than one usb cable?
Three cams - three cables, as each camera has own cable which is not changeable.
I don't think it anyhow related to camera/cable position vs pi.

Re: Pi 3 bluetooth not working when usb webcam is accessed

Posted: Mon May 29, 2017 3:41 pm
by B.Goode
I have no further suggestions. Good luck with getting this resolved.

Re: Pi 3 bluetooth not working when usb webcam is accessed

Posted: Mon May 29, 2017 5:06 pm
by Douglas6
Are you capturing the video locally, or are you perhaps streaming it over WiFi?

Re: Pi 3 bluetooth not working when usb webcam is accessed

Posted: Mon May 29, 2017 5:23 pm
by ddmitry1973
It's local capture

Re: Pi 3 bluetooth not working when usb webcam is accessed

Posted: Wed May 31, 2017 1:27 pm
by ddmitry1973
Sorry for 'up'ing' may be anyone can advice, at least direction, to dig in?

Re: Pi 3 bluetooth not working when usb webcam is accessed

Posted: Fri Jul 07, 2017 3:00 pm
by fury
Probably a hardware design problem. Either that, or nobody has figured out how to fix the driver for the UART that it's using so that it doesn't have so many errors. I have to use a USB Bluetooth dongle to get acceptable Bluetooth performance. In my case it's audio streaming that doesn't work. I've tried on Raspbian and on Automotive Grade Linux. There are a few threads every now and then about this, here's a couple.

viewtopic.php?f=28&t=151633

viewtopic.php?f=35&t=172362

If you stumble upon a solution for the built-in Bluetooth, please follow up, cause I'd like to conserve my Bluetooth dongles for boards that don't have it built in. :)

Re: Pi 3 bluetooth not working when usb webcam is accessed

Posted: Sat Feb 03, 2018 4:15 pm
by ddmitry1973
Update: with external usb BT adapter all is fine. Conclusion: something wrong with h/w or drivers of internal one. Consider topic is closed.