×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Registered User
    Join Date
    May 2011
    Posts
    14

    Problem with CAudioEqualizerUtility::NewL

    Hello everybody!
    I stick to a real problem with CAudioEqualizerUtility::NewL(*iMdaAudioPlayerUtility). [I use Symbian Belle N8 device with the latest firmware and latest QT SDK]

    Actually I have a really simple code like this:

    iAudioOutputStream = NULL;
    iMdaAudioPlayerUtility = NULL;
    iMdaAudioPlayerUtility = CMdaAudioPlayerUtility::NewL(myCallBack); //this woks fine - i've got a true handler to the object

    //the next line crashes completely!! - app just got crashed... I tryied everything, but nothing helps...
    if (iMdaAudioPlayerUtility) iAudioEqualizerUtility = CAudioEqualizerUtility::NewL(*iMdaAudioPlayerUtility);

    if I use
    TRAPD(err,
    iAudioEqualizerUtility = CAudioEqualizerUtility::NewL(*iMdaAudioPlayerUtility);
    );
    if (err == KErrNoMemory) User::Exit(KErrNoMemory);

    the err returns KErrNotFound. What does it means? And what can I do to solve the issue? Thank you very much!!
    I'll really appreciate you help!!

  2. #2
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,037

    Re: Problem with CAudioEqualizerUtility::NewL

    Not sure if it can help but you may try replacing CMdaAudioPlayerUtility::NewL() with CMdaAudioPlayerUtility::NewFilePlayerL()

  3. #3
    Registered User
    Join Date
    May 2011
    Posts
    14

    Re: Problem with CAudioEqualizerUtility::NewL

    well, actually I've tryied, but result is the same. I've also tryied it with MdaOutputStream and NewL goest Ok for CAudioEqualizerUtility, but crashes when I try to create new Equalizer...
    So it seems like a general problem with memory, but I don't have any idea where to go.. Actually I made a simple project with only this "5 lines" and still have the problem. Probably something wrong with the device??

  4. #4
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,037

    Re: Problem with CAudioEqualizerUtility::NewL

    you may also try testing it on some lower version of Symbian OS device then Belle to see if its a OS version issue or else.

    An example app is also here in wiki, you may try running it to see if the problem persists in it as well : http://www.developer.nokia.com/Commu...B_audio_player

  5. #5
    Registered User
    Join Date
    May 2011
    Posts
    14

    Re: Problem with CAudioEqualizerUtility::NewL

    unfortunatelly i don't have another device currently... (
    will try to get one...

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,697

    Re: Problem with CAudioEqualizerUtility::NewL

    Two things you may find useful:
    - here is how you can enable the error messages on the device: http://www.developer.nokia.com/Commu...ded_panic_code
    - you can actually test your code on a large number of devices, via RDA (Remote device access in "Devices" panel above, direct link: http://rda.cellulardata.com/)

  7. #7
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,037

    Re: Problem with CAudioEqualizerUtility::NewL

    Quote Originally Posted by wizard_hu_ View Post
    - here is how you can enable the error messages on the device: http://www.developer.nokia.com/Commu...ded_panic_code
    KErrNotFound already mentioned in #1.

    EDIT: that is not a crash code...

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,697

    Re: Problem with CAudioEqualizerUtility::NewL

    Quote Originally Posted by vineet.jain View Post
    KErrNotFound already mentioned in #1.

    EDIT: that is not a crash code...
    Yes, I know. Just based on that "if (err == KErrNoMemory) User::Exit(KErrNoMemory);", pls125 might have chosen some tedious way for checking the error code. Keeping the messages enabled may simplify such TRAP-s and checks.

  9. #9
    Registered User
    Join Date
    May 2011
    Posts
    14

    Re: Problem with CAudioEqualizerUtility::NewL

    Well, I'm completely confused and it seems that I'm a totally misunderstand something... but I can't solve the issue still. Actually I've tryied other phones and got the same results.
    So I've made absolutely simple code as following and it crushes at CAudioEqualizerUtility::NewL step:

    mainwindow.h
    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H

    #include <QMainWindow>

    #include <AudioEqualizerUtility.h>
    #include <AudioEqualizerBase.h>
    #include <mdaaudiosampleplayer.h>

    class FMMdaAudioPlayerCallback: public MMdaAudioPlayerCallback
    {
    public:
    void MapcInitComplete ( TInt aError,
    const TTimeIntervalMicroSeconds & aDuration
    ) {}
    void MapcPlayComplete ( TInt aError )
    {}
    }
    ;


    namespace Ui {
    class MainWindow;
    }

    class MainWindow : public QMainWindow
    {
    Q_OBJECT

    public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    private:
    Ui::MainWindow *ui;


    FMMdaAudioPlayerCallback myCallBack;
    CMdaAudioPlayerUtility* iMdaAudioPlayerUtility;
    CAudioEqualizerUtility* iAudioEqualizerUtility;
    };

    #endif // MAINWINDOW_H

    mainwindow.cpp
    #include "mainwindow.h"
    #include "ui_mainwindow.h"

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);

    iMdaAudioPlayerUtility = NULL;
    iMdaAudioPlayerUtility = CMdaAudioPlayerUtility::NewL(myCallBack);
    iAudioEqualizerUtility = NULL;
    if (!iAudioEqualizerUtility)
    iAudioEqualizerUtility = CAudioEqualizerUtility::NewL(*iMdaAudioPlayerUtility);
    //the program exit at this point
    CAudioEqualizer *iAudioEqualizer;
    iAudioEqualizer = iAudioEqualizerUtility->Equalizer().NewL(*iMdaAudioPlayerUtility);
    int NumberOfBands = iAudioEqualizer->NumberOfBands();
    if (NumberOfBands>0) {
    if (NumberOfBands>0) {
    ..............
    }
    }
    }

    MainWindow::~MainWindow()
    {
    delete ui;
    }
    #include <QtGui/QApplication>
    #include "mainwindow.h"

    main.cpp
    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    MainWindow w;
    #if defined(Q_WS_S60)
    w.showMaximized();
    #else
    w.show();
    #endif

    return a.exec();
    }
    PRO file:
    #-------------------------------------------------
    #
    # Project created by QtCreator 2012-10-29T16:11:42
    #
    #-------------------------------------------------

    QT += core gui

    TARGET = EQUtilTest
    TEMPLATE = app


    SOURCES += main.cpp\
    mainwindow.cpp

    HEADERS += mainwindow.h

    FORMS += mainwindow.ui

    CONFIG += mobility
    MOBILITY =

    symbian {
    TARGET.UID3 = 0xec11c862
    # TARGET.CAPABILITY +=
    TARGET.EPOCSTACKSIZE = 0x14000
    TARGET.EPOCHEAPSIZE = 0x020000 0x800000
    LIBS+= -lAudioEqualizerEffect -lAudioEqualizerUtility -lmediaclientaudio
    }
    Where is the problem could be?
    Thank you in advance! I really appreciate your help!

  10. #10
    Registered User
    Join Date
    Jan 2009
    Location
    Melbourne, Australia
    Posts
    2,571

    Re: Problem with CAudioEqualizerUtility::NewL

    Just a guess ...

    you're using the CMdaAudioPlayerUtility::NewL which doesn't specify a file to be played/used. It may be that the CAudioEqualizerUtility does some check on the existence of the file to be played which would be consistent with the KErrNotFound ( This is effectively what Vineet is suggesting)

    You might want to compare your code to this: http://www.developer.nokia.com/Commu...B_audio_player

  11. #11
    Registered User
    Join Date
    May 2011
    Posts
    14

    Re: Problem with CAudioEqualizerUtility::NewL

    Quote Originally Posted by hamishwillee View Post
    Just a guess ...

    you're using the CMdaAudioPlayerUtility::NewL which doesn't specify a file to be played/used. It may be that the CAudioEqualizerUtility does some check on the existence of the file to be played which would be consistent with the KErrNotFound ( This is effectively what Vineet is suggesting)

    You might want to compare your code to this: http://www.developer.nokia.com/Commu...B_audio_player
    Thank for the input. Sure, I've studied this article many times ). Actually if I use NewFilePlayerL the AudioEqualizerUtility initiates without any issues, BUT AudioEqualizerUtility->Presets().Count() returns zero. Is that Ok? I can see some default presets in the embedded Audio Player...
    Futhermore I try to create a new preset using AudioEqualizer = AudioEqualizerUtility->Equalizer().NewL and it works Ok. But whe I try to get frequency by AudioEqualizer->CenterFrequency(...) - it crushes again... (

  12. #12
    Registered User
    Join Date
    Jan 2009
    Location
    Melbourne, Australia
    Posts
    2,571

    Re: Problem with CAudioEqualizerUtility::NewL

    This is not an API I've ever used, so the "general answer" is
    1. So given that NewFilePlayerL works you could try the New version but set the file to play to verify the cause of your previous crash.
    2. If I were you I'd be trying the existing example code - extending it where necessary. So for example if AudioEqualizerUtility->Presets().Count() returns zero on the example that is probably "OK". Does AudioEqualizer->CenterFrequency(...) work on the example code (and if not, search on this)

  13. #13
    Nokia Developer Expert
    Join Date
    Sep 2011
    Posts
    382

    Re: Problem with CAudioEqualizerUtility::NewL

    Quote Originally Posted by pls125 View Post
    Thank for the input. Sure, I've studied this article many times ). Actually if I use NewFilePlayerL the AudioEqualizerUtility initiates without any issues, BUT AudioEqualizerUtility->Presets().Count() returns zero. Is that Ok? I can see some default presets in the embedded Audio Player...
    Futhermore I try to create a new preset using AudioEqualizer = AudioEqualizerUtility->Equalizer().NewL and it works Ok. But whe I try to get frequency by AudioEqualizer->CenterFrequency(...) - it crushes again... (
    Implementations involving the output stream could be useful:
    // TRAPD(err, iAudioEffect = CAudioEqualizer::NewL(*iOutputStream))

    /0

Similar Threads

  1. problem with CGulIcon::NewL
    By the86hitman in forum Symbian
    Replies: 1
    Last Post: 2009-08-22, 12:39
  2. Using CAudioEqualizerUtility
    By nguyen in forum Symbian Media (Closed)
    Replies: 5
    Last Post: 2009-01-12, 15:42
  3. caudioequalizerutility or caudioequalizer
    By shivsharad in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2008-02-07, 10:06
  4. CTelephony::NewL problem
    By ganesh123 in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2007-04-17, 06:00
  5. CTelephony::NewL problem
    By ganesh123 in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2007-04-17, 06:00

Posting Permissions

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