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.

Title: test_ossaudiodev fails under padsp (Linux PulseAudio OSS emulation)
Type: behavior Stage:
Components: Versions: Python 3.7, Python 3.6
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: barry, doko, ncoghlan, petr.viktorin
Priority: normal Keywords:

Created on 2017-07-28 06:44 by ncoghlan, last changed 2022-04-11 14:58 by admin.

Messages (2)
msg299369 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2017-07-28 06:44
On current Fedora systems, test_ossaudiodev is implicitly skipped even when the audio resource is enabled due to the absence of the `/test/dsp` device:

$ ./python -m test -v -uaudio test_ossaudiodev
0:00:00 load avg: 0.33 [1/1] test_ossaudiodev
test_ossaudiodev skipped -- [Errno 2] No such file or directory: '/dev/dsp'
test_ossaudiodev skipped

1 test skipped:

Total duration: 31 ms
Tests result: SUCCESS

And while PulseAudio does provide an OpenSoundSystem emulation mode, it apparently isn't sufficient for the Python extension module's needs:

$ padsp ./python -m test -v -uaudio test_ossaudiodev
0:00:00 load avg: 0.41 [1/1] test_ossaudiodev
test_mixer_methods (test.test_ossaudiodev.OSSAudioDevTests) ... ok
test_on_closed (test.test_ossaudiodev.OSSAudioDevTests) ... ok
test_playback (test.test_ossaudiodev.OSSAudioDevTests) ... ERROR
test_set_parameters (test.test_ossaudiodev.OSSAudioDevTests) ... ERROR
test_with (test.test_ossaudiodev.OSSAudioDevTests) ... ok

ERROR: test_playback (test.test_ossaudiodev.OSSAudioDevTests)
Traceback (most recent call last):
  File "/home/ncoghlan/devel/cpython/Lib/test/", line 148, in test_playback
  File "/home/ncoghlan/devel/cpython/Lib/test/", line 54, in play_sound_file
OSError: [Errno 22] Invalid argument

ERROR: test_set_parameters (test.test_ossaudiodev.OSSAudioDevTests)
Traceback (most recent call last):
  File "/home/ncoghlan/devel/cpython/Lib/test/", line 153, in test_set_parameters
  File "/home/ncoghlan/devel/cpython/Lib/test/", line 103, in set_parameters
    if (dsp.setfmt(fmt) == fmt and
OSError: [Errno 22] Invalid argument

Ran 5 tests in 0.016s

FAILED (errors=2)
test test_ossaudiodev failed
test_ossaudiodev failed

1 test failed:

Total duration: 55 ms
Tests result: FAILURE
[ncoghlan@thechalk cpython]$ padsp ./python -m test -uaudio test_ossaudiodev
Run tests sequentially
0:00:00 load avg: 0.42 [1/1] test_ossaudiodev
test test_ossaudiodev failed -- multiple errors occurred; run in verbose mode for details
test_ossaudiodev failed

1 test failed:

Total duration: 35 ms
Tests result: FAILURE

The reason I'm filing this here rather than downstream in Fedora is because I'm uncertain whether or not we actually need to worry about it: the module's presumably been broken in practice on Linux for years, and I only noticed it today due to a discussion about Python easter eggs that got me wondering why it had been so long since I'd heard the audio file of Guido speaking when running the tests with `-uall`.
msg299370 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2017-07-28 06:44
Adding Matthias to the nosy list as Debian Python maintainer.
Date User Action Args
2022-04-11 14:58:49adminsetgithub: 75247
2017-07-28 06:44:59ncoghlansetnosy: + doko
messages: + msg299370
2017-07-28 06:44:04ncoghlancreate