xbianonpi / xbian

XBMC on Raspberry Pi, Bleeding Edge
https://xbian.org
GNU General Public License v3.0
294 stars 44 forks source link

Bluetooth device not recognise on cubox #552

Closed belese closed 9 years ago

belese commented 10 years ago

the problem looks like this one : http://imx.solid-run.com/forums/viewtopic.php?f=16&t=461&start=10

johan

mk01 commented 10 years ago

@belese

there are two HW revisions for wlan and BT. so it looks you have the newer already. different FW file is needed and 'patchram' needs one more parameter when loading firmware. we were discussing it with Rabeeh on IRC so try IRC log.

mk01 commented 10 years ago

@belese

here it is http://server.vijge.net/static/cubox/irclog/201404/cubox-20140424.html . search for 'patchram'

so currently we miss 4330 firmware which needs to be loaded the same way as for 4329, but with addition of parameter "--enable_lpm"

when you try and confirm it, I will add to kernel package.

belese commented 10 years ago

ok so i only need to test with patchram and kernel parameter, i believe i have to recompile the kernel. will try soon, when my pc resurect.

belese commented 10 years ago

Edit : i've tried also with bcm4330.hcd as it should be, but result is the same as below. as i've a 4330 :

cat /sys/class/mmc_host/mmc0/mmc0\:0001/mmc0\:0001\:1/device
0x4330

i've tried this command

xbian@cubox ~ $ sudo ./brcm_patchram_plus  -d --patchram /lib/firmware/brcm/bcm4329.hcd --baudrate 3000000 --use_baudrate_for_download /dev/ttymxc3 --enable_hci --enable_lpm
option patchram with arg /lib/firmware/brcm/bcm4329.hcd
option baudrate with arg 3000000
option use_baudrate_for_download
option enable_hci
option enable_lpm
/dev/ttymxc3 
writing
01 03 0c 00 
writing
01 03 0c 00 

and it loop always like this. i've downloaded the file from your post on cubox-i forum (first post link)

maybe related to this thread? http://archlinuxarm.org/forum/viewtopic.php?t=7042&p=39946 i'm on Linux cubox 3.10.30+ #468 SMP Thu Jun 5 14:31:18 CEST 2014 armv7l GNU/Linux

mk01 commented 10 years ago

@belese

by default there is patchram process started from JOB module-init-tools (currently for 4329 rev). have you killed that process before you tried changed parameter and another FW file ?

mk01 commented 10 years ago

@belese

and this has nothing with kernel itself. you don't need to recompile. patchram binary is the same, only should be called with that parameter as addition to the parameters for 4329.

and of course you should not use /lib/firmware/brcm/bcm4329.hcd but /lib/firmware/brcm/bcm4330.hcd

mk01 commented 10 years ago

https://github.com/phrac/android_vendor_samsung_torospr/raw/master/proprietary/bcm4330.hcd

belese commented 10 years ago

Hi i didn't stop the service, but i kill the process, i see of course my error, and use the bcm4330. but with no luck. i've tried a lot of solution yesterday. None was working, will try to change the job to load the 4330 intsead 4329.

belese commented 10 years ago

ok i manage to make it work, (but kill process is no suffisant, i need to comment line in job file) with this command :

brcm_patchram_plus -d --patchram /lib/firmware/brcm/bcm4330.hcd --baudrate 3000000 --use_baudrate_for_download /dev/ttxc3 --enable_hci --no2bytes --enable_lpm --tosleep=50000

and after hciconfig device up

will do a push request later, they have a auto detect script on arch linux, will adapt for xbian.

this work on command line but if i change line in job file with mine it doesn't work, i've no time now to check more, but when i check log, seems thes script is run more than one time. will look deeper later

belese commented 10 years ago

https://github.com/xbianonpi/xbian-update/pull/8

mk01 commented 10 years ago

patchram process needs to stay running in the background. it is not simple one-shot FW uploader.

I added auto detect (based on /sys/devices/soc0/soc.1/2100000.aips-bus/2190000.usdhc/mmc_host/mmc0/mmc0:0001/mm c0:0001:1/device) and moved FW loading to "imx6-bluetooth" job (part of kernel package). you can try installing linux-image-3.10.30-armmp ver 1.0.8 ?

(btw: is in the command "/dev/ttxc3" a typo or correct? the usual is "/dev/ttymxc3" and I changed to that - adapt and let me know if necessary).

belese commented 10 years ago

I let patchram running in background, i've done many test, and create a job file just for test. (who run patchram and some bt command)

i can reproduce the problem easily, j just add a sleep 5 between patchram and next command, and it'll finished in timeout. if i add sleep 2, command work (but next one will be in timeout too)

of course /dev/ttxc3 is a typo, i tried with the pull request i submit, and a special job file to test.

will try with kernel you mentionned.

belese commented 10 years ago

i've tried with version you have mentionned, i've seen your script, but it's the same problem.

i've done some search, and have seen this problem reported. and not sure someone has a 4330 working, i don't remember to have see a report for a working 4330. i've play a bit with the tosleep, because some time with it, the command just after (i the 5 sec) goes in timeout too, but sometimes it's ok. without the otpion tosleep, first command (in that 5 sec) work all time i've done the test (but require a reboot each time, so it's looong to test).

but don't find anything.

something cut bt after 5 sec, as before everything i've test work (make discoverable, scan)

as the 4330 add bt4 support who is low power, is it not possible there's something that put bt in some kind of sleep, i don't find something like this but i don't know enouqh about linux low level

mk01 commented 10 years ago

jump to IRC and approach JNETTLET or RABEEH

On 22 Jun 2014, at 00:06, belese notifications@github.com wrote:

i've tried with version you have mentionned, i've seen your script, but it's the same problem.

i've done some search, and have seen this problem reported. and not sure someone has a 4330 working, i don't remember to have see a report for a working 4330. i've play a bit with the tosleep, because some time with it, the command just after (i the 5 sec) goes in timeout too, but sometimes it's ok. without the otpion tosleep, first command (in that 5 sec) work all time i've done the test (but require a reboot each time, so it's looong to test).

but don't find anything.

something cut bt after 5 sec, as before everything i've test work (make discoverable, scan)

as the 4330 add bt4 support who is low power, is it not possible there's something that put bt in some kind of sleep, i don't find something like this but i don't know enouqh about linux low level

— Reply to this email directly or view it on GitHub.

belese commented 9 years ago

it's fixed, i just try the last cubox image, and bluetooth was working. at least for bcm4330.