Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.6.2
-
None
-
Qt 4.6.2; cloned on 2010-03-04 from 'kinetic;, branch 'declarativeui'
kernel 2.6.31.3
x86_64
> cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version 1.0.20.
Also note that on my system, with first 4.6 versions I used to have the same problem as described in bug: http://bugreports.qt.nokia.com/browse/QTBUG-5723
- there is no "default" device. In newest qt this particular problem is indeed solved, but maybe the problem above is somehow connected?Qt 4.6.2; cloned on 2010-03-04 from 'kinetic;, branch 'declarativeui' kernel 2.6.31.3 x86_64 > cat /proc/asound/version Advanced Linux Sound Architecture Driver Version 1.0.20. Also note that on my system, with first 4.6 versions I used to have the same problem as described in bug: http://bugreports.qt.nokia.com/browse/QTBUG-5723 - there is no "default" device. In newest qt this particular problem is indeed solved, but maybe the problem above is somehow connected?
-
b7ef079177ceec96f821393796c6c5b14c21704e
Description
I have a problem with QAudioInput sometimes not writing to QIODevice. Might be an accident, but after trimming it down it turned out that the problem is 100% gone once I got rid of ui...
Attached example code is heavily trimmed down examples/multimedia/audioinput. The version basic_audio_test-no_ui does not have any ui. The version basic_audio_test-with_ui opens a main window with empty combo, but then never uses any elements of the ui and accesses the QAudioInput in exactly the same way as the no_ui version.
The example code in both versions basically starts QAudioInput for the first device found and for QIODevice defined in soundbuffer.h/cpp, which in writeData() only writes out a message. The problem is that in both cases it seems that QAudioInput is opened and started without errors, but then in the case with ui I (sometimes) do not get the debug from writeData() (so I'm almost certain this method is not reached - that's why I started investigating/trimming my case down in the first place => in a more complex application I was not getting any data).
- in "no_ui" version, in 100% of cases I get a stream of QIODevice's writeData calls:
basic_audio_test-no_ui> ./build/basic_audio_test
buffer opened
"slotDeviceChanged(0:front:CARD=NVidia,DEV=0) reached"
DFLT not supported
About to START audio input
Audio input started
"SoundBuffer::writeData() : max_size == 1280"
"SoundBuffer::writeData() : max_size == 1280"
"SoundBuffer::writeData() : max_size == 1920"
"SoundBuffer::writeData() : max_size == 1280"
"SoundBuffer::writeData() : max_size == 1920"
"SoundBuffer::writeData() : max_size == 1280"
"SoundBuffer::writeData() : max_size == 1920"
"SoundBuffer::writeData() : max_size == 1280"
"SoundBuffer::writeData() : max_size == 1920"
"SoundBuffer::writeData() : max_size == 1280"
"SoundBuffer::writeData() : max_size == 1920"
"SoundBuffer::writeData() : max_size == 1280"
"SoundBuffer::writeData() : max_size == 1920"
^C
- but in "with_ui" one of three cases happen:
1) I sometimes get the same:
basic_audio_test-with_ui> ./build/basic_audio_test
buffer opened
"slotDeviceChanged(0:front:CARD=NVidia,DEV=0) reached"
DFLT not supported
About to START audio input
Audio input started
"SoundBuffer::writeData() : max_size == 2560"
"SoundBuffer::writeData() : max_size == 1920"
"SoundBuffer::writeData() : max_size == 1280"
"SoundBuffer::writeData() : max_size == 1920"
"SoundBuffer::writeData() : max_size == 1280"
"SoundBuffer::writeData() : max_size == 1920"
"SoundBuffer::writeData() : max_size == 1280"
"SoundBuffer::writeData() : max_size == 1920"
"SoundBuffer::writeData() : max_size == 1280"
"SoundBuffer::writeData() : max_size == 1920"
2) BUT sometimes I get just:
basic_audio_test-with_ui> ./build/basic_audio_test
buffer opened
"slotDeviceChanged(0:front:CARD=NVidia,DEV=0) reached"
DFLT not supported
About to START audio input
Audio input started
and then no more output (ui is responsive, btw).
3) and sometimes I get additionally 1 line with writeData and nothing more:
basic_audio_test-with_ui> ./build/basic_audio_test
buffer opened
"slotDeviceChanged(0:front:CARD=NVidia,DEV=0) reached"
DFLT not supported
About to START audio input
Audio input started
"SoundBuffer::writeData() : max_size == 1280"
and then no more output (ui is responsive, btw). It never happens that e.g. 2 or 3 or other number of frames is received. It's always - either unblocked stream, or nothing or (rarely) one frame.
As I wrote - I have noticed the problem (no data received by IODevice) in a more complex setup which does not depend on usage of terminal output (so it is not just about writing out messages using qDebug()...).
The first question I asked was - is there something blocked or is there something looping or...?
I attach three strace outputs:
- from "no_ui" version (which never stops writing messages about new data received);
- from "with_ui" version in the case when it does not stop writing messages about new data received (seems quite similar to the above;
- from "with_ui" version in the case when it does NOT write messages about new data received (it definitely does "something" - hard for me to say what...)