Extraneous printing in Joystick.get_axis

Bug #1023153 reported by James Whong on 2012-07-10
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
pygame (Ubuntu)
Undecided
Unassigned

Bug Description

Joystick.get_axis is printing on every call, flooding the terminal.

SDL_JoystickGetAxis value:0:
SDL_JoystickGetAxis value:-7770:
SDL_JoystickGetAxis value:-5068:
SDL_JoystickGetAxis value:-6081:
SDL_JoystickGetAxis value:0:
SDL_JoystickGetAxis value:-7770:
SDL_JoystickGetAxis value:-5068:
SDL_JoystickGetAxis value:-6081:
SDL_JoystickGetAxis value:0:
SDL_JoystickGetAxis value:-7770:
SDL_JoystickGetAxis value:-5068:
SDL_JoystickGetAxis value:-6081:
SDL_JoystickGetAxis value:0:
SDL_JoystickGetAxis value:-7770:
SDL_JoystickGetAxis value:-5068:
SDL_JoystickGetAxis value:-6081:
SDL_JoystickGetAxis value:0:
SDL_JoystickGetAxis value:-7770:
SDL_JoystickGetAxis value:-5068:
SDL_JoystickGetAxis value:-6081:
SDL_JoystickGetAxis value:0:
SDL_JoystickGetAxis value:-7770:
SDL_JoystickGetAxis value:-5068:
SDL_JoystickGetAxis value:-6081:
SDL_JoystickGetAxis value:0:
SDL_JoystickGetAxis value:-7770:

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: python-pygame 1.9.1release+dfsg-5
ProcVersionSignature: Ubuntu 3.2.0-26.41-generic-pae 3.2.19
Uname: Linux 3.2.0-26-generic-pae i686
ApportVersion: 2.0.1-0ubuntu8
Architecture: i386
Date: Tue Jul 10 16:53:54 2012
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release i386 (20111012)
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: pygame
UpgradeStatus: Upgraded to precise on 2012-06-12 (28 days ago)

James Whong (james-whong) wrote :
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pygame (Ubuntu):
status: New → Confirmed
J. Simon Gagne (jsgagne) wrote :

I ran into this bug too...

I took a look at the pygame sourcecode, especially the code behind the joystick.get_axis() function and I found this :

#ifdef DEBUG
    /*printf("SDL_JoystickGetAxis value:%d:\n", value);*/
#endif

So obviously the pygame package for ubuntu was compiled with the DEBUG flag set, instead of the release version....

The solution would be to recompile pygame correctly or, if you're after a quick hack, just delete those debug lines altogether and recompile.

Vincent Cheng (vincent-c) wrote :

If I'm not mistaken, there's a compile time debug option for SDL, not in pygame itself. Either way, this issue has been tracked upstream and is reported to be fixed in upstream mercurial repository: https://bitbucket.org/pygame/pygame/issue/63

Timtro (timtro) wrote :

Thanks in advance. This is still an issue in Q4 2015 and makes it unusable in my case. I require stdout to be clean for my console application. Considering this is nothing more than a recompile with appropriate flags, is there a possibility for a fix soon?

Markus B (markus-bader-tirol) wrote :

Hi you can just recompile the pkg

cd /tmp
sudo apt-get build-dep pygame
apt-get source pygame
vim pygame-1.9.1release+dfsg/src/joystick.c
--> remove or command the printf messages out line 204 and 244
apt-get source --compile pygame
sudo dpkg -i python-pygame_1.9.1release+dfsg-9ubuntu1_amd64.deb

Greetings
Max

illume (illume) wrote :

This is fixed in pygame 1.9.3+

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers