This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author richaplin
Recipients gward, richaplin, rluse, samdennis
Date 2017-10-11.10:36:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1507718176.36.0.213398074469.issue1566331@psf.upfronthosting.co.za>
In-reply-to
Content
Hi there yes this is very much an issue on Arm linux (e.g. Armbian). Calling any function that triggers a call to _ssize(..) - a function which is clearly intended to have no side-effects - instead resets the number of channels (and sample format?) by calling IOCTLs "SNDCTL_DSP_SETFMT" and "SNDCTL_DSP_CHANNELS" with arguments of zero as a way to query the current values. 

This doesn't work on many drivers; e.g. they take '0' as meaning 'mono' and switch to one channel. 

To repro:
        import ossaudiodev
        self.dsp=ossaudiodev.open("/dev/dsp1","w")
        self.dsp.setfmt(ossaudiodev.AFMT_S16_LE)
        self.dsp.channels(2)  #<<Set to stereo
        self.dsp.speed(96000)
        ...
        self.bufSize=self.dsp.bufsize()
        ...

        #This will output audio in the wrong format (mono)! Remove the innocent looking "bufsize" test above and it will correctly output stereo
        self.dsp.write(someData)


Frustrating bug! ;-)
History
Date User Action Args
2017-10-11 10:36:16richaplinsetrecipients: + richaplin, gward, samdennis, rluse
2017-10-11 10:36:16richaplinsetmessageid: <1507718176.36.0.213398074469.issue1566331@psf.upfronthosting.co.za>
2017-10-11 10:36:16richaplinlinkissue1566331 messages
2017-10-11 10:36:16richaplincreate