raspberrypi / linux

Kernel source tree for Raspberry Pi-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://forums.raspberrypi.com/
Other
11.11k stars 4.98k forks source link

Bluetooth and Dual Shock 3 Playstation Remote will crash System. #1360

Closed coniferous1 closed 8 years ago

coniferous1 commented 8 years ago

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.

mauruco commented 8 years ago

@diogomsantos I do not know what your problem boy. Just try to be constructive. People also look for workarrounds and found this place! Everyone has understood your message. OK? Have a nice day.

FreakyBigFoot commented 8 years ago

Where are the logs kept that show the error(s)?

konradsa commented 8 years ago

Has anybody tried a 4.4 kernel yet to see if that fixes the issue?

https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=144087

FreakyBigFoot commented 8 years ago

I don't even see a mention of bluetooth there ^

konradsa commented 8 years ago

Bluetooth doesn't need to be mentioned there, these are the instructions on how to upgrade to a 4.4 kernel. There is a high likelihood a lot of patches and improvements have been done for the Bluetooth drivers in the new kernel version. All the crash logs here seem to be from a 4.1 kernel.

Prindle19 commented 8 years ago

What is in there is a note about Device Tree:

"Notes: Device tree is required for 4.4 kernel. Settings like "dtoverlay=" to disable device tree will cause failure to boot."

So, safe to assume that current configs that disable onboard bt would cause issues?

"dtoverlay=pi3-disable-bt"

pelwell commented 8 years ago

Why would you think that? What is the connection?

And FYI, for Foundation kernels the device_tree= setting is now ignored.

konradsa commented 8 years ago

@Prindle19 : I think they are talking about "device_tree=" here, as pelwell pointed out.

konradsa commented 8 years ago

Btw, to revert to an earlier version:

1) Find the sha hash here: https://github.com/Hexxeh/rpi-firmware/commits/master 2) sudo rpi-update

For instance, to revert to 4.1.19 use the following hash: 6e8b794818e06f50724774df3b1d4c6be0b5708c

filius-martis commented 8 years ago

To clear things up, I already upgraded to the latest 4.4 kernel branch (https://github.com/Hexxeh/rpi-firmware) and no matter which kernel is in place, I always see the same behavior:

Connecting my PS4 controller to the integrated bluetooth controller -> the system always freezes within minutes.

Connecting my PS4 controller to an usb bluetooth stick while the internal bluetooth controller still is active -> no freezes at all

Connecting my PS4 controller to an usb bluetooth stick while the internal bluetooth controller is deactivated (dtoverlay=pi3-disable-bt-overlay in /boot/config.txt) -> no freezes at all

konradsa commented 8 years ago

Ok, that's disappointing. With my PS3 controller connected to bluetooth, I can play N64 games for hours without issues. But as soon as I play a PSX game, it locks up within several minutes. I guess separate bluetooth dongle is the way to go for now. If a new kernel doesn't fix the issue, it will probably not be fixed anytime soon. The only hope right now is that someone stumbles across a patch for the issue and merges it into the rpi kernel.

konradsa commented 8 years ago

Ok, so I upgraded to this version here, and I have been playing several hours of SNES/N64 games without a single lockup. Have not been playing much PSX games though, that was the only one where it used to lock up for me.

If you want to try it out and see if it helps you, run 'sudo rpi-update 15ffab5493d74b12194e6bfc5bbb1c0f71140155'.

FreakyBigFoot commented 8 years ago

Did you determine what's different about it?

I can play n64 games for quite awhile before anything happens. It's PSX games that do it for me.

konradsa commented 8 years ago

It's a much newer kernel (4.1 -> 4.4), so thousands of things will have changed.

No clue why PSX causes it to happen more rapidly than N64, must have something to do with the emulator.

On Sun, May 8, 2016 at 6:30 PM, FreakyBigFoot notifications@github.com wrote:

Did you determine what's different about it?

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/raspberrypi/linux/issues/1360#issuecomment-217750141

FreakyBigFoot commented 8 years ago

I'll give this a try in the next few days. Thanks!

kyserthehun commented 8 years ago

I can play n64 games for quite awhile before anything happens. It's PSX games that do it for me.

I get the lock-ups with every emulator i've tried within a couple of minutes. I'll give the new kernel a try tonight if I can figure out the curl-ssl cert error i'm getting.

FreakyBigFoot commented 8 years ago

Sounds good. I'm hoping a couple people could update to test and verify. Unfortunately I gave my pi3 to a friend and won't have another until Wednesday.

konradsa commented 8 years ago

For anybody getting ssl cert error, the only way to work around it I have found is by disabling the cert check for rpi-update as follows:

1) Edit /usr/bin/rpi-update and add -k flag to all occurrences of curl, e.g."sudo sed -i 's/curl/curl -k/g' /usr/bin/rpi-update" 2) Run rpi-update without self update, e.g. "sudo UPDATE_SELF=0 rpi-update

" EDIT: Fix typo (SELF_UPDATE) On Mon, May 9, 2016 at 8:52 AM, kyserthehun notifications@github.com wrote: > I can play n64 games for quite awhile before anything happens. It's PSX > games that do it for me. > > I get the lock-ups with every emulator i've tried within a couple of > minutes. I'll give the new kernel a try tonight if I can figure out the > curl-ssl cert error i'm getting. > > — > You are receiving this because you commented. > Reply to this email directly or view it on GitHub > https://github.com/raspberrypi/linux/issues/1360#issuecomment-217855520
ghost commented 8 years ago

i've tested it with kernel 4.4. After about 15 minutes i started to get wifi-problems, but the pi hasn't locked up for me. i can't definitly say that this bluetooth bug is fixed, but it's definlty better than before

kyserthehun commented 8 years ago

Ah, thanks Konradsa. I've been fooling with this for a couple of days now and google wasn't helping. If anyone is still having problems after following his instructions.

"sudo SELF_UPDATE=0 is flip-flopped 'sudo update_self=0' ;)

I'll report back on the controller issue tonight.

KrS14 commented 8 years ago

I tried the 4.4 kernel, no blue tooth at all. Reverted back to 4.1 still no onboard Bluetooth. So that got broken somehow.

If I put my USB BT adapter back in it works fine.

I did remove the device tree setting I had in config.txt to be sure the onboard wasn't disabled.

Bummer On May 9, 2016 10:42 AM, "kyserthehun" notifications@github.com wrote:

Ah, thanks Konradsa. I've been fooling with this for a couple of days now and google wasn't helping. If anyone is still having problems after following his instructions.

"sudo SELF_UPDATE=0 is flip-flopped 'sudo update_self=0' ;)

I'll report back on the controller issue tonight.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/raspberrypi/linux/issues/1360#issuecomment-217884127

konradsa commented 8 years ago

Bluetooth, audio, etc. all works fine for me. Make sure you are using this version here: "sudo UPDATE_SELF=0 rpi-update 15ffab5493d74b12194e6bfc5bbb1c0f71140155"

KrS14 commented 8 years ago

Yes, I did use the same Hash, as well as when reverting, I used the revert hash posted earlier.

Not a big deal, just reporting what happened to me. :) This is retropie 3.6 i'm using.

On Mon, May 9, 2016 at 3:40 PM, konradsa notifications@github.com wrote:

Bluetooth, audio, etc. all works fine for me. Make sure you use try the right version: "sudo UPDATE_SELF=0 rpi-update 6e8b794818e06f50724774df3b1d4c6be0b5708c"

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/raspberrypi/linux/issues/1360#issuecomment-217967032

kyserthehun commented 8 years ago

Played around an hour or so with the new kernel and a PS3 controller connected through the onboard bluetooth. No issues for me. Played SNES and PSX without a lock-up. Pi-Hole seems to be working well so no issues with the LAN. Can't comment on WiFi.

konradsa commented 8 years ago

I see a bunch of the following messages in the log file now:

[111588.504688] Bluetooth: hci0: Frame reassembly failed (-84)

Didn't see those before, I assume this is what used to crash the old kernel, but maybe with the newer kernel it keeps chugging along now without crashing. On May 9, 2016 10:22 PM, "kyserthehun" notifications@github.com wrote:

Played around an hour or so with the new kernel and a PS3 controller connected through the onboard bluetooth. No issues for me. Played SNES and PSX without a lock-up. Pi-Hole seems to be working well so no issues with the LAN. Can't comment on WiFi.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/raspberrypi/linux/issues/1360#issuecomment-218042754

konradsa commented 8 years ago

I think I can confirm that this issue is fixed for good in Linux 4.4 Kernel.

See here: diff

If you look closely, you can see line 195 was added in 4.4 which sets the buffer pointer to NULL if the reassembly error occurs. This prevents it from being treated as a valid buffer later on and causing a crash.

FreakyBigFoot commented 8 years ago

I updated and it froze wiithin 1 minute of playing PSX.

konradsa commented 8 years ago

Can you run 'uname -a' and post the output here? On May 10, 2016 6:18 PM, "FreakyBigFoot" notifications@github.com wrote:

I updated and it froze wiithin 1 minute of playing PSX.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/raspberrypi/linux/issues/1360#issuecomment-218308757

