Symbian
Symbian OS Library

FAQ-1004 Why does my Audio Streaming application crash on Symbian OS v7.0s?

[Index][spacer] [Previous] [Next]



 

Classification: C++ Category: Multimedia
Created: 03/10/2004 Modified: 03/10/2004
Number: FAQ-1004
Platform: Symbian OS v7.0s

Question:
When porting Audio Streaming applications to Symbian OS v7.0s the application may seem to become more unstable / unreliable. Why could this be?

Answer:
One possible reason for system instability when using the CMdaAudioOutputStream APIs is that the code may not be using the APIs in the asynchronous manner in which they were designed. When a buffer is supplied to the output stream using:

    virtual void WriteL(const TDesC8& aData);

    The application may not replace or delete the aData buffer ahead until it has been received by the client application in the following callback:

    virtual void MaoscBufferCopied(TInt aError, const TDesC8& aBuffer)=0;

    If an application frees or replaces the buffer before this then there will be problems, since the lower level audio subsystems will still be trying to access this buffer. In many applications this will seem to work fine on Symbian OS v6.1 / v7.0 but will cause problems in v7.0s due to the new MMF subsystem. However, ALL applications which use the CMdaAudioOutputStream classes should be written to use these APIs asynchronously as above.

    The basic buffer handling sequence for an application using the above APIs is shown below:

    1. Open the CMdaAudioOutputStream using CMdaAudioOutputStream::Open()
    2. Wait for the MaoscOpenComplete() callback
    ...do other things...
    3. Supply a buffer using CMdaAudioOutputStream::Write()
    ...preferably keep the stream double buffered so supply more buffers...
    4. When the buffer is received in the MaoscBufferCopied() callback it can be replaced / deleted.