[Bug 624688] [NEW] QAudioDeviceInfo::defaultOutputDevice() depends on previous calls

Maxim Kirillov 624688 at bugs.launchpad.net
Thu Aug 26 14:54:28 UTC 2010

Public bug reported:

package: libqt4-dev      4:4.6.2-0ubuntu5
Description:    Ubuntu 10.04.1 LTS
Release:        10.04

compile and the following program:
#include <QAudioDeviceInfo>
#include <QDebug>

int main(int argc, char** argv)
    Q_ASSERT(argc >= 2);
    // if this enabled; defaultOutputDevice() returns "null" device
    if (argv[1][0] == 'y') {
	foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) {
	    qDebug() << "l:" << deviceInfo.deviceName();
    QAudioDeviceInfo info = QAudioDeviceInfo::defaultOutputDevice();

    qDebug() << "res:" << info.deviceName();

CONFIG += debug

QT += multimedia
QT -= gui

SOURCES = test.cpp
compile, then run:
$./test y
$./test n

$./test y  
l: "pulse" 
l: "front:CARD=Intel,DEV=0" 
l: "surround40:CARD=Intel,DEV=0" 
l: "surround41:CARD=Intel,DEV=0" 
l: "surround50:CARD=Intel,DEV=0" 
l: "surround51:CARD=Intel,DEV=0" 
l: "surround71:CARD=Intel,DEV=0" 
l: "iec958:CARD=Intel,DEV=0" 
res: "null" 
$./test n
res: "pulse" 

the "res:" output must not depend on the previous calls. That is, it must be the same for both calls

I tried to reproduce it at debian squeeze (qt=4:4.6.3-1), but there it ran OK;
$ ./test y
l: "default:CARD=Intel" 
l: "default" 
res: "default:CARD=Intel" 
$ ./test n
res: "default:CARD=Intel" 

I suspect is caused by pulseaudio, but not sure.

versions for other packages, which probably affects:
alsa-tools      1.0.22-0ubuntu1
alsa-utils      1.0.22-0ubuntu5
gstreamer0.10-pulseaudio        0.10.21-1ubuntu3
libasound2      1.0.22-0ubuntu7
libasound2-dev  1.0.22-0ubuntu7
libasound2-plugins      1.0.22-0ubuntu6
libpulse-browse0        1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu14
libpulse-mainloop-glib0 1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu14
libpulse0       1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu14
pulseaudio      1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu14
pulseaudio-esound-compat        1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu14
pulseaudio-module-x11   1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu14
pulseaudio-utils        1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu14

** Affects: qt4-x11 (Ubuntu)
     Importance: Undecided
         Status: New

QAudioDeviceInfo::defaultOutputDevice() depends on previous calls
You received this bug notification because you are a member of Kubuntu
Bugs, which is subscribed to qt4-x11 in ubuntu.

More information about the kubuntu-bugs mailing list