lufeig commented 8 years ago

running retropie 3.7, updated to 4.4 kernel:

Linux retropie 4.4.9-v7+ #884 SMP Fri May 6 17:28:59 BST 2016 armv7l GNU/Linux

played fba, mame and super nes, all using an original DS3 controller and the onboard bluetooth for more than an hour

until now, no freezes!

FreakyBigFoot commented 8 years ago

I updated mine and when I 'uname -a' It says 'Linux retropie 4.1.19-v7+ #851 SMP Sat Mar 5 22:58:42 GMT 2016 armv7l GNU/Linux'

Did my update fail? When I try to update it says 'Your firmware is already up to date'.

konradsa commented 8 years ago

@FreakyBigFoot You are still running the old version. You need to run this: "sudo UPDATE_SELF=0 rpi-update 15ffab5493d74b12194e6bfc5bbb1c0f71140155"

EDIT: Hash fixed

FreakyBigFoot commented 8 years ago

@konradsa I did and now it says I'm up to date. Do I need to downgrade? Should I start from scratch?

lufeig commented 8 years ago

dear konradsa, the correct version is

sudo UPDATE_SELF=0 rpi-update 15ffab5493d74b12194e6bfc5bbb1c0f71140155

lufeig commented 8 years ago

6e8b794818e06f50724774df3b1d4c6be0b5708c is 4.1's

for 4.4 use 15ffab5493d74b12194e6bfc5bbb1c0f71140155


EDIT: corrected for 4.4 kernel. thanks @konradsa

konradsa commented 8 years ago

@lufeig : You are right, copy and paste error. :-) You got one too actually.

"sudo UPDATE_SELF=0 rpi-update 15ffab5493d74b12194e6bfc5bbb1c0f71140155" should give you the right version

FreakyBigFoot commented 8 years ago

Woah these are very confusing. You've now listed sever. @lufeig said to do '6e8b794818e06f50724774df3b1d4c6be0b5708c'

@konradsa said to do '15ffab5493d74b12194e6bfc5bbb1c0f71140155'

konradsa commented 8 years ago

I don't even know why I am using the long hashes, I should just be using the short ones. :-)

Anyways, you can see a list of all the commits here: https://github.com/Hexxeh/rpi-firmware/commits/master

15ffab5493d74b12194e6bfc5bbb1c0f71140155 is the correct one

lufeig commented 8 years ago

@FreakyBigFoot, i amended my previous post.

as @konradsa said, i pasted the same 4.1 twice. sorry.

i hope everything is clear now. :-)

zanderi commented 8 years ago

First of all thank you so much for narrowing this all down it's been driving me crazy. After disabling bluetooth it fixed all the crashes. I am running: Linux retropie 4.1.19-v7+ #858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l GNU/Linux

I Ran: (as rpi-update is not installed) sudo UPDATE_SELF=0 apt-get install 15ffab5493d74b12194e6bfc5bbb1c0f71140155

and: sudo UPDATE_SELF=0 apt-get install 6e8b794818e06f50724774df3b1d4c6be0b5708c

I receive the error message: "Unable to locate package" on both commands.

konradsa commented 8 years ago

You need to install rpi-update first by running 'sudo apt-get install rpi-update'. Then follow the directions above. On May 11, 2016 2:04 AM, "Alexander Indo" notifications@github.com wrote:

First of all thank you so much for narrowing this all done it's been driving me crazy. After disabling bluetooth it fixed all the crashes. I am running: Linux retropie 4.1.19-v7+ #858 https://github.com/raspberrypi/linux/pull/858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l GNU/Linux

I Ran: (as rpi-update is not installed) sudo UPDATE_SELF=0 apt-get install 15ffab5493d74b12194e6bfc5bbb1c0f71140155

and: sudo UPDATE_SELF=0 apt-get install 6e8b794818e06f50724774df3b1d4c6be0b5708c

I receive the error message: "Unable to locate package" on both commands.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/raspberrypi/linux/issues/1360#issuecomment-218369777

BaDvs3viL commented 8 years ago

Thanks to everyone for the information. I had to use a few post to get mine updated so I put it all in one here. I was running RP3.7 with K4.1

I first needed to install rpi-update... "sudo apt-get install rpi-update"

Then I had to fix the SSL Cert error that happens when you try and update the K... "sudo sed -i 's/curl/curl -k/g' /usr/bin/rpi-update"

I then update the K to 4.4... "sudo UPDATE_SELF=0 rpi-update 15ffab5493d74b12194e6bfc5bbb1c0f71140155"

So far I have tried everything I could to get this to freeze as I have before and its working fine. I will keep testing.

Thanks everyone!!!

Update - Over 3 hours in with playing random games and whatnot I have not had one freeze.

zanderi commented 8 years ago

I will try out rpi-update I guess I've steered away from it due to this conversation here: https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=58963

pablo808 wrote: Only run rpi-update if you need the latest bleeding edit updates.

ShiftPlusOne wrote: That's pretty much it. I would change that to "Only run rpi-update if you know you need a specific build of the firmware or if you were asked to do so by Dom."

Yes, apt-get upgrade WILL update your firmware to the latest stable version, and that MAY conflict with rpi-update. If you see something on the internet that says otherwise, it's probably outdated information.

KrS14 commented 8 years ago

Reloading a fresh install of 3.7 to see if I can get my ps3 controller to connect. Nothing would get it to work after the initial kernel change, buy that could have been something else that did that.

I will report back. On May 11, 2016 12:50 PM, "Alexander Indo" notifications@github.com wrote:

I will try out rpi-update I guess I've steered away from it due to this conversation here: https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=58963

pablo808 wrote: Only run rpi-update if you need the latest bleeding edit updates.

ShiftPlusOne wrote: That's pretty much it. I would change that to "Only run rpi-update if you know you need a specific build of the firmware or if you were asked to do so by Dom."

Yes, apt-get upgrade WILL update your firmware to the latest stable version, and that MAY conflict with rpi-update. If you see something on the internet that says otherwise, it's probably outdated information.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/raspberrypi/linux/issues/1360#issuecomment-218519761

mauruco commented 8 years ago

@BaDvs3viL Thank you! Worked perfectly. also solved a problem in kodi with "CCurlFile::FillBuffer - Failed: Could not connect to server(7)" Cheers

KrS14 commented 8 years ago

I give up. I'm not sure why but I can't connect to my PS3 even with a fresh flash. I could when i first got the pi3. Even wired it will get one or two buttons then no response.

If I plug in my USB Orico CSR based BT adapter everything swtches over, and works flawlessly on the fly.

So weird, maybe my pi3 has gone defective somehow. It doesn't show with hciconfig unless i install pi-bluetooth, even then nothing will connect to it.

Glad I bought this USB adapter now lol I'll just stick with it.

On Wed, May 11, 2016 at 2:47 PM, mauruco notifications@github.com wrote:

@BaDvs3viL https://github.com/BaDvs3viL Thank you! Worked perfectly. also solved a problem in kodi with "CCurlFile::FillBuffer - Failed: Could not connect to server(7)" Cheers

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/raspberrypi/linux/issues/1360#issuecomment-218552921

bengus64 commented 8 years ago

I am sure I can speak for myself and others for saying a big huge "THANK YOU" to whomever fixed this issue. I have been waiting for this to be addressed since I bought my pi3 on release day. However, I would feel much more comfortable if this thread was "officially closed/marked as fixed" by who wrote the commits? Just a thought....again thanks for all of your hard work.

lufeig commented 8 years ago

Just adding that I played some PSX Metal Gear on RetroPie 3.7 kernel 4.4, with no freezes or lockups, using my DS3 controllers connected to the RPi3 onboard Bluetooth

Liquidream commented 8 years ago

Thank you everyone!! 😄 Like many others, I've been struggling with this issue on my Pi3 since launch! I hope I'm not jinxing it, but I've been running Mario 64 for over 40mins now with no freezing (touch wood) using @BaDvs3viL 's upgrade steps above. Now hopefully my Pi3 can be the RetroGaming device I intended to use it for! 😉 Thanks again

greener2 commented 8 years ago

My two cents worth - the steps, as I took them:

  1. Did a sudo apt-get update && sudo apt-get upgrade to upgrade any software packages.
  2. Did sudo sed -i 's/curl/curl -k/g' /usr/bin/rpi-update to get around some SSL certificate issue.
  3. Did sudo UPDATE_SELF=0 rpi-update 15ffab5493d74b12194e6bfc5bbb1c0f71140155 to update the Pi to the revision 15ffab...
  4. Rebooted, cos that usually fixes things

After that, no lockups after playing for an hour on the PSX emulator in RetroPie. Usually I wouldn't have gotten past the main menu or options screen of a game. Works with SNES, Genesis/Megadrive and N64 too.

konradsa commented 8 years ago

So the evidence is pretty clear that this bug has been fixed in a newer kernel. Also the diff between old and new kernel clearly shows that it has been addressed: diff between kernel 4.1 and 4.4

Not sure what should be done here with this issue. Nobody will probably backport this fix to 4.1 kernel and going to kernel 4.4 is clearly the way forward. However most people won't get that fix until Retropie updates its version.