Manette PS3 avec RetroPie

[ TRADUCTION FR EN COURS]
en rouge : reste à traduire

Voici un tuto pour installer et configurer la manette PS3 bluetooth :
ce qu'il vous faut :

A partir d'une installation toute fraiche de Raspbian, nous allons effectuer quelques modifications.

A partir du raspi-config screen on doit :
  • Expand the filesystem to fill the SD card.
  • Change the memsplit to 128 or 192.
  • Changer le mot de passe pour l'utilisateur pi.
  • Overclocker le pi (optionnel mais risqué)
Une fois que cela a été fait et le Pi rebooté.
loguer vous et entrer les commandes suivantes :

sudo apt-get update
sudo apt-get upgrade -y

Maintenant on peut s'attaquer aux paramètres du RetroPie.

Primo, nous devons installer quelques petites choses :

sudo apt-get install git dialog -y

Ensuite télécharger et lancer le script de setup RetroPie :

git clone git://github.com/petrockblog/RetroPie-Setup.git
cd RetroPie-Setup/
chmod +x retropie_setup.sh
sudo ./retropie_setup.sh

Nous avons 2 choix possibles pour installer RetroPie - Binaries et Source.
Je préfère utiliser la Source alors on va partir sur cette option.

Nous pouvons choisir une installation personnalisé mais si vous voulez TOUT installer laisser comme tel. Si vous voulez ne pas tout installer il suffit de décocher.

Lancer l'install. Attendez 3-4 hours pour que RetroPie compile.

Une fois terminé, vous devez débuguer  
Once that is completed you'll have a debug output with any issues encountered (hopefully none).

Rebooter le Pi.

Vous avez maintenant RetroPie installé et vous pouvez la lancer avec :
emulationstation

Ce n'est pas fini. J'ai une manette PS3 et je veux l'utiliser avec EmulationStation et RetroArch en bluetooth.

Voici la méthode :

sudo apt-get install bluez-utils bluez-compat bluez-hcidump libusb-dev libbluetooth-dev joystick checkinstall -y

Patientez pendant l'installation.
Une fois terminée, le dongle bluetooth sera détecté (Ne pas utiliser un hub usb, le brancher directement sur le raspberry).
ensuite lancer la commande:
hciconfig

Vous devriez avoir quelque chose comme ceci s'affiché :

pi@raspberrypi ~ $ hciconfig
hci0: Type: BR/EDR Bus: USB
BD Address: 00:02:72:BF:BC:8F ACL MTU: 1022:8 SCO MTU: 121:3
UP RUNNING PSCAN
RX bytes:16777722 acl:289271 sco:0 events:116 errors:0
TX bytes:2561 acl:53 sco:0 commands:56 errors:0


The key thing we're looking for here is the UP RUNNING PSCAN. If it says DOWN - you've got an issue with your dongle's chipset - or as in my case you've plugged it into a USB hub.
Now we can pair the dongle with the controller using Sixpair.
wget http://www.pabr.org/sixlinux/sixpair.c
gcc -o sixpair sixpair.c -lusb

With your controller plugged in, run the following:
sudo ./sixpair
You'll get something similar to the following output:
Current Bluetooth master: 00:02:72:BF:BC:8F
Setting master bd_addr to: 00:02:72:BF:BC:8F

