Details
-
Bug
-
Resolution: Cannot Reproduce
-
P2: Important
-
None
-
6.4.1
-
None
-
Developing on Linux Mint 20.2
-
-
2023wk06FOQtforAndroid, 2023wk10FOQtforAndroid
Description
I have a "Hello World" QML application with a dummy Android service and the following main.cpp. The number of audio inputs is printed fine for the application but for the service part, the call to QMediaDevices::audioInputs seems to hang.
Is this a bug?
If so, is there a work-around to access the QAudioSource?
int main(int argc, char *argv[]) { if (argc > 1) { QAndroidService app(argc, argv); qInfo() << "Audio: Service: Number of inputs(1)"; QList<QAudioDevice> audio = QMediaDevices::audioInputs(); int n = audio.length(); qInfo() << "Audio: Service: Number of inputs(2)"; qInfo() << "Audio: Service: Number of inputs " << n << "#"; return app.exec(); } else { QGuiApplication app(argc, argv); QQmlApplicationEngine engine; const QUrl url(u"qrc:/testQt6/main.qml"_qs); QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, &app, [url](QObject *obj, const QUrl &objUrl) { if (!obj && url == objUrl) QCoreApplication::exit(-1); }, Qt::QueuedConnection); engine.load(url); QJniObject::callStaticMethod<void>( "org/qtproject/example/QtAndroidService", "startQtAndroidService", "(Landroid/content/Context;)V", QNativeInterface::QAndroidApplication::context()); qInfo() << "Audio: App: Number of inputs(1)"; QList<QAudioDevice> audio = QMediaDevices::audioInputs(); int n = audio.length(); qInfo() << "Audio: App: Number of inputs(2)"; qInfo() << "Audio: App: Number of inputs " << n << "#"; return app.exec(); } }