Автор Тема: Проблем с джойстик- изобщо не го намира  (Прочетена 2056 пъти)

Nik123

  • Напреднали
  • *****
  • Публикации: 4151
  • Distribution: Mageia, Q4OS
    • Профил
Здравейте! Имам джойстик, обикновен, с геймпорт- не ЮСБ, но мандривата не го намира, по-точно- изобщо не фигурира в списъка с хардуер в Мандрива контрол центъра. Под уиндоус си бачка нормално. Джойстика е Trust - Predator SV 85- обикновена китайска непретенциозна машинка, с два бутона и плъзгач за скорост(thtottle). Някой може ли да ми помогне да го подкарам и под Мандривата?
Системата ми в момента е мандрива 2006, гном 2.10, ядро 2.6.12-12. Утре по това време вече ще е ъпдейтната до 2007- sunna, но поне алгоритъма/драйвъра за самото подкарване на джойстика да ми се изясни- затова поствам, като за начало ще се радвам и под 2006 да го пусна. Разрових из нета, не намерих някакъв драйвър, а под уина си тръгва без драйвър
Активен

Nik123

  • Напреднали
  • *****
  • Публикации: 4151
  • Distribution: Mageia, Q4OS
    • Профил
Проблем с джойстик- изобщо не го намира
« Отговор #1 -: Oct 09, 2006, 22:33 »
Едит: Извинявам се за двойния пост, даде ми някакъв Internal server error, докато поствах този пост, и излезе непълна информация, а цялата информация, която исках да постна, излезе във следващия пост- моля модератора да затрие настоящия пост и да остави следващия ми такъв- там е проблема, за който искам съвет



Активен

Nik123

  • Напреднали
  • *****
  • Публикации: 4151
  • Distribution: Mageia, Q4OS
    • Профил
Проблем с джойстик- изобщо не го намира
« Отговор #2 -: Oct 09, 2006, 23:02 »
Благодарение на redcure и малко четене, успях да си подкарам джойстика, ръководейки се от това:
2. Usage
~~~~~~~~
 For basic usage you just choose the right options in kernel config and
you should be set.

2.1 inpututils
~~~~~~~~~~~~~~
For testing and other purposes (for example serial devices), a set of
utilities is available at the abovementioned website. I suggest you download
and install it before going on.

2.2 Device nodes
~~~~~~~~~~~~~~~~
For applications to be able to use the joysticks, in you don't use devfs,
you'll have to manually create these nodes in /dev:

cd /dev
rm js*
mkdir input
mknod input/js0 c 13 0
mknod input/js1 c 13 1
mknod input/js2 c 13 2
mknod input/js3 c 13 3
ln -s input/js0 js0
ln -s input/js1 js1
ln -s input/js2 js2
ln -s input/js3 js3

For testing with inpututils it's also convenient to create these:

mknod input/event0 c 13 64
mknod input/event1 c 13 65
mknod input/event2 c 13 66
mknod input/event3 c 13 67

2.4 Modules needed
~~~~~~~~~~~~~~~~~~
 For all joystick drivers to function, you'll need the userland interface
module in kernel, either loaded or compiled in:

modprobe joydev

 For gameport joysticks, you'll have to load the gameport driver as well;

modprobe ns558

 And for serial port joysticks, you'll need the serial input line
discipline module loaded and the inputattach utility started:

modprobe serport
inputattach -xxx /dev/tts/X &

 In addition to that, you'll need the joystick driver module itself, most
usually you'll have an analog joystick:

modprobe analog

 For automatic module loading, something like this might work - tailor to
your needs:

alias tty-ldisc-2 serport
alias char-major-13 input
above input joydev ns558 analog
options analog map=gamepad,none,2btn

2.5 Verifying that it works
~~~~~~~~~~~~~~~~~~~~~~~~~~~
 For testing the joystick driver functionality, there is the jstest
program in the utilities package. You run it by typing:

jstest /dev/js0

 And it should show a line with the joystick values, which update as you
move the stick, and press its buttons. The axes should all be zero when the
joystick is in the center position. They should not jitter by themselves to
other close values, and they also should be steady in any other position of
the stick. They should have the full range from -32767 to 32767. If all this
is met, then it's all fine, and you can play the games. '<img'>

 If it's not, then there might be a problem. Try to calibrate the joystick,
and if it still doesn't work, read the drivers section of this file, the
troubleshooting section, and the FAQ.

2.6. Calibration
~~~~~~~~~~~~~~~~
 For most joysticks you won't need any manual calibration, since the
joystick should be autocalibrated by the driver automagically. However, with
some analog joysticks, that either do not use linear resistors, or if you
want better precision, you can use the jscal program

jscal -c /dev/js0

included in the joystick package to set better correction coefficients than
what the driver would choose itself.

 After calibrating the joystick you can verify if you like the new
calibration using the jstest command, and if you do, you then can save the
correction coefficients into a file

jscal -p /dev/js0 > /etc/joystick.cal

 And add a line to your rc ###### executing that file

source /etc/joystick.cal

 This way, after the next reboot your joystick will remain calibrated. You
can also add the jscal -p line to your shutdown ######.
Изпълних като руут командите
cd /dev
rm js*
mkdir input
mknod input/js0 c 13 0
mknod input/js1 c 13 1
mknod input/js2 c 13 2
mknod input/js3 c 13 3
ln -s input/js0 js0
ln -s input/js1 js1
ln -s input/js2 js2
ln -s input/js3 js3

mknod input/event0 c 13 64
mknod input/event1 c 13 65
mknod input/event2 c 13 66
mknod input/event3 c 13 67

modprobe joydev
modprobe ns558
modprobe analog
jscal -c /dev/js0
 jscal -p /dev/js0 > /etc/joystick.cal
И джойстика се калиброва и е готов за използване. Но има друг проблем- след рестарт пак трябва всичко наново, за да ми работи джойстика. има ли някакъв начин да направя така, че да не се налага всеки път да пиша командите и да зареждам модулите ръчно- в някакъв скрипт ли трябва да се добавят? Благодаря предварително
Активен

kolio_kolev

  • Напреднали
  • *****
  • Публикации: 356
  • Distribution: Mandriva 2011, Mandriva Cooker
  • Window Manager: KDE 4.6.x
    • Профил
    • WWW
Проблем с джойстик- изобщо не го намира
« Отговор #3 -: Oct 10, 2006, 09:09 »
Сложи ги във файлът  /etc/rc.local и ще се изпълняват всеки път при стартиране на системата.
Активен

Кольо Колев
Mandriva BG: http://mandriva.biotronica.net
Bitronica.Net форуми: http://forum.biotronica.net

Nik123

  • Напреднали
  • *****
  • Публикации: 4151
  • Distribution: Mageia, Q4OS
    • Профил
Проблем с джойстик- изобщо не го намира
« Отговор #4 -: Oct 16, 2006, 11:00 »
Благодаря за информацията
Активен