linux icon indicating copy to clipboard operation
linux copied to clipboard

Bluetooth and Dual Shock 3 Playstation Remote will crash System.

Open coniferous1 opened this issue 10 years ago • 122 comments

Hello All,

Looking to report a bug with the bluetooth on raspberry pi three with dual shock 3 playstation controllers.

When connected to one controller intermittently I get these errors (around once an hour, but it's pretty random). It seems like a driver issue, But I'll experiment with anything that will help me fix the issue.

Mar 21 21:45:58 retropie kernel: [ 2372.052392] Bluetooth: hci0: Frame reassembly failed (-84) Mar 21 21:45:58 retropie kernel: [ 2372.052572] Unable to handle kernel paging request at virtual address ffffffc8 Mar 21 21:45:58 retropie kernel: [ 2372.060430] pgd = 80004000 Mar 21 21:45:58 retropie kernel: [ 2372.063467] [ffffffc8] *pgd=2effa821, *pte=00000000, *ppte=00000000

Message from syslogd@retropie at Mar 21 21:45:58 ... kernel:[ 2372.070115] Internal error: Oops: 17 [#1] SMP ARM

uname -r reports:

4.1.19-v7+

Not a linux Guru, if this is the wrong place or you need more information please let me know.

coniferous1 avatar Mar 21 '16 22:03 coniferous1

If you can post the whole of the crash dump - down to the "---[ end trace ..." if possible - then it might just help to debug this.

pelwell avatar Mar 22 '16 15:03 pelwell

Hey @pelwell ,

Working on getting this now. First time I've created a crash dump so I might be a bit, working on acquiring the prerequisite knowledge.

coniferous1 avatar Mar 23 '16 16:03 coniferous1

I was thinking that you could just include more of the output in /var/log/syslog. I've never tried to get a crash dump for a kernel crash, and I'm not sure it would work.

pelwell avatar Mar 23 '16 17:03 pelwell

That's sort of my thinking as well. It seems that IO simply stops when this occurs. Not sure if I can pipe it out the serial when this happens or not, but I'm looking into that.

In the meantime I'll get more information from /var/log/syslog and post it here as soon as I get home.

coniferous1 avatar Mar 23 '16 17:03 coniferous1

Alternatively, if you can provoke it with the text console visible (Ctrl-Alt-F1, Ctrl-Alt-F7 to get back to the desktop) then adding framebuffer_height=2160 to config.txt may allow you get the whole backtrace onto the screen where you can photograph it.

pelwell avatar Mar 23 '16 17:03 pelwell

Generally it happens with emulators open and me actively using the game pad, but I'm going to try that and mash on the buttons furiously while copying some files in the background and see what happens.

coniferous1 avatar Mar 23 '16 17:03 coniferous1

I'm having trouble reproducing this error and being able to capture the trace. I can only seem to get it to happen when emulation station is actively doing something, witch stops me from looking at the text console.

coniferous1 avatar Mar 24 '16 18:03 coniferous1

Having the same issue here, also unable to get any trace other than the one previously mentioned.

The system only seems to freeze when displaying something heavier than a TTY on screen, I've had these freezes occur while watching video on kodi, playing some games with emulationstation or working with something on a xfce session but never when looking at a TTY, even if something heavy is running in the background.

I did once get only a partial bluetooth fail while attempting to trigger the freeze:

Mar 30 01:53:08 PIPPLWARE dbus[429]: [system] Activating via systemd: service name='org.bluez' unit='dbus-org.bluez.service'
Mar 30 01:53:08 PIPPLWARE systemd[4992]: Failed at step EXEC spawning /usr/lib/bluetooth/bluetoothd: Permission denied
Mar 30 01:53:08 PIPPLWARE systemd[1]: bluetooth.service: main process exited, code=exited, status=203/EXEC
Mar 30 01:53:08 PIPPLWARE systemd[1]: Failed to start Bluetooth service.
Mar 30 01:53:08 PIPPLWARE systemd[1]: Unit bluetooth.service entered failed state.
Mar 30 01:53:33 PIPPLWARE dbus[429]: [system] Failed to activate service 'org.bluez': timed out

Another thing of note is that the bluetooth service often fails to start once before actually starting during system startup.

gaskerino avatar Mar 30 '16 02:03 gaskerino

I'm pretty sure i have the exact same problem, but mine is triggered from a nodejs-program, therefore i'm in the console when it happens, and thus i have logs. I hope they help:

[ 1299.902456] Bluetooth: hci0 unexpected SMP command 0x02 from c8:0f:10:28:ab:51
[ 1300.037106] Bluetooth: hci0 unexpected SMP command 0x03 from c8:0f:10:28:ab:51
[ 1300.292100] Bluetooth: hci0 unexpected SMP command 0x04 from c8:0f:10:28:ab:51
[ 1300.697121] Bluetooth: hci0 unexpected SMP command 0x06 from c8:0f:10:28:ab:51
[ 1300.925752] Bluetooth: hci0: Frame reassembly faild (-84)
[ 1300.931428] Bluetooth: hci0 unexpected SMP command 0x07 from c8:0f:10:28:ab:51
[ 1301.111148] Unable to handle kernel paging request at virtual address ffffffc8
[ 1301.118563] pgd = 80004000
[ 1301.121372] [ffffffc8] *pgd=3dffa821, *pte=00000000, *ppte=00000000
[ 1301.127833] Internal error: Oops: 17 [#1] SMP ARM

Entering kdb (current=0xbbcb6d40, pid 367) on processor 0 Oops: (null)
due to oops @ 0x07f3c8c20
CPU: 0 PID: 367 Comm: kworker/0:3 Not tainted 4.1.20-v7+ #867
Hardware name: BCM2709
Workqueue: events flush_to_ldisc
task: bbcb6d40 ti: b9db4000 task.ti: b9db4000
PC is at h4_recv_buf+0x34/0x22c [hci_uart]
LR is at h4_recv+0x50/0x98 [hci_uart]
pc : [<7f3c8c20>]    lr : [<7f3c8e68>]    psr: a0000013
sp : b9db5e38  ip : b9db5e68  fp : b9db5e64
r10: 00000008  r9 : 00000008  r8 : bb22d000
r7 : 7f3ca194  r6 : bb067c6c  r5 : 00000003  r4 : ffffffac
r3 : 00000008  r2 : bb067c6c  r1 : ffffffac  r0 : bb22d000
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c5383d  Table: 3bf4406a  DAC: 00000015
CPU: 0 PID: 367 Comm: kworker/0:3 Not tainted 4.1.20-v7+ #867
Hardware name: BCM2709
Workqueue: events flush_to_ldisc
[<800185e0>] (unwind_backtrace) from [<80013f48>] (show_stack+0x20/0x24)
[<80013f48>] (show_stack) from [<80572ddc>] (dump_stack+0xd4/0x118)
[<80572ddc>] (dump_stack) from [<80010d18>] (show_regs+0x1c/0x20)
[<80010d18>] (show_regs) from [<800b4a70>] (kdb_main_loop+0x3ec/0x800)

There it just stops. but i have a longer log from a previous crash that seems to have the same cause:

[  156.026986] Bluetooth: hci0: Frame reassembly faild (-84)
[  156.060272] Bluetooth: hci0 unexpected SMP command 0x07 from c8:0f:10:28:af:c1
Entering kdb (current=0xbc77cac0, pid 96) on processor 0 Oops: (null)
due to oops @ 0x07f3c8c20
CPU: 0 PID: 96 Comm: kworker/0:2 Not tainted 4.1.20-v7+ #867
Hardware name: BCM2709
Workqueue: events flush_to_ldisc
task: bc77cac0 ti: bbf7c000 task.ti: bbf7c000
PC is at h4_recv_buf+0x34/0x22c [hci_uart]
LR is at h4_recv+0x50/0x98 [hci_uart]
pc : [<7f3c2c20>]    lr : [<7f3c2e68>]    psr: a0000013
sp : bbf7de38  ip : bbf7de68  fp : bbf7de64
r10: 0000000a  r9 : 0000000a  r8 : b9de0000
r7 : 7f3c4191  r6 : bb1eb8db  r5 : 00000003  r4 : ffffffac
r3 : 0000000a  r2 : bb1eb8db  r1 : ffffffac  r0 : b9de0000
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c5383d  Table: 39c3806a  DAC: 00000015
CPU: 0 PID: 96 Comm: kworker/0:2 Not tainted 4.1.20-v7+ #867
Hardware name: BCM2709
Workqueue: events flush_to_ldisc
[<800185e0>] (unwind_backtrace) from [<80013f48>] (show_stack+0x20/0x24)
[<80013f48>] (show_stack) from [<80572ddc>] (dump_stack+0xd4/0x118)
[<80572ddc>] (dump_stack) from [<80010d18>] (show_regs+0x1c/0x20)
[<80010d18>] (show_regs) from [<800b4a70>] (kdb_main_loop+0x3ec/0x800)
more> [<800b4a70>] (kdb_main_loop) from [<800b796c>] (kdb_stub+0x2c4/0x510)
[<800b796c>] (kdb_stub) from [<800ad360>] (kgdb_cpu_enter+0x480/0x838)
[<800ad360>] (kgdb_cpu_enter) from [<800ad974>] (kgdb_handle_exception+0x104/0x218)
[<800ad974>] (kgdb_handle_exception) from [<80017aec>] (kgdb_notify+0x40/0x90)
[<80017aec>] (kgdb_notify) from [<80044cd4>] (notifier_call_chain+0x54/0x94)
[<80044cd4>] (notifier_call_chain) from [<80044eec>] (notify_die+0x48/0x54)
[<80044eec>] (notify_die) from [<80014064>] (die+0x118/0x43c)
[<80014064>] (die) from [<80571c48>] (__do_kernel_fault.part.0+0x74/0x8
[<80571c48>] (__do_kernel_fault.part.0) from [<80578bd4>] (do_page_fault+0x28c/0x398)
[<80578bd4>] (do_page_fault) from [<800091e8>] (do_DataAbort+0x48/0xc4)
[<800091e8>] (do_DataAbort) from [<8057811c>] (__dabt_svc+0x3c/0x60)
Exception stack(0xbbf7ddf0 to 0xbbf7de38)
dde0:                                     b9de0000 ffffffac bb1eb8db 0000000a
de00: ffffffac 00000003 bb1eb8db 7f3c4194 b9de0000 0000000a 0000000a bbf7de64
de20: bbf7de68 bbf7de38 7f3c2e68 7f3c2c20 a0000013 ffffffff
[<8057811c>] (__dabt_svc) from [<7f3c2c20>] (h4_recv_buf+0x34/0x22c [hci_uart])
[<7f3c2c20>] (h4_recv_buf [hci_uart]) from [<7f3c2e68>] (h4_recv+0x50/0x98 [hci_uart])
[<7f3c2e68>] (h4_recv [hci_uart]) from [<7f3c20f0>] (hci_uart_tty_receive+0x74/0xb0 [hci_uart])
[<7f3c20f0>] (hci_uart_tty_receive [hci_uart]) from [<80358b48>] (flush_to_ldisc+0x190/0x1a0)
more> [<80358b48>] (flush_to_ldisc) from [<8003e0b8>] (process_one_work+0x154/0x458)
[<8003e0b8>] (process_one_work) from [<8003e410>] (worker_thread+0x54/0x500)
[<8003e410>] (worker_thread) from [<80043bec>] (kthread+0xec/0x104)
[<80043bec>] (kthread) from [<8000faf8>] (ret_from_fork+0x14/0x3c)

[0]kdb> _

I was careful, but the logs may contain errors, because i had to transcribe them by hand EDIT: fixed some transcription-errors

ghost avatar Mar 30 '16 12:03 ghost

I am having a similar problem with bluetooth and a Nexus6P device connecting. After pairing the Nexus 6P with blueman and other bluetooth tools, the raspberry pi immediately freezes. Leaving it for ten minutes results in no response, however, I have no logs.

delize avatar Apr 03 '16 03:04 delize

I'm having a similar issue with a Logitech bluetooth mouse. If there is an intensive process going on, moving the mouse would often freeze the entire OS.

I'm new to Linux world. What are the steps I can do to provide debug info here?

Is there an instability issue with Bluetooth hardware on rpi3? Or is this a bug in software?

steverandy avatar Apr 06 '16 03:04 steverandy

Bluetooth throughput is limited on Pi3 because of a lack of flow control signals to BT modem. The Bluetooth H5 protocol is supposed to handle packet loss, but the current BT modem firmware does not work with the BlueZ stack in H5 mode.

pelwell avatar Apr 06 '16 08:04 pelwell

Is this issue perhaps related to this? https://github.com/raspberrypi/firmware/issues/553

steverandy avatar Apr 06 '16 10:04 steverandy

How can we make this issue actionable?

paulrouget avatar Apr 12 '16 11:04 paulrouget

It's open and on this bug list, so will be looked at when time allows. Depends on the impact of the issues and the number of people it affects.

JamesH65 avatar Apr 12 '16 12:04 JamesH65

Depends on the impact of the issues

For the record, all my bluetooth devices trigger this crash.

Also, as I was googling, I've seen several people reporting "system freeze" with the PS3 bluetooth controller (example http://blog.petrockblock.com/forums/topic/problems-getting-ps3-controller-to-work-properly/#post-119899 and https://www.reddit.com/r/RetroPie/comments/4aoojj/pi3_crashing_with_kernel_474079425_internal_error/)

paulrouget avatar Apr 12 '16 12:04 paulrouget

If there's anything I can do to get a better log, or try a patch, I'd be happy to help.

paulrouget avatar Apr 12 '16 12:04 paulrouget

I just wanted to add that I am having the same issue. I have a Pi3 with a fresh RP3.6 and just started using PS3 DS3 controllers through BT yesterday and almost instantly started seeing the freezes. If I change out the PS3 controller and use a wired 360, I have no issues at all.

BaDvs3viL avatar Apr 12 '16 14:04 BaDvs3viL

(no crash with a bluetooth dongle)

paulrouget avatar Apr 12 '16 14:04 paulrouget

We'll get in a DS3 and have a go. Can you say what extra configuration is required beyond pairing and trusing, and perhaps recommend a test application if necessary?

I can see three potential outcomes:

  1. If this crash turns out to be due to a bug/incompatibility in the Linux Bluetooth stack then we have a chance of fixing it.
  2. If it is a bug/incompatibility in the Broadcom firmware then it becomes much harder to get a fix.
  3. If it is due to data loss going through the UART then it may be improved by H5 support, which is somewhere between 1 and 2 in tractability.

pelwell avatar Apr 12 '16 14:04 pelwell