特殊:Badtitle/NS100:Xbox360Controller
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/Xbox360Controller }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/af | • {{#if: UbuntuHelp:Xbox360Controller|Afrikaans| [[::Xbox360Controller/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/ar | • {{#if: UbuntuHelp:Xbox360Controller|العربية| [[::Xbox360Controller/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/az | • {{#if: UbuntuHelp:Xbox360Controller|azərbaycanca| [[::Xbox360Controller/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/bcc | • {{#if: UbuntuHelp:Xbox360Controller|جهلسری بلوچی| [[::Xbox360Controller/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/bg | • {{#if: UbuntuHelp:Xbox360Controller|български| [[::Xbox360Controller/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/br | • {{#if: UbuntuHelp:Xbox360Controller|brezhoneg| [[::Xbox360Controller/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/ca | • {{#if: UbuntuHelp:Xbox360Controller|català| [[::Xbox360Controller/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/cs | • {{#if: UbuntuHelp:Xbox360Controller|čeština| [[::Xbox360Controller/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/de | • {{#if: UbuntuHelp:Xbox360Controller|Deutsch| [[::Xbox360Controller/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/el | • {{#if: UbuntuHelp:Xbox360Controller|Ελληνικά| [[::Xbox360Controller/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/es | • {{#if: UbuntuHelp:Xbox360Controller|español| [[::Xbox360Controller/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/fa | • {{#if: UbuntuHelp:Xbox360Controller|فارسی| [[::Xbox360Controller/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/fi | • {{#if: UbuntuHelp:Xbox360Controller|suomi| [[::Xbox360Controller/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/fr | • {{#if: UbuntuHelp:Xbox360Controller|français| [[::Xbox360Controller/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/gu | • {{#if: UbuntuHelp:Xbox360Controller|ગુજરાતી| [[::Xbox360Controller/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/he | • {{#if: UbuntuHelp:Xbox360Controller|עברית| [[::Xbox360Controller/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/hu | • {{#if: UbuntuHelp:Xbox360Controller|magyar| [[::Xbox360Controller/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/id | • {{#if: UbuntuHelp:Xbox360Controller|Bahasa Indonesia| [[::Xbox360Controller/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/it | • {{#if: UbuntuHelp:Xbox360Controller|italiano| [[::Xbox360Controller/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/ja | • {{#if: UbuntuHelp:Xbox360Controller|日本語| [[::Xbox360Controller/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/ko | • {{#if: UbuntuHelp:Xbox360Controller|한국어| [[::Xbox360Controller/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/ksh | • {{#if: UbuntuHelp:Xbox360Controller|Ripoarisch| [[::Xbox360Controller/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/mr | • {{#if: UbuntuHelp:Xbox360Controller|मराठी| [[::Xbox360Controller/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/ms | • {{#if: UbuntuHelp:Xbox360Controller|Bahasa Melayu| [[::Xbox360Controller/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/nl | • {{#if: UbuntuHelp:Xbox360Controller|Nederlands| [[::Xbox360Controller/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/no | • {{#if: UbuntuHelp:Xbox360Controller|norsk| [[::Xbox360Controller/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/oc | • {{#if: UbuntuHelp:Xbox360Controller|occitan| [[::Xbox360Controller/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/pl | • {{#if: UbuntuHelp:Xbox360Controller|polski| [[::Xbox360Controller/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/pt | • {{#if: UbuntuHelp:Xbox360Controller|português| [[::Xbox360Controller/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/ro | • {{#if: UbuntuHelp:Xbox360Controller|română| [[::Xbox360Controller/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/ru | • {{#if: UbuntuHelp:Xbox360Controller|русский| [[::Xbox360Controller/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/si | • {{#if: UbuntuHelp:Xbox360Controller|සිංහල| [[::Xbox360Controller/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/sq | • {{#if: UbuntuHelp:Xbox360Controller|shqip| [[::Xbox360Controller/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/sr | • {{#if: UbuntuHelp:Xbox360Controller|српски / srpski| [[::Xbox360Controller/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/sv | • {{#if: UbuntuHelp:Xbox360Controller|svenska| [[::Xbox360Controller/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/th | • {{#if: UbuntuHelp:Xbox360Controller|ไทย| [[::Xbox360Controller/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/tr | • {{#if: UbuntuHelp:Xbox360Controller|Türkçe| [[::Xbox360Controller/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/vi | • {{#if: UbuntuHelp:Xbox360Controller|Tiếng Việt| [[::Xbox360Controller/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/yue | • {{#if: UbuntuHelp:Xbox360Controller|粵語| [[::Xbox360Controller/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/zh | • {{#if: UbuntuHelp:Xbox360Controller|中文| [[::Xbox360Controller/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/zh-hans | • {{#if: UbuntuHelp:Xbox360Controller|中文(简体)| [[::Xbox360Controller/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Xbox360Controller | UbuntuHelp:Xbox360Controller | {{#if: | :}}Xbox360Controller}}/zh-hant | • {{#if: UbuntuHelp:Xbox360Controller|中文(繁體)| [[::Xbox360Controller/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:Xbox360Controller|:Xbox360Controller|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :Xbox360Controller/zh | | {{#ifexist: Xbox360Controller/zh | | {{#ifeq: {{#titleparts:Xbox360Controller|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Xbox360Controller|1|-1|}} | zh | | }}
- title Install and configure Microsoft® Xbox™ and Xbox 360™ controllers under Ubuntu 7.10
Introduction
<<Anchor(Introduction)>> This HOWTO deals with the installation and configuration of Microsoft® Xbox 360™ controllers; both the USB and wireless. The older Xbox™ controllers should be supported out of the box, but if you are experiencing problems you might want to check out the [[UbuntuHelp:[Troubleshooting|Testing and Troubleshooting]]] section. It should be noted that this HOWTO only deals with the regular Xbox™ and Xbox 360™ controller. Other controllers, peripherals and modules are not dealt with and may or may not work. This HOWTO is written for Ubuntu 7.10, although it should apply, with a few modifications, to both older and newer versions. The HOWTO is an adaptation of a similar HOWTO for Gentoo Linux, with some general suggestions from various posts on the Ubuntu Forums. Although the steps taken in this HOWTO works for me, I make no guarantee as to the outcome and consequences from following this HOWTO. Use at your own risk.
The (old) Xbox™ Controller
<<Anchor(OldController)>> When dealing with the older Xbox™ controllers, all you need to do is to make, or obtain, a USB adapter and plug it in; driver support for the older controllers should already be installed and active. If the controller doesn't respond, see the [[UbuntuHelp:[Troubleshooting|Testing and Troubleshooting]]] section.
Before you begin
<<Anchor(PreInstall)>> Before you begin I would like to point out that the Xbox 360™ does not use Bluetooth® for its wireless communication. If you have a wireless controller, you need to get an Xbox 360™ Wireless Gaming Receiver for Windows®. Don't worry, it works under Linux too, although there are a few [[UbuntuHelp:[WirelessIssues|quirks]]]. All you need to do is to plug it in, as you would under Windows®, and it should behave similarly to the USB controller.
Updating the drivers
<<Anchor(UpdateDrivers)>> Experimental support for the Xbox 360™ controller does exist. And although it is fairly stable and fully usable, the xpad driver included in most kernels only support the old Xbox™ controller. If you want to use your Xbox 360™ controller, you will have to install the development drivers. Since there is no package for it at the time of writing, you will have to compile and install the module yourself.
Installing required packages
<<Anchor(InstallPackages)>> In order to compile and install the new drivers, you will need a few packages. The following command will install them for you:
sudo apt-get install linux-headers-`uname -r` build-essential automake1.9
Although it isn't required, you may want additional packages in order to calibrate the controller
sudo apt-get install jscalibrator libgii1 libjsw2
You may, of course, use any package manager you like. Just make sure you install the linux-headers version that corresponds to your current kernel.
Downloading and preparing the drivers
<<Anchor(FetchDrivers)>> You will need a directory for the files. The name of the directory doesn't matter, as long as it's empty and you have write permissions to it.
cd mkdir xpad
The above will change directory to your home directory and create the subdirectory "xpad". Now, go to the newly created directory and download the files:
cd xpad wget "http://xbox-linux.cvs.sourceforge.net/*checkout*/xbox-linux/kernel-2.6/drivers/usb/input/xpad.c" "http://xbox-linux.cvs.sourceforge.net/*checkout*/xbox-linux/kernel-2.6/drivers/usb/input/xpad.h"
Creating the Makefile
<<Anchor(Makefile)>> In your working directory ("xpad"), copy and paste the following to a file called "Makefile", using your favourite editor. Make sure the tabs under "all:" and "install:" remain intact.
KERNEL_PATH?=/usr/src/linux-headers-$(shell uname -r) EXTRA_CFLAGS=-I$(shell pwd) obj-m:=xpad.o all: $(MAKE) modules -C $(KERNEL_PATH) SUBDIRS=$(shell pwd) install: cp -f xpad.ko /lib/modules/$(shell uname -r)/kernel/drivers/input/joystick
This should find your current header files, build the new xpad drivers using the recently downloaded source code as a module, and install the module to the appropriate directory.
Compiling and installing the drivers
<<Anchor(Compile)>> Assuming your current directory is your working directory ("xpad"), all you need to do is to execute the following commands:
make sudo make install sudo modprobe -r xpad sudo depmod -a sudo modprobe xpad
This will compile the module, install it, remove the old one, and load the new one. If the process return errors, you probably missed a step. Otherwise, check the [[UbuntuHelp:[Troubleshooting|Testing and Troubleshooting]]] section.
Testing and Troubleshooting
<<Anchor(Troubleshooting)>> By now your new module should be installed and ready for use. Connect the controller and type "dmesg" in a terminal. If you see something like "Microsoft Xbox 360 Wireless Controller (PC)...", then the new drivers are supposedly working. If you installed jscalibrator, you can use it to test and calibrate your controller.
Known issues with Wireless controllers
<<Anchor(WirelessIssues)>> Support for wireless controllers are still experimental. And although the controllers work, the following issues exist:
- The LED indicator on the controller continues to blink even after the controller has been connected.
- There is no way to turn the controller off, save removing the batteries.
- Some programs may require that you resync the controller after starting them in order for the controller to work.
General issues and solutions
<<Anchor(GeneralIssues)>>
Controller doesn't respond
<<Anchor(NoWork)>>
- Make sure that the controller is plugged in and that the drivers are installed properly. The install directory mentioned in the Makefile has changed before; if the old modules are loaded when you run "sudo modprobe xpad", then xpad.ko should probably be copied elsewhere. If so, locate the old xpad.ko, and overwrite it with the xpad.ko generated from the compiled sources.
- If the "make" process failed, you are probably missing a file, or the tabs in the Makefile got converted to spaces.
- If you just installed the driver, you could try rebooting the system, as that should load all the needed modules. If that doesn't fix it, try reconnecting the controller. You could also try to run the modprobe commands mentioned under [[UbuntuHelp:[Compile|Compiling and installing the drivers]]] again.
- If you are using a Wireless Xbox 360™ controller, you may have to resync after starting the program that makes use of it.
Incorrectly mapped buttons
<<Anchor(IncorrectlyMapped)>> The Gentoo Linux HOWTO on the same subject mentions some fixes if you are having problems with incorrectly mapped buttons. Essentially, you need to figure out which button/axis is controlling what, and what they should be controlling. Then you need to move the corresponding variables around in the source code ("xpad.c") to match your setup, save, and repeat this HOWTO from the "Compiling and installing the drivers" section.