(Note: When you first run sixpair, the two addresses above will be different - mine are the same because I've already paired the dongle with the controller.)
Now we just need SixaD to manage the controller.
wget http://sourceforge.net/projects/qtsixa/files/QtSixA%201.5.1/QtSixA-1.5.1-src.tar.gz
tar xfvz QtSixA-1.5.1-src.tar.gz
cd QtSixA-1.5.1/sixad
make
sudo mkdir -p /var/lib/sixad/profiles
sudo checkinstall


I've used checkinstall here as it creates a Deb package to help you uninstall it later on. Just hit enter at the prompts and it'll install.
We'll need to start the sixad daemon at startup:
sudo update-rc.d sixad defaults
And start the service now:
sudo service sixad start
Now unplug the controller and press the PS button. You should see the lights go back and forth and it'll rumble for a second or two. Congrats - it works!

(NOTE: As of the latest Raspbian image (2012-02-22), your controller will probably keep flashing and not rumble. The controller has connected but isn't reading the SixaD profile correctly. You can continue to complete this guide but you'll need to create and use my controller configs manually. Looking into a fix for this.)
But we're not finished yet. We need to set up the controller to work inside EmulationStation and RetroArch.
First off let's create a sixad profile for the controller.
sudo nano /var/lib/sixad/profiles/default
Add the following content:
enable_leds 1
enable_joystick 1
enable_input 0
enable_remote 0
enable_rumble 1
enable_timeout 0
led_n_auto 1
led_n_number 1
led_anim 1
enable_buttons 1
enable_sbuttons 1
enable_axis 1
enable_accel 0
enable_accon 0
enable_speed 0
enable_pos 0
Now reboot with the following:
sudo reboot
Once you've logged in, press the PS button again on the controller. It should rumble like before.
This time we've disabled the motion controls as they have some screwy behaviour when setting up controllers in EmulationStation.
Now run emulationstation - you should get the option to configure you're controller.
When you've entered your controls and pressed a keyboard key to save, press F4 to exit emulationstation.
This will have written a file called es_input.cfg to ~/.emulationstation/
You can delete this file if you need to reconfigure your controller, or edit it to do it manually.

My es_input.cfg contains the following:

JOYNAME PLAYSTATION(R)3 Controller (00:24:33:62:62:5A)
BUTTON 0 8
BUTTON 3 7
BUTTON 4 1
BUTTON 5 4
BUTTON 6 2
BUTTON 7 3
BUTTON 10 10
BUTTON 11 9
BUTTON 13 5
BUTTON 14 6

(Note: If you are going to copy this file make sure you change the MAC address at the top. You can get your controllers MAC address using hciconfig after you've paired it.)

Now to configure RetroArch for the controller.
Run the following command:
retroarch-joyconfig >> ~/RetroPie/configs/all/retroarch.cfg
Configure your controls - this will append the configuration to the end of ~/RetroPie/configs/all/retroarch.cfg.
The end of my config file has the following:
input_player1_joypad_index = "0"
input_player1_a_btn = "13"
input_player1_b_btn = "14"
input_player1_x_btn = "12"
input_player1_y_btn = "15"
input_player1_l_btn = "10"
input_player1_r_btn = "11"
input_player1_l2_btn = "8"
input_player1_r2_btn = "9"
input_player1_l3_btn = "1"
input_player1_r3_btn = "2"
input_player1_start_btn = "3"
input_player1_select_btn = "0"
input_player1_left_btn = "7"
input_player1_up_btn = "4"
input_player1_right_btn = "5"
input_player1_down_btn = "6"
input_player1_l_x_plus_axis = "+0"
input_player1_l_y_plus_axis = "+1"
input_player1_l_x_minus_axis = "-0"
input_player1_l_y_minus_axis = "-1"
input_player1_r_x_plus_axis = "+2"
input_player1_r_y_plus_axis = "+3"
input_player1_r_x_minus_axis = "-2"
input_player1_r_x_minus_axis = "-3"
input_exit_emulator_btn = "16"
I added in the last line to exit the emulator using the PS button.
Now we're on the home stretch! We just need to add some roms in.
I copied mine from my PC with a USB pen.
The roms need to go in the following folder: /home/pi/RetroPie/roms
Each emulator has a separate folder. You can use startx if you find that easier to manage the files -but make sure you log out before running emulationstation.

Run emulationstation now and test some games out. All should be working fine!

Special thanks go to:
Florian - http://petrockblog.wordpress.com/retropie/
Themaister - http://themaister.net/retroarch.html
Aloshi - http://aloshi.com/emulationstation
falkTX - http://qtsixa.sourceforge.net/
Pabr - http://www.pabr.org/sixlinux/sixlinux.en.html
Stanislav Kopp - http://booting-rpi.blogspot.co.uk/

2 commentaires:

  1. When i enter "wget http://www.pabr.org/sixlinux/sixpair.c
    gcc -o sixpair sixpair.c -lusb" i got a invalid number*usb*".....thank you

    RépondreSupprimer
  2. When i enter "wget http://www.pabr.org/sixlinux/sixpair.c
    gcc -o sixpair sixpair.c -lusb" i got a invalid number*usb*".....thank you

    RépondreSupprimer

Le Raspberry Pi en rupture de stock à cause du coronavirus!

Si vous vous intéressez un peu au secteur de l’électronique, vous avez forcément remarqué ou entendu parler des ruptures de stock sur de no...