×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    7

    QAudioOutput works on Simulator but not on N8 when adding new QThread

    I started with the Qt multimedia audiooutput example. It produces a sine wave tone on my PC and it works fine on my N8. I added a new QThread to the program. It still produces sound on my PC, but stopped producing sound on my N8. I spent a week trying different ways to make it work on the N8 but no luck. I believe the QAudioOutput object creates its own QThread, and the QIODevice object also creates its own QThread. So there may be a limit on the number of QThreads allowed. Or could it be that the API library accessed by the Simulator release version, which is not packaged with the library for testing purposes, has limitations?

  2. #2
    Registered User
    Join Date
    Jun 2007
    Location
    Mumbai, India
    Posts
    1,998

    Re: QAudioOutput works on Simulator but not on N8 when adding new QThread

    Have you tried tweaking the priority of QThread?

  3. #3
    Regular Contributor
    Join Date
    Oct 2008
    Location
    Oslo, Norway
    Posts
    329

    Re: QAudioOutput works on Simulator but not on N8 when adding new QThread

    QAudioOutput has problems with access from multiple threads on Symbian platform, see QTBUG-14273. You should be still able to use QAudioOutput in a process with other threads running, just make sure that it is handled in a thread-safe manner, i.e. using signals and slots. Are you trying to access QAudioOutput instance directly from another thread?

  4. #4
    Registered User
    Join Date
    Jan 2011
    Posts
    7

    Re: QAudioOutput works on Simulator but not on N8 when adding new QThread

    The QThread I create does not build or call QAudioOutput. That is done with a QIODevice created in the main thread
    and a QAudioOutput also created in the main thread. The QAudioOutput init is preceded by a QAudioDeviceInfo calling isFormatSupported() which returns success when I stub out the QThread, but returns Not Supported when the QThread is built. The QThread actually stops on a Wait Condition almost immediately, so its priority should not be an issue. It has become more difficult to test on the N8 because when I add or delete APIs like QMediaPlayer, the N8 refuses to install the new version giving an Upgrade Error. I have one program that uses QMediaPlayer and one that does not. I am guessing that you cannot use QMediaPlayer along with QAudioOutput? The program that does not use QMediaPlayer still has the problem with the QThread walking on the Format Supported, which is the typical
    44100,2channels,16bits,audio/pcm,LittleEndian,SignedInt.

  5. #5
    Registered User
    Join Date
    Jan 2011
    Posts
    7

    Re: QAudioOutput works on Simulator but not on N8 when adding new QThread

    Ooops, I just tried it again and now it works with the QThread. It still does not work with the QMediaPlayer, so maybe that is the clue I have spent the last week banging my head for. I am glad to know about the QTBUG-14273 though.

  6. #6
    Registered User
    Join Date
    Jan 2011
    Posts
    7

    Re: QAudioOutput works on Simulator but not on N8 when adding new QThread

    Whoa now. I just tried it again and its still broke. I have to use SEARCH on the N8 to find the audiooutput app and it sometimes shows me an old version for some reason. So I guess when it worked I was actually testing the version with QThread stubbed out.

    I still get the Format Not Supported return when the QThread is active, even though all accesses to QAudioOutput are done in the main thread. Oh and by the way, the pushbuttons respond fine when the QThread is active, indicating nothing is hung in a loop.

Similar Threads

  1. Replies: 1
    Last Post: 2009-11-04, 21:38
  2. works on WTK but does not works on S60 SDK
    By sbmcdeshan in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2009-03-05, 20:01
  3. My browser works on simulator but not on mobile
    By gaurav_varma in forum Mobile Java Networking & Messaging & Security
    Replies: 9
    Last Post: 2008-04-07, 18:34

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •