[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#787464: Acknowledgement (libplib1: jsJoystick::open() breaks system calibration on Linux)



forwarded 787464 https://sourceforge.net/p/plib/bugs/47/
tags 787464 + patch
thanks

Attaching a patch for a QA upload in case someone wants to sponsor it.
TIA

-- 
Florent
diff -u plib-1.8.5/debian/changelog plib-1.8.5/debian/changelog
--- plib-1.8.5/debian/changelog
+++ plib-1.8.5/debian/changelog
@@ -1,3 +1,15 @@
+plib (1.8.5-8) unstable; urgency=medium
+
+  * QA upload.
+  * Add patch 06_dont_break_joystick_system_calibration.diff
+    (Closes: #787464):
+
+      Don't break system calibration settings when a joystick is opened
+      (plib may do additional dead-band management on top of the OS joystick
+      driver, it should not break system settings for that reason!)
+
+ -- Florent Rougon <f.rougon@free.fr>  Mon, 01 Jun 2015 21:34:52 +0200
+
 plib (1.8.5-7) unstable; urgency=medium
 
   * Enable hardened build flags
@@ -484,3 +496 @@
-Local variables:
-mode: debian-changelog
-End:
+
diff -u plib-1.8.5/debian/patches/series plib-1.8.5/debian/patches/series
--- plib-1.8.5/debian/patches/series
+++ plib-1.8.5/debian/patches/series
@@ -6,0 +7 @@
+06_dont_break_joystick_system_calibration.diff
only in patch2:
unchanged:
--- plib-1.8.5.orig/debian/patches/06_dont_break_joystick_system_calibration.diff
+++ plib-1.8.5/debian/patches/06_dont_break_joystick_system_calibration.diff
@@ -0,0 +1,31 @@
+Description: Don't break system calibration settings when a joystick is opened
+ plib may do additional dead-band management on top of the OS joystick driver,
+ it should not break system settings for that reason!
+Author: Florent Rougon <f.rougon@free.fr>
+Bug: https://sourceforge.net/p/plib/bugs/47/
+Bug-Debian: http://bugs.debian.org/787464
+Last-Update: 2015-06-01
+
+--- a/src/js/jsLinux.cxx
++++ b/src/js/jsLinux.cxx
+@@ -79,20 +79,6 @@
+   if ( num_axes > _JS_MAX_AXES )
+     num_axes = _JS_MAX_AXES ;
+ 
+-  // Remove any deadband value already done in the kernel.
+-  // Since we have our own deadband management this is save to do so.
+-  struct js_corr* corr = new js_corr[ all_axes ] ;
+-  ioctl ( os->fd, JSIOCGCORR, corr );
+-  for ( int i = 0; i < num_axes ; ++i ) {
+-    if ( corr[ i ] . type == JS_CORR_BROKEN ) {
+-      int nodeadband = ( corr[ i ] . coef[ 0 ] + corr[ i ] . coef[ 1 ] ) / 2 ;
+-      corr[ i ] . coef[ 0 ] = nodeadband ;
+-      corr[ i ] . coef[ 1 ] = nodeadband ;
+-    }
+-  }
+-  ioctl ( os->fd, JSIOCSCORR, corr );
+-  delete [] corr;
+-
+   for ( int i = 0 ; i < _JS_MAX_AXES ; i++ )
+   {
+     max       [ i ] = 32767.0f ;

Reply to: