Application hang when playing audio

Application hang when playing audio

Hi all, We encounter a strange problem: when playing the audio, occasionally it fails and the application hangs. Does anyone have the same problem and have any clue? The application load a qml file from qrc and display it. In the qml file, we create an audio element: Audio { id: audioIncorrect source: "file:///opt/com.company.app/audio/wrong.ogg" } And there is a button in the qml, when click the button, we do: audioIncorrect.stop(); audioIncorrect.play(); The intention is to play an alert when click the button. We create a rpm package and install it on EXOPC, the meego image version is 1.1.99 build: meego-tablet-ia32-pinetrail-1.2.0.90.0.20110517.1. After install, when launch the application, sometimes the sound play correctly without problem, but sometimes, when first click the button, there is no sound, and then click the button again, the application hangs. Another strange issue is run the application from console, it always display: Error: "The autoaudiosink element is not working." Error: "Internal data stream error." GStreamer; Unable to play - "file:///opt/com.company.app/audio/wrong.ogg" Error: "No URI set" And the application never hangs when running from console. Very appreciated if someone give a hint.
3 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

The music player pre-installed on meego seems without this problem. I checked the code in, I find it has a resource manager to play the music:

property variant resourceManager: ResourceManager {
name: "player"
type: ResourceManager.MusicApp
onStartPlaying: {
audio.play();
}
onStopPlaying: {
audio.pause();
}
}

but I can't find the definition of ResourceManager anywhere.

ResourceManager is defined by package meego-ux-media

/home/npm/qtquick/ux/meego-app-video/main.qml: property variant resourceManager: ResourceManager {
/home/npm/qtquick/ux/meego-app-video/main.qml: type: ResourceManager.VideoApp
/home/npm/qtquick/ux/meego-ux-media/lib/resourcemanager.cpp:ResourceManager::ResourceManager(QObject *parent) :
/home/npm/qtquick/ux/meego-ux-media/lib/resourcemanager.cpp:ResourceManager::~ResourceManager()
/home/npm/qtquick/ux/meego-ux-media/lib/resourcemanager.cpp:void ResourceManager::startup()
/home/npm/qtquick/ux/meego-ux-media/lib/resourcemanager.cpp:void ResourceManager::setType(const int type)
/home/npm/qtquick/ux/meego-ux-media/lib/resourcemanager.cpp:void ResourceManager::setName(const QString &name)
/home/npm/qtquick/ux/meego-ux-media/lib/resourcemanager.cpp:void ResourceManager::setUserwantsplayback(const bool userwantsplayback)
/home/npm/qtquick/ux/meego-ux-media/lib/resourcemanager.cpp:void ResourceManager::acquire()
/home/npm/qtquick/ux/meego-ux-media/lib/resourcemanager.cpp:void ResourceManager::release()
/home/npm/qtquick/ux/meego-ux-media/lib/resourcemanager.cpp:void ResourceManager::resourceAcquiredHandler(const QList&)
/home/npm/qtquick/ux/meego-ux-media/lib/resourcemanager.cpp:void ResourceManager::resourceLostHandler()
/home/npm/qtquick/ux/meego-ux-media/lib/resourcemanager.h:class ResourceManager : public QObject
/home/npm/qtquick/ux/meego-ux-media/lib/resourcemanager.h: ResourceManager(QObject *parent = 0);
/home/npm/qtquick/ux/meego-ux-media/lib/resourcemanager.h: ~ResourceManager();
/home/npm/qtquick/ux/meego-ux-media/libqml/mediaqml.cpp: qmlRegisterType(uri, 0, 0, "ResourceManager");
/home/npm/qtquick/ux/meego-app-music/main.qml: property variant resourceManager: ResourceManager {
/home/npm/qtquick/ux/meego-app-music/main.qml: type: ResourceManager.MusicApp

See also http://forum.meego.com/showthread.php?p=28632
"http://forum.meego.com/showthread.php?p=28632
"Default Using harmattan resource policies in apps"
(which also applies to MeeGo, with ResourceManager providing an alternate meego-ux implementation of what I implement here: http://forum.meego.com/showpost.php?p=28687&postcount=4 )

Lascia un commento

Eseguire l'accesso per aggiungere un commento. Non siete membri? Iscriviti oggi