Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
PS3 2.6.21 Kernel ebuild / Controller via Bluetooth
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5, 6  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
anunakin
Tux's lil' helper
Tux's lil' helper


Joined: 31 May 2004
Posts: 101

PostPosted: Mon May 14, 2007 1:29 pm    Post subject: Reply with quote

garlicbread wrote:
if you look here http://www.pabr.org/sixlinux/sixlinux.en.html
there was a patch for HIDD that was included in as part of 2.6.21 kernel that's not present in 2.6.16
the patch itself is part of the basic vanilla 2.6.21 tree
so any PS3 kernel sources based on 2.6.21 should have this patch included

I've noticed it doesn't always work on first bootup of the machine
usually I try hitting the button on the controller, lights start to flash but /dev/input/js0 isn't always created first time

usually I try resetting the Bluetooth
Code:
hciconfig hci0 down
hciconfig hci0 up

which breaks the connection with the controller (lights stop flashing)

then try hitting the button on the controller a 2nd time and then it usually works
(lights still flashing but /dev/input/js0 is created)


The site http://www.pabr.org/sixlinux/sixlinux.en.html says, 2.6.21 has a hid for bluetooth and another for usb.... but 2.6.16.... has one only... and wireless for gelic ... the kernel 2.6.21 not have it?
_________________
Anunakin (Marcus Fazzi)
PHP/Java/C++ Developer
Sony PS3 JPN 60GB, with Gentoo Linux + HDD 160GB
Sony PS2 50001, with PS2Linux, HDD 80GB
Back to top
View user's profile Send private message
garlicbread
Apprentice
Apprentice


Joined: 06 Mar 2004
Posts: 182

PostPosted: Mon May 14, 2007 3:38 pm    Post subject: Reply with quote

as it states on the page
Code:
"At the time of writing, mainstream Linux distributions do not explicitly support the SIXAXIS in wireless mode. Hence, the following customizations are required.

linux-2.6.20 or later .  This version has the HID layer separate from the USB subsystem, which allows it to be used more easily by the Bluetooth subsystem"


you have to remember Wireless networking (802.11G - like wireless ethernet) and Bluetooth (like wireless USB) are 2 different things
the 2.6.16 kernel from the Cell sources may have Wireless networking but I'm betting it doesn't have the required stuff for Bluetooth Controller
that page above is only to do with the Bluetooth Controller
Back to top
View user's profile Send private message
thetwister
n00b
n00b


Joined: 13 May 2007
Posts: 3

PostPosted: Mon May 14, 2007 4:12 pm    Post subject: Reply with quote

Hi!

i'm totally confused now!
i tried yesterday 2 thinks, compile the kernel without 64 bit. compiled right, but wasn't able to boot.

ok then i tried the stage4 64 bit ul ( i began at 0) . installed worked fine. compiled the kernel with 64 bit, genkernel. and i'm still not able to boot! :(
what is wrong on that?
make vmlinux
make modules
make modules_install
cp vmlinux /boot/kernel-2.6.21-ps3-r1
edit the usb line in modules_install
genkernel initrd
cd /boot
ln -s kernel-2.6.21-ps3-r1 kernel-test
ln -s initramfs-genkernel-ppc64-2.6.21-ps3-r1 initrd-test

then i edit the kboot .conf (same line as before instead as gentoo => gentootest

have i forgotten something?! :(

greetz

edit tried it with initrdtest and kerneltest ... no success ..

edit 2: tried it with genkernel --config-file=/usr/src/linux/ps3config all (file is the one from arch/powerpc/ps3* ) so success either :(

do i have to edit the make.conf or something else?!
Back to top
View user's profile Send private message
garlicbread
Apprentice
Apprentice


Joined: 06 Mar 2004
Posts: 182

PostPosted: Mon May 14, 2007 7:04 pm    Post subject: Reply with quote

I've just updated the top thread with instruction on setup via layman
layman will allow the overlay to be updated automatically as I add stuff in
(so scrap any manual overlay you've downloaded already and use layman instead)

once it's setup it's just a case of "layman -S" to update the overlays you've got setup

I'm using a slightly different config from the default ps3 one
I was assuming that the default config would work just fine but now I'm starting to wonder
inside the overlay ps3-git-sources/files/ directory
there should be a file called config-2.6.21-ps3-head-20060426
this is the one I'm using at the moment so try this one

failing that I've got a tar.bz2 file uploaded with a binary / pre-compiled copy of the kernel / modules / initramfs image
this is 64bit and is exactly the same one that I'm using at the moment
http://homepage.ntlworld.com/garlicbread/Projects/PS3Linux/ps3-kernel-build-2.6.21-r1.tar.bz2
if this doesn't work
then all I can think of is that it's something to do with your kboot.conf
(I try to avoid using symlinks and specify the full file name in the conf file entry just to be safe)

Note the new overlay should now contain a patched version of bluez-utils for the controller
also now contains sources the same as those found on the CELL 2.0 CD (untested)
under ps3-cell-sources

I'm currently working on a new version of the 2.6.21-git that includes wireless (2.6.21-r2)
but it's currently masked as the current UDF patch doesn't seem to be to happy with it at the moment
so I'm going to try and manually patch it

I've not run any comparisons against the ps3-git-sources from www.kernel.org or the one from the Cell 2.0 CD
Looking at the readme on the Cell CD (2.0) it looks as if for the cell sources wireless works better for 2.6.16 rather than 2.6.21
however I'd doubt you'd get the BT controller working in that case becuase of the HIDD code included 2.6.20 onwards
the git release is probably more up-to-date / has more in it, but also could be more unstable (no complaints so far though)
Back to top
View user's profile Send private message
garlicbread
Apprentice
Apprentice


Joined: 06 Mar 2004
Posts: 182

PostPosted: Wed May 16, 2007 1:35 am    Post subject: Reply with quote

Got this to work but it was a pain in the arse
somewhere before the addition of the code for wireless, the code for the block devices was re-done
this means instead of /dev/sda for the hard disk it now becomes /dev/ps3da
If you've been pulling your own git-releases from the tree this may explain the /dev/sda2 not found error

I'm not sure if this is also true for the cell sources 2.6.21 as well
although according to the readme on the Cell CD the cell-2.6.16 works better with wireless than Cell-2.6.21
but the problem then is that you need 2.6.21 for proper Bluetooth / Controller setup
in the case of the git release 2.6.21 this seems to work okay without probs for wireless but needs the fstab kboot.conf files to be edited correctly

for /etc/fstab
what this means is that any lines in /etc/fstab for /dev/sda
need to be replaced with /dev/ps3da
e.g.
Code:
/dev/sda1               /               ext3            noatime         0 1

would become
Code:
/dev/ps3da1               /               ext3            noatime         0 1


for the /etc/kboot.conf, only the real_root= bit is the bit we have to change
this is because the kernel inside otheros.bld in the firmware is still using /dev/sda
but the kernel it jumps across to that we've compiled is using /dev/ps3da
e.g.
Code:
gentoo_2_6_21_r2='sda1:/boot/kernel-ppc64-2.6.21-git-r2 initrd=sda1:/boot/initramfs-genkernel-ppc64-2.6.21-ps3-r2 root=/dev/ram0 real_root=/dev/sda1 init=/linuxrc video=ps3fb:mode:163 rhgb'

becomes
Code:
gentoo_2_6_21_r2='sda1:/boot/kernel-ppc64-2.6.21-git-r2 initrd=sda1:/boot/initramfs-genkernel-ppc64-2.6.21-ps3-r2 root=/dev/ram0 real_root=/dev/ps3da1 init=/linuxrc video=ps3fb:mode:163 rhgb'



there are now the following ebuilds in the overlay
1. ps3-git-sources-2.6.21-r1 this ebuild doesn't contain wireless but does use /dev/sda as it's node for the hard disk
so it's a lot simpler to get working and doesn't need any messing about with /etc/fstab /etc/kboot.conf in terms of the disk node
so if you've not got 2.6.21 working at least yet then try to get this one working first of all

2. ps3-git-sources-2.6.21-r2 this ebuild does contain wireless, but it uses /dev/ps3da for the drive
it's a checkout of the code from 20070502, just after wireless was committed

3. ps3-git-sources-2.6.22_rc1 I've currently masked this version - release 20070515
untested at the moment, latest cutting edge version, based on the mainline 2.6.22-rc1 tree
you should probably only try this if your curious / really know what your doing (I don't think there's any real advantage over 2.6.21-r2 at the moment)
also uses /dev/ps3da for the hard disk
I'll need to test this out later on also I'm going to have a look at the new CELL 2.0 otheros.bld

I would advise having a bootable CD handy before messing with /etc/fstab /etc/kboot.conf
as you could quite easily end up with an unbootable system

one thing I have done is to re-generate my initramfs image with CONFIG_VI set within
/usr/share/genkernel/ppc64/busy-config
this way if the system does become unbootable I can just type "shell"
and go in / mount the root filesystem / edit the files etc using vi without having to boot to a CD

For wireless
if the cable is in the back then it seems to default to using the local ethernet connection on eth0
if the cable is out of the back then it will attempt to use wireless instead
all I had to add was
Code:
essid_eth0="<put your essid of your router here>"

then I unplugged the ethernet cable
Code:
/etc/init.d/net.eth0 restart

at which point it wirelessly gets an IP
Back to top
View user's profile Send private message
ghutzl
Tux's lil' helper
Tux's lil' helper


Joined: 29 May 2005
Posts: 123
Location: Germany

PostPosted: Fri May 18, 2007 8:49 am    Post subject: Reply with quote

Hello garlicbread!

You are the man! I installed gentoo on my ps3 and used your kernel and got everything working up to now! Great work!

I have a some questions:

1. Do you also see these kind of messages in your /var/log/messages:

Quote:
May 18 11:35:38 gollum ps3disk sb_02: ps3disk_read_write_sectors:111: write completed
May 18 11:35:43 gollum ps3disk sb_02: ps3disk_handle_request_sg:301: write req has 2 bios for 16 sectors 16 hard sectors
May 18 11:35:43 gollum ps3disk sb_02: ps3disk_scatter_gather:267: bio 0: 1 segs 8 sectors from 19433711
May 18 11:35:43 gollum ps3disk sb_02: ps3disk_scatter_gather:267: bio 1: 1 segs 8 sectors from 19433719
May 18 11:35:43 gollum ps3disk sb_02: ps3disk_read_write:162: write buffer 0x0000000000000000 sector 19433711 nr 16
May 18 11:35:43 gollum ps3disk sb_02: ps3disk_read_write_sectors:79: write 16 sectors starting at 19433711
May 18 11:35:43 gollum ps3disk sb_02: ps3disk_read_write_sectors:111: write completed
May 18 11:35:43 gollum ps3disk sb_02: ps3disk_handle_request_sg:301: write req has 5 bios for 40 sectors 40 hard sectors
May 18 11:35:43 gollum ps3disk sb_02: ps3disk_scatter_gather:267: bio 0: 1 segs 8 sectors from 14887
May 18 11:35:43 gollum ps3disk sb_02: ps3disk_scatter_gather:267: bio 1: 1 segs 8 sectors from 14895
May 18 11:35:43 gollum ps3disk sb_02: ps3disk_scatter_gather:267: bio 2: 1 segs 8 sectors from 14903
May 18 11:35:43 gollum ps3disk sb_02: ps3disk_scatter_gather:267: bio 3: 1 segs 8 sectors from 14911
May 18 11:35:43 gollum ps3disk sb_02: ps3disk_scatter_gather:267: bio 4: 1 segs 8 sectors from 14919
May 18 11:35:43 gollum ps3disk sb_02: ps3disk_read_write:162: write buffer 0x0000000000000000 sector 14887 nr 40
May 18 11:35:43 gollum ps3disk sb_02: ps3disk_read_write_sectors:79: write 40 sectors starting at 14887
May 18 11:35:43 gollum ps3disk sb_02: ps3disk_read_write_sectors:111: write completed
May 18 11:35:43 gollum ps3disk sb_02: ps3disk_handle_request_sg:301: write req has 1 bios for 8 sectors 8 hard sectors
May 18 11:35:43 gollum ps3disk sb_02: ps3disk_scatter_gather:267: bio 0: 1 segs 8 sectors from 14927
May 18 11:35:43 gollum ps3disk sb_02: ps3disk_read_write:162: write buffer 0x0000000000000000 sector 14927 nr 8
May 18 11:35:43 gollum ps3disk sb_02: ps3disk_read_write_sectors:79: write 8 sectors starting at 14927
May 18 11:35:43 gollum ps3disk sb_02: ps3disk_read_write_sectors:111: write completed


I think there is some disk logging/debugging activated. My /var/log/messages is growing rapidly and I really would like to get rid of these messages. I used your supplied config file for kernel 2.6.21-git-r2. I tried to find which kernel option is responsible for this with no success. I deactivated all the kernel hacking related stuff, as I probably do not need it. I realized that this decreased the kernel size dramatically from about 50MB (I don't remember the exact size, but I think it was around 50MB) to about 8MB! I guess this will free up some memory for applications though and I will leave it that way for now.

2. I cannot reboot successfully. When I enter "reboot" and the command prompt as root, the reboot starts and almost finishes. But it stops at the step saying "remounting remaining filesystems readonly". After that nothing more happens and I have to switch my PS3 off by pressing the power button for 10sec. Anyone else seeing this behaviour? The reboot is almost at the end and all the filesystems are unmounted already, so I do not get any bad filesystems. But still it would be good to have a complete reboot. Any insight?

Thanks!
Back to top
View user's profile Send private message
garlicbread
Apprentice
Apprentice


Joined: 06 Mar 2004
Posts: 182

PostPosted: Fri May 18, 2007 3:44 pm    Post subject: Reply with quote

I've been having the same problems myself
there have been a lot of fixes in the git tree to do with reset etc since that release
the latest version is now 2.6.22-rc1, when i get back tonight I'll update the overlay which will add in squashfs support, and then see if it works okay
hopefully this won't have the same problems but will have wireless support

the bit about powerpc64 / kgcc64 is probably relevant if your compiling a 32bit kernel on a 32bit system
I must admit I've not tried this as I'm using a 64bit kernel on a 64bit system which just uses the normal make / make menuconfig as usual
I'm thinking that for some reason if you've got a 32bit system you must need a 64bit cross-compiler to still compile the 32bit kernel (even though it's 32bit instead of 64bit)

another quick note, I think the Joystick support isn't enabled in the default config, which means if you want /dev/input/js0 to show up you'll need to amend the config's anyway
normally
Code:
make ps3_defconfig

is the same as
Code:
cp arch/powerpc/configs/ps3_defconfig .config

.config is the file used by the kernel so you can just manually edit it with vim if needs be or overwrite it with another file from somewhere else
I've attached some modified configs in the files directory of the git overlay which are the ones I'm using at the moment, to use these just cp them across to .config
Back to top
View user's profile Send private message
Crymson
Apprentice
Apprentice


Joined: 21 Mar 2004
Posts: 203
Location: New England

PostPosted: Fri May 18, 2007 9:00 pm    Post subject: Reply with quote

I can't use make menuconfig for the kernel because my TV is too small, so I have to use the regular command line - however, I'd like to use the defconfig for a good starting point. Which entry is there deals with joystick support exactly? It'd be nice to know where to go, rather than sort through lots of lines in vim to try and find it.
_________________
Knowledge is Power // Power Corrupts // Study Hard // Be Evil
Back to top
View user's profile Send private message
garlicbread
Apprentice
Apprentice


Joined: 06 Mar 2004
Posts: 182

PostPosted: Sat May 19, 2007 12:15 am    Post subject: Reply with quote

I've just updated / unmasked 2.6.22-rc1
I tried using a snapshot from the 15th to begin with but that had similar problems
I've just downloaded a more recent snapshot (18th today) and it seems to fix the problems over rebooting / halting
I've just submitted it to the Mariokart test (X video / alsa / BT conntroller) and no probs so far

EDIT /dev/loop support works okay but is no longer automatic (used if your generating an initramfs image)
I had to manually create the device nodes for it to work
I think something on the userspace end needs to be updated somewhere

the last problem to look into is all the logging of the hard disk activity
I'm pretty sure it's just a setting somewhere for the reporting of kernel debugging info
failing that I could just comment out the calls in the src
another option maybe to switch across from the new disk driver to the old disk driver (there now appears to be options for both, but the new one is picked by default)

you'll just need to do "layman -S" to update the overlay etc


aeyeaws wrote:
i think the kernels are 64 bit only, even with 32 bit userland
the 32 bit userland works noticeably better


that's curious can you tell me what's better in 32bit userland than 64bit userland?
experiences with amd64 tells me that there are some apps that need special patching sometimes to compile under 64bit
but so far I've not run into any show-stoppers
(also I wanted to try out the SPU's and I think spufs only shows up for 64bit)

I think I'll setup a 32bit environment over a network share just to see if there are any probs compiling
the only thing I did spot in the source was a reference to incompatibilities with kexec 32bit with the current build
arch/powerpc/platforms/ps3/system-bus-rework.txt
but I'm not sure if that refers to the kernel making the call (otheros.bld) or the kernel being called
Back to top
View user's profile Send private message
garlicbread
Apprentice
Apprentice


Joined: 06 Mar 2004
Posts: 182

PostPosted: Sat May 19, 2007 12:41 pm    Post subject: Reply with quote

Crymson wrote:
I can't use make menuconfig for the kernel because my TV is too small, so I have to use the regular command line - however, I'd like to use the defconfig for a good starting point. Which entry is there deals with joystick support exactly? It'd be nice to know where to go, rather than sort through lots of lines in vim to try and find it.

an easier way would be to get ssh running on the PS3 box
Code:
/etc/init.d/sshd start

then log into it via another PC
Code:
ssh -l root <ip of PS3 box>

so you can see what you're doing using the PC monitor (instead of a TV output)
it's also posible to use one of those VGA cables that was used for the PS2 via the AV connector
this way you can get dual display via HDMI (TV) and VGA (monitor) at the same time

the menu entries I've enabled in config-2.6.22-ps3-rc1
are:
CONFIG_INPUT_JOYDEV=y
CONFIG_INPUT_JOYSTICK=y

Quote:
could someone plz post the git command to grab last version

it took me a while to figure out the git thing
I wasn't sure if to post this as it might encourage a hefty load on www.kernel.org if lots of people are downloading 160Mb git trees

create a new directory to put the git repo and cd inside
Code:
mkdir ps3-linux-git-tree && cd ps3-linux-git-tree

to create the initial git repo
Code:
git-clone --bare git://git.kernel.org/pub/scm/linux/kernel/git/geoff/ps3-linux.git ps3-linux

then before doing the below make sure your inside the ps3-linux directory
Code:
ps3-linux

to update
Code:
git-pull && git-fetch

to create a tar.bz2 of the src at Head level
Code:
git-archive --format=tar --prefix=linux-ps3/ HEAD | bzip2 >head-1.tar.bz2

if you want a diff against the main kernel tree it's just a case of diffing one against the other using diff -Naur
it's possible to replace HEAD with one of the tags, but the latest tag only goes as far as 2.6.20 or so and don't include full code for the hardware
if you want to get an earlier release from Head
Code:
git-diff -p master 0cd74f398a1b86eab9d56224f3469235b2097e3c >1.patch

will generate a reverse patch that can be applied to the src inside head-1.tar.bz2 to take it back in time
the magic number is just a special commit number which can be looked up by clicking on the commit button on the web interface

http://git.kernel.org/?p=linux/kernel/git/geoff/ps3-linux-patches.git;a=summary
Back to top
View user's profile Send private message
garlicbread
Apprentice
Apprentice


Joined: 06 Mar 2004
Posts: 182

PostPosted: Sat May 19, 2007 4:32 pm    Post subject: Reply with quote

Just updated with a minor patch to get rid of most of those debug messages that were showing up under dmesg
it seems to crash on the odd ocation on reboot, but no-where as near as much as before
on the plus side I no longer have to reset hci0 after bootup to get the joystick working via BT, it seems to pick it up first time
Back to top
View user's profile Send private message
Xenomancer
n00b
n00b


Joined: 05 May 2006
Posts: 10
Location: Florida

PostPosted: Mon May 21, 2007 3:04 am    Post subject: Manifest Reply with quote

I'm having issues when I try emerging after sync'ing with Layman. on SNES9x and bluez-utils both come back with messages saying that the respective .ebuild files are not listed in the Manifest.

what am I doing wrong?

I've considered just deleting them from portage and trying to drop them in manually from the zip, but i'm not sure I'm ready to take that step lol.

I started this attempt on Saturday the 20th after 7:00pm EST
Back to top
View user's profile Send private message
garlicbread
Apprentice
Apprentice


Joined: 06 Mar 2004
Posts: 182

PostPosted: Mon May 21, 2007 5:59 pm    Post subject: Re: Manifest Reply with quote

Xenomancer wrote:
I'm having issues when I try emerging after sync'ing with Layman. on SNES9x and bluez-utils both come back with messages saying that the respective .ebuild files are not listed in the Manifest.

what am I doing wrong?

I've considered just deleting them from portage and trying to drop them in manually from the zip, but i'm not sure I'm ready to take that step lol.

I started this attempt on Saturday the 20th after 7:00pm EST


when setting up layman did you add a line to /etc/make.conf
Code:
source /usr/portage/local/layman/make.conf

this sounds like the most likley answer

failing that
1. redo "layman -S" the last change I made was on the 19th but just to be sure
2. empty out the temporary directory /usr/portage/distfiles
3. the default setup for layman means that the ebuilds should be located under /usr/portage/local/layman/garlicbread-ps3-overlay/
you can re-generate the digest for the ebuild with
Code:
ebuild xxx.ebuild digest

(but you shouldn't need to do that since I've run this automatically anyway when editing the ebuilds)
Back to top
View user's profile Send private message
Xenomancer
n00b
n00b


Joined: 05 May 2006
Posts: 10
Location: Florida

PostPosted: Mon May 21, 2007 7:40 pm    Post subject: Reply with quote

Thanks ^^ that got me going. Hopefully I won't have any other issues after I emerge the sources.
Back to top
View user's profile Send private message
garlicbread
Apprentice
Apprentice


Joined: 06 Mar 2004
Posts: 182

PostPosted: Mon May 21, 2007 9:58 pm    Post subject: Reply with quote

Just as a warning, the sources we're using here for the kernel are bleeding edge
so far I've not seen any problems, and everything seems hunky dory
however there's always the risk of filesystem corruption or something horrible going on in the background that we're not aware of

the Cell sources that came with the Cell CD 2.0 may be better tested / stable (these are under the ps3-cell-sources)
However looking at the readme it looks as if 2.6.20-cell doesn't have as good as support as 2.6.16-cell for wireless at the moment
also I've not added in any of the other patches such as UDF / squashfs / bluetooth etc, but you could always add these in manually yourselves after the emerge
Back to top
View user's profile Send private message
Xenomancer
n00b
n00b


Joined: 05 May 2006
Posts: 10
Location: Florida

PostPosted: Mon May 21, 2007 10:24 pm    Post subject: Reply with quote

-.^ Thanks already way ahead of you. Don't suppose you know if the Bluetooth BluRay remote is working with the current patch work do you? Was thinking of building a Media Center Desktop using it.
Back to top
View user's profile Send private message
smokerbag
n00b
n00b


Joined: 19 Mar 2007
Posts: 7

PostPosted: Tue May 22, 2007 5:51 am    Post subject: Reply with quote

Xenomancer wrote:
-.^ Thanks already way ahead of you. Don't suppose you know if the Bluetooth BluRay remote is working with the current patch work do you? Was thinking of building a Media Center Desktop using it.


Yes it does... I'm currently working on a input plugin for audacious and it seems to work pretty good!
Back to top
View user's profile Send private message
garlicbread
Apprentice
Apprentice


Joined: 06 Mar 2004
Posts: 182

PostPosted: Thu May 24, 2007 12:00 am    Post subject: Reply with quote

For info it looks as if the controller only works via BT at the moment
The code which sends a special code to the PS3 controller when connected via USB isn't working I think
js0 doesn't seem to respond when connected via USB, only via Bluetooth
code within drivers/hid/hid-core.c
has moved to
drivers/hid/usbhid/hid-quirks.c
drivers/hid/usbhid/hid-core.c
as part of 2.6.22
the PS3 specific stuff seems okay, so I think it's something to do with the HID Quirks not applying properly
unless I've got a config option set wrong somewhere


Also I've managed to get the remote working via BT
I think some here are already aware of this but I just figured I'd post it for info
the demo script can be picked up from here
http://ps3mods.blogspot.com/2007/03/bd-remote-for-linux-update.html

when you press the sync button on the controller this will create a /dev/event entry
however evtest doesn't show up any info, I think it has something to do with the size of the data packets

I've found that there are 2 ways for the remote to connect via BT
1. the remote itself initiates the connection when the Playstation / sync button is pressed (same as the controller)
this creates a connection from the remote to the running hidd service
Code:
hcitool con # show the active connections / addresses etc
hcitool dc <address of controller>  # break the connection with the controller


2. the PS3 / Host can initiate the connection to the Remote control
However in order for this to take place the remote must accept the connection by someone pressing start / Enter on the keypad at the same time
when connecting

the Python script doesn't use an already existing connection and has to use the second method to connect
to create it's own connection (less convenient at the moment)
hopefully we can change this later on, so that all we have to do is hit the sync button on the remote to connect to the running hidd service
but I think that will mean a further patch to bluez-utils

but in order to get the script to work at the moment
1. first emerge pybluez, I've added this to the overlay just to add in the missing ppc64 keyword
2. edit the remote-version0.1.py file
near the bottom there should be an entry for w=Ps3mote("<address of controller>",0)
you need to fill in the address of your remote here
when you try to sync from the remote using the sync button, an address should show up in /var/log/messages which can be used
3. make sure there's no active connection to the remote
ether use "hcitool dc" or just do
Code:
hciconfig hci0 down
hciconfig hci0 up

to be sure
4. run the script (you may need to chmod +x remote-version0.1.py to run it)
at this point when it says "Attempting to pair with remote"
you need to hit Start / Enter on the remote at the same time for a while

5. hit a button on the remote and see what comes up
Back to top
View user's profile Send private message
nickthecook
n00b
n00b


Joined: 13 Sep 2006
Posts: 12

PostPosted: Thu May 24, 2007 12:16 pm    Post subject: Some 2.6.22 instability Reply with quote

Garlicbread - thanks for all your work!

I used the instructions at the beginning of this thread to compile and install the sys-kernel/ps3-git-sources-2.6.22_rc1 kernel from your overlay, and I've got wireless working, as well as the controller via bluetooth, and let me say it is very nice to have the wifi support. I'm happy and grateful, and this post should in no way be interpreted as a complaint! I just thought I'd see if anyone else was having problems similar to mine: the new kernel (2.6.22_rc1) seems a bit unstable.

To configure the kernel I used arch/powerpc/configs/ps3_defconfig. I compiled, installed, modified kboot.conf and fstab for the new disk name, and rebooted. I then realized I didn't have joystick support, and compiled the joystick module and loaded it.

The wifi came up no problem, and when I tried out bluetooth with the controller, it at first worked as it had before. But later, when I would try to run hidd, it said that it couyldn't open the port, or something similar. I found a running hidd process that didn't seem to be doing the job (I couldn't connect to the controller) so I killed it, restarted it, and that worked.

About 10 minutes later, while I was emerging something, playing music, and messing with my XFCE theme, my system crashed. X died, leaving me with a black screen, and when I went back to tty1 there was a series of errors from X, and even from bash (I ran startxfce4 from the command prompt). There was no prompt, and the ol' three-finger salute didn't work. I could switch vts with my keyboard (e.g. CTRL+ALT+F[0-8]) with the keyboard, but that was it. The login prompts on all ttys except 1, where I had logged in, were '?' characters with white backgrounds. Very odd. I held the power button on the PS3 until I heard the beep and the green LED started flashing, but the system never shut down, or printed a message about shutting down, or gave any indication whatsoever that the button had been pressed. (In fact, since I upgraded the kernel, even when I shut the system down gracefully, it hangs after the messages about remounting filesystems read-only.)

This type of crash has happened to me three times since then: twice while emerging mono (I use F-Spot) and once while emerging something else. Also, once I just had a terminal window and a browser open, and they both crashed at exactly the same time, but the system didn't go down as it had previously.

I can give you more details on the output of the X server when the first crash occurred if you're interested.

Thanks again for all the work, Garlicbread!

So, has anyone else seen behaviour like this from the new kernel?
Back to top
View user's profile Send private message
garlicbread
Apprentice
Apprentice


Joined: 06 Mar 2004
Posts: 182

PostPosted: Thu May 24, 2007 3:59 pm    Post subject: Reply with quote

something to note, when you want to force the power off hold down the power button, it will beep once and the green light will start to flash, still keep holding it down for longer, it will beep a second time then turn off / go red

the hidd daemon is normally run as part of the /etc/init.d/bluetooth script
assuming that /etc/conf.d/bluetooth has been setup correctly (hidd enabled see post above about --nocheck etc)
you should be able to connect the controller to the PS3 after bootup just by hitting the sync button on the controller
(/dev/input/js0 should magically appear)

I've noticed the odd crash when rebooting or halting myself
but nothing during the running of X or emerge so far
however I'm using a slightly different config from the default, I've put a copy in the files directory of the overlay but I'm not sure this would make much difference

2.6.21-r1 may be a bit more stable but lacks wireless
the only other option may be the cell sources, which I've set an ebuild up for (but never tried)
I've not done any patches myself in terms of stability (just mostly adding bits on from other sites for the support of UDF / turning off debugging etc)

if it's a problem with the storage controller, I think there is an option to turn off the new / current storage controller under the Platform->Sony PS3 heading, and instead enable the old storage controller under Device drivers->Block devices (make menuconfig is your freind)
(something I've not tried)

failing that all I can do at the moment is just wait for the PS3 git tree to be updated with further patches etc
http://git.kernel.org/?p=linux/kernel/git/geoff/ps3-linux.git;a=summary
and see what happens
probably our best bet is just to wait for a stable release of 2.6.22, that way we'll be using something based on a stable release of the main kernel tree instead of a release candidate
(personally I'm hoping something will turn up for the RSX via the hypervisor)
Back to top
View user's profile Send private message
baygins
n00b
n00b


Joined: 01 Aug 2006
Posts: 29

PostPosted: Thu May 24, 2007 6:23 pm    Post subject: Reply with quote

I followed garlicbread's instructions to the letter to get a 2.6.22-rc1 kernel via a proper layman overlay. I also modified the top-level Makefile so that "CROSS_COMPILE ?= powerpc64-unknown-linux-gnu-". I am using a 64bit kernel/32bit UL based on the XFCE4 based Gentoo 2007.0 install CD and stage4-970-ps3_32ul.tar.bz2. I also used the ps3_defconfig under /usr/src/linux/arch/powerpc/configs
When I execute
Code:
make menuconfig
the compilation goes through, with some warnings in the middle (nothing that looks scary) and then I get this big chunk at the end (is there something fatally wrong in this kernel):
Code:
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:sysfs_cpu_nb from .toc before 'fpzero' (at offset -0xa48)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:dt_root_size_cells from .toc between 'fphalf' (at offset 0xec8) and 'PPC64_CACHES'
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:dt_root_addr_cells from .toc between 'fphalf' (at offset 0xed0) and 'PPC64_CACHES'
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:iommu_is_off from .toc between 'fphalf' (at offset 0xef0) and 'PPC64_CACHES'
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:iommu_force_on from .toc between 'fphalf' (at offset 0xf00) and 'PPC64_CACHES'
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:feature_properties from .toc between 'fphalf' (at offset 0xfa8) and 'PPC64_CACHES'
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data: from .toc between 'fphalf' (at offset 0xfb8) and 'PPC64_CACHES'
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:ibm_pa_features from .toc between 'fphalf' (at offset 0xfc8) and 'PPC64_CACHES'
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:dt_string_start from .toc after 'PPC64_CACHES' (at offset 0x1558)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:dt_string_end from .toc after 'PPC64_CACHES' (at offset 0x1560)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:prom_entry from .toc after 'PPC64_CACHES' (at offset 0x1568)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:prom from .toc after 'PPC64_CACHES' (at offset 0x15a0)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:of_platform from .toc after 'PPC64_CACHES' (at offset 0x15c0)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:mem_reserve_cnt from .toc after 'PPC64_CACHES' (at offset 0x15d0)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:mem_reserve_map from .toc after 'PPC64_CACHES' (at offset 0x15e0)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:ram_top from .toc after 'PPC64_CACHES' (at offset 0x15e8)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:alloc_top_high from .toc after 'PPC64_CACHES' (at offset 0x15f8)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:alloc_bottom from .toc after 'PPC64_CACHES' (at offset 0x1600)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:rmo_top from .toc after 'PPC64_CACHES' (at offset 0x1608)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:alloc_top from .toc after 'PPC64_CACHES' (at offset 0x1610)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:prom_scratch from .toc after 'PPC64_CACHES' (at offset 0x1650)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:prom_iommu_off from .toc after 'PPC64_CACHES' (at offset 0x1720)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:prom_tce_alloc_start from .toc after 'PPC64_CACHES' (at offset 0x17d0)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:prom_tce_alloc_end from .toc after 'PPC64_CACHES' (at offset 0x17d8)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:regbuf from .toc after 'PPC64_CACHES' (at offset 0x17f8)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:prom_initrd_start from .toc after 'PPC64_CACHES' (at offset 0x1810)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:prom_initrd_end from .toc after 'PPC64_CACHES' (at offset 0x1818)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:prom_cmd_line from .toc after 'PPC64_CACHES' (at offset 0x1850)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:prom_iommu_force_on from .toc after 'PPC64_CACHES' (at offset 0x1888)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:dt_header_start from .toc after 'PPC64_CACHES' (at offset 0x18a0)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:dt_struct_start from .toc after 'PPC64_CACHES' (at offset 0x18b0)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:dt_struct_end from .toc after 'PPC64_CACHES' (at offset 0x18c0)
WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:of_stdout_device from .toc after 'PPC64_CACHES' (at offset 0x1910)
WARNING: mm/built-in.o - Section mismatch: reference to .init.text:.__alloc_bootmem_node from .text between '.zone_wait_table_init' (at offset 0x5f10) and '.init_currently_empty_zone'
WARNING: mm/built-in.o - Section mismatch: reference to .init.text:.__alloc_bootmem_node from .text between '.sparse_index_alloc' (at offset 0x20ae0) and '.sparse_index_init'
WARNING: mm/built-in.o - Section mismatch: reference to .init.text:.set_up_list3s from .text between '.kmem_cache_create' (at offset 0x27a14) and '.kmem_cache_shrink'
WARNING: mm/built-in.o - Section mismatch: reference to .init.text:.set_up_list3s from .text between '.kmem_cache_create' (at offset 0x27a5c) and '.kmem_cache_shrink'


  • Is the resultant kernel trustable?
  • Even though I selected NTFS as a loadable (M)odule, I don't see it getting built. Why is it being ignored?
Back to top
View user's profile Send private message
baygins
n00b
n00b


Joined: 01 Aug 2006
Posts: 29

PostPosted: Thu May 24, 2007 7:22 pm    Post subject: Reply with quote

I also noticed that /dev/loop was not being created in this 2.6.22-rc1-ps3 setup. What is the proper way to create this device file?
Back to top
View user's profile Send private message
garlicbread
Apprentice
Apprentice


Joined: 06 Mar 2004
Posts: 182

PostPosted: Thu May 24, 2007 9:02 pm    Post subject: Reply with quote

they've moved to some sort of dynamic device node created on demand type setup
I'm guessing that udev / losetup currently lack support for this which is the reason why it doesn't show up automatically
to get it to work I had to manually create the device nodes

I've already posted this in another thread but I had to do this manually
Code:
mknod /dev/loop0 b 7 0
mkdir -p /dev/mapper
mknod /dev/mapper/control c 10 63

to get it to work

I'm wondering if it would be worth trying to port the wireless driver to a more stable 2.6.21 release at this point
I might look into that next
Back to top
View user's profile Send private message
baygins
n00b
n00b


Joined: 01 Aug 2006
Posts: 29

PostPosted: Fri May 25, 2007 3:50 am    Post subject: Reply with quote

garlicbread wrote:
they've moved to some sort of dynamic device node created on demand type setup
I'm guessing that udev / losetup currently lack support for this which is the reason why it doesn't show up automatically
to get it to work I had to manually create the device nodes

I've already posted this in another thread but I had to do this manually
Code:
mknod /dev/loop0 b 7 0
mkdir -p /dev/mapper
mknod /dev/mapper/control c 10 63

to get it to work

I'm wondering if it would be worth trying to port the wireless driver to a more stable 2.6.21 release at this point
I might look into that next

Thanks for the instructions; they have been very helpful. In the mean time, I have been in touch with geoff on #gentoo-ppc64 channel on IRC. He recommended using his latest git clone for kernel sources instead of an overlay or a git --bare install.
This seemed to have taken care of some issues related to the built-in.o compilation WARNINGs.
Also, I removed all the overlays, since I (apparently) needed a newer/better version of dtc to compile the kernel successfully with the latest git sources. This one took care of problems encountered at the very end when make strips the kernel image of off its debug symbols.
So, in short, the way to get the latest and greatest for the PS3 kernel according to the gurus (geoff, I cannot thank you enough for your patience and guidance here!):

  • Prepare the build environment and directories
    Code:
    cd; mkdir ps3-linux; cd ps3-linux-git-tree

  • Download a clone of geoff's PS3 Linux 2.6.22-rc2 kernel sources
    Code:
    git clone http://www.kernel.org/pub/scm/linux/kernel/git/geoff/ps3-linux.git

  • Edit the top level Makefile in ./ps3-linux-git-tree/ps3-linux for 64-bit cross compiling (I found this to be a better solution then the previously mentioned alias method)
    Code:
    vim ps3-linux/Makefile
    CROSS_COMPILE   ?= powerpc64-unknown-linux-gnu-

  • Download a clone of Device Tree Compiler code; compile it and install it under /usr/local/bin (or somewhere else in your $PATH)
    Code:
    git clone git://www.jdl.com/software/dtc.git
    cd dtc; make
    cp dtc /usr/loca/bin/
    cd ..

  • Make the ps3-linux kernel from sources
    Code:
    cd ps3-linux; make

  • Copy the resultant kernel image (stripped off its debug symbols) to the /boot directory
    Code:
    cp vmlinux.stripped /boot/kernel-2.6.22-rc2-ps3 (or whatever you want to call it)

  • Modify /etc/kboot.conf file to use the newly compiled kernel
    Code:
    vim /etc/kboot.conf (to create/modify a new/existing entry to point to the newly installed kernel)

  • Reboot and Enjoy!
    Code:
    reboot


If you want to make sure that your new kernel source lives under its proper location, you can create an appropriate directory under /usr/src/ and place your source tree there (assuming you are continuing from right before the reboot step):
Code:
mkdir /usr/src/linux-2.6.22-rc2-ps3
cp -R * /usr/src/linux-2.6.22-rc2-ps3/
cp -R .* /usr/src/linux-2.6.22-rc2-ps3/
("-R" option was added based on feedback from Crymson)

I have compiled and booted with this setup; and it is working fine at the moment. I have not tried X or other advanced applications, so your mileage may most probably vary. If you see any glaring mistakes, please _do_ copy and _modify_ the instructions as you see fit :-)


Last edited by baygins on Sat May 26, 2007 8:36 pm; edited 2 times in total
Back to top
View user's profile Send private message
Crymson
Apprentice
Apprentice


Joined: 21 Mar 2004
Posts: 203
Location: New England

PostPosted: Sat May 26, 2007 8:21 am    Post subject: Reply with quote

The only thing I'd add to the above is to make sure and run make menuconfig first if you want to change any of the default kernel options (like joystick support) otherwise it won't be built in.

I did have some problems with the steps above.

1. Near the end of "make" I encountered an error where "coff.o" couldn't be found. It seemed to keep going, and I did end up with a vmlinux file.

2. The vmlinux files were gz'd by default.

3. You can't cp the source, unless you use the -R switch to go recursively, otherwise it skips all the directories.

Thanks again everyone for all your work on this.
_________________
Knowledge is Power // Power Corrupts // Study Hard // Be Evil
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 2 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum