[Python-bugs-list] [Bug #114756] test_linuxaudiodev uses wrong format

noreply@sourceforge.net noreply@sourceforge.net
Mon, 18 Sep 2000 21:13:32 -0700


Bug #114756, was updated on 2000-Sep-18 16:50
Here is a current snapshot of the bug.

Project: Python
Category: Modules
Status: Open
Resolution: None
Bug Group: Platform-specific
Priority: 5
Summary: test_linuxaudiodev uses wrong format

Details: test_linuxaudiodev sounds *horrible*.  This has come up several times on python-dev, but nobody seems to have a fix that works -- or at least nothing has been checked in, so I'm contributing this bug report to the collective memory.

Here's how the bug manifests on my machine (a Dell Dimension with built-in sound hardware [Yamaha YMF-724F], using ALSA 0.5.8a drivers in a 2.2.14 kernel):

$ ./python Lib/test/test_linuxaudiodev.py
plays the entire sample without complaint, but it sounds *horrible* -- apparently because it's treating an .au file incorrectly.

See also my python-dev post of 29 June 2000: http://www.python.org/pipermail/python-dev/2000-June/011808.html

Ping suggested setting AUDIODEV=/dev/audio before running the script, and Michael Hudson contributed an alternate version of the test script which writes to /dev/audio (same idea, no environment variable needed).  Either of these fixes has the same result:

$ ./python Lib/test/test_linuxaudiodev-hudson.py
Traceback (most recent call last):
  File "Lib/test/test_linuxaudiodev-hudson.py", line 62, in ?
    test()
  File "Lib/test/test_linuxaudiodev-hudson.py", line 60, in test
    play_au_file(findfile('audiotest.au'))
  File "Lib/test/test_linuxaudiodev-hudson.py", line 55, in play_au_file
    dsp.write(data)
linuxaudiodev.error: (11, 'Resource temporarily unavailable')

The traceback appears immediately, but the script keeps running while the sample plays -- well, about half of it.  The sample is cut off midway through, and my shell prompt returns.

Finally, Ping posted another variation on the test script (http://www.python.org/pipermail/python-dev/2000-June/011834.html) which does not work at all for me:
$ ./python Lib/test/test_linuxaudiodev-ping.py
Traceback (most recent call last):
  File "Lib/test/test_linuxaudiodev-ping.py", line 37, in ?
    test()
  File "Lib/test/test_linuxaudiodev-ping.py", line 35, in test
    play_au_file(findfile('audiotest.au'))
  File "Lib/test/test_linuxaudiodev-ping.py", line 26, in play_au_file
    raise "audio format not supported by linuxaudiodev"
audio format not supported by linuxaudiodev

No sound at all from this one.

Charles Waldman <cgw@fnal.gov> also took a look at linuxaudiodev.c and didn't like what he found: http://www.python.org/pipermail/python-dev/2000-August/015746.html; Charles has said he's working on a rewrite of this module.



Follow-Ups:

Date: 2000-Sep-18 21:13
By: gvanrossum

Comment:
You do have a sound card, don't you, Jeremy?
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=114756&group_id=5470