PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 977 - QAudioOutput won't play short files
: QAudioOutput won't play short files
Status: CLOSED WONTFIX
Product: PySide
Classification: Unclassified
Component: PySide
: 1.0.6
: All All
: P3 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2011-08-17 23:32 EEST by Daniel Ashbrook
Modified: 2011-09-21 21:19 EEST (History)
8 users (show)

See Also:


Attachments
Simple example to illustrate need for padding of short sounds (1.25 KB, text/x-python-script)
2011-08-17 23:32 EEST, Daniel Ashbrook
Details
c++ port of the example (11.11 KB, application/x-bzip)
2011-08-31 20:04 EEST, renato filho
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Ashbrook 2011-08-17 23:32:39 EEST
Created attachment 406 [details]
Simple example to illustrate need for padding of short sounds

Audio data must be padded to the QAudioOutput.periodSize() in order to play;
otherwise, QAudioOutput does not play.

See the attachment for sample code: with a short (256 byte) sound and 'pad' set
to False, you'll hear nothing; with 'pad' set to True, you'll hear a pop.
Comment 1 Hugo Parente Lima 2011-08-23 20:30:25 EEST
Here I got an assertion error inside the Qt plugin, maybe because I don't use
Pulse Audio, i.e. a Qt bug.

"Connection failure: Connection refused"                                        
Assertion 'c' failed at pulse/context.c:1182, function
pa_context_send_simple_command(). Aborting.                                     
Aborted
Comment 2 renato filho 2011-08-31 17:35:40 EEST
Sorry but I do not understand the problem, I'm running the test without
modifications and I got:

padding 256 bytes to 3528 bytes
active
error: PySide.QtMultimedia.QAudio.Error.NoError
idle
error: PySide.QtMultimedia.QAudio.Error.UnderrunError

If I change the pad value from True to False I got:

active
error: PySide.QtMultimedia.QAudio.Error.NoError
idle
error: PySide.QtMultimedia.QAudio.Error.UnderrunError

And If I uncomment the line "w = WaveAudioOutput(2**18)" and commented the line
"w = WaveAudioOutput(256, pad=False)"

I heard the noise and I got:

padding 262144 bytes to 3528 bytes
active
error: PySide.QtMultimedia.QAudio.Error.NoError
idle
error: PySide.QtMultimedia.QAudio.Error.UnderrunError



What is exactly the problem? How can I reproduce that?
Comment 3 Daniel Ashbrook 2011-08-31 19:55:40 EEST
With:
  w = WaveAudioOutput(256, pad=True)
you should hear a short "pop" sound from your speakers.

With:
  w = WaveAudioOutput(256, pad=False)
you should not hear the "pop" sound. This is the bug.

With both:
  w = WaveAudioOutput(2**18, pad=True)
  w = WaveAudioOutput(2**18, pad=False)
you should hear sound.

The issue is that the sound must be a certain length to hear; with pad=True, I
am padding the buffer to 3528 bytes - so adding 3528-256=3272 zeros to the end.
The padding causes the sound to play. Without that padding, you don't get sound
output, but should!
Comment 4 renato filho 2011-08-31 20:03:09 EEST
Running the same test with C++ example:

1 - With: WaveAudioOutput *out = new WaveAudioOutput(255, true);
padding 255 bytes to 3528 bytes 
STATE: "active" 
ERROR: "NoError" 
STATE: "idle" 
ERROR: "UnderrunError"

2 - With: 
STATE: "active" 
ERROR: "NoError"
and the program freeze

3 - WaveAudioOutput *out = new WaveAudioOutput(pow(2,18));
I heard the noise and:
padding 262144 bytes to 3528 bytes 
STATE: "active" 
ERROR: "NoError" 
STATE: "idle" 
ERROR: "UnderrunError"
Comment 5 renato filho 2011-08-31 20:04:19 EEST
Created attachment 414 [details]
c++ port of the example
Comment 6 renato filho 2011-08-31 20:08:15 EEST
I have created this c++ that produces the same results as python code.

could you confirm that?

If the C++ shows the same problem then this is a bug on Qt multimedia and must
be reported on Qt bug tracker
(https://bugreports.qt.nokia.com/secure/Dashboard.jspa).
Comment 7 renato filho 2011-09-08 23:59:09 EEST
I will mark this bug as closed since the problem exists in both C++ and Python,
but fell free to re-open if you have any other problem.
Comment 8 renato filho 2011-09-21 21:19:48 EEST
Release 1.0.7