ioctl IOError

Steve Purcell stephen_purcell at yahoo.com
Thu Jul 27 00:37:52 EDT 2000


Christopher N. Deckard wrote:
> def getvolume(self):
> 	value = 0
> 	fnctl.ioctl(self.fd, SOUND_MIXER_READ_LINE, value)
> 	return (((value & 0xff) + (value >> 8)) / 2)
> 
> When I simply call the 'getvolume' function, I get:
> IOError: (14, 'Bad address')

Are you maybe using the return value from 'open()' as the file descriptor?

To get the real file descriptor from a python file object, you need to call
its 'fileno()' method. Ignore me if you're already doing that.

-Steve

-- 
Steve Purcell,  Technical Director, Inkontact
Get in touch at http://www.inkontact.com/
Get testing at http://pyunit.sourceforge.net/
"Life must be simple if I can do it" -- Me




More information about the Python-list mailing list