December 7, 2010

hisong1988 hisong1988
Lab Rat
72 posts

Can backend of Phonon in Symbian support mp3 with an url?

Page  
1

Thanks xsacha and tamhanna who give me so much help in the http://developer.qt.nokia.com/forums/viewthread/2161 [developer.qt.nokia.com]

Now I have another new problems:
I could play the RTSP protocol URL,like “rtsp://qt2.netro.ca/princess_54.3gp” ,etc.
But I still couldn’t play the URL like “http://www.sheyy.net/mp3/she/music7.mp3”.

when I load the http URL, the app showed “Loading clio failed: Not supported”
I supposed that the backend not support the http protocol.

And I used the QMediaPlayer of QtMobility to play the Http URL, there is no effect. It showed nothing only I could see the active network.

My qt for Symbian is 4.7.1 and mobility is 1.1.0. I used Nokia 5230 and 5800 to test my app.

Anyone would help me? Or anyone would show me how to play http-mp3-URL with Qt?
Thx very much.

 Signature 

I am still searching for….

19 replies

December 7, 2010

xsacha xsacha
Lab Rat
517 posts

I’m pretty sure it doesn’t mind the protocol (http), but might not like mp3. I had problems with it on Ubuntu until I included gstreamer backend for Phonon.

If you have some test code that just plays an mp3/3gp with Qt (Phonon/QMediaPlayer), I could test it out and try and get it to work for you.

 Signature 

- Sacha

December 8, 2010

hisong1988 hisong1988
Lab Rat
72 posts

Hi,Sacha.
For your reminding, I search gstreamer for Symbian, and found this article gstream on symbian [wiki.forum.nokia.com]++

I decided to transplant the Gstreamer to Symbian, and then I found that the Gstreamer just support AU, RAW, WAV, AMR-NB, G711, G729, ILBC. file. It seems not support mp3 file.

The QMediaPlayer could play mp3 files via internet. But I haven’t had a success on the hard device(5th or 3rd)
The test code was very simple:

  1. QMediaPlayer *player=new QMediaPlayer(this);
  2. player->setMedia(QUrl("http://www.cenet.org.cn/userfiles/2009-2-9/20090209213949675.mp3"));
  3. player->setVolume(60);
  4. player->play();

I build a project of a Qt mobile Application(with UI). and add the code above to the constructor of the project.
I tested the app to play local mp3 file if I changed the URL as a local URL.

 Signature 

I am still searching for….

December 8, 2010

hisong1988 hisong1988
Lab Rat
72 posts

Oh,Sacha. I install the newest creator2.1 RC. and I found there are many Warning in my project when I built the project.
It shows:

  1. WARNING: \QtProject\audioTest\AUDIOTEST_0XE2835CA1.MMP(53) : SYSTEMINCLUDE path "\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\include\osextensions\stdapis\" not found
  2.  
  3. WARNING: \QtProject\audioTest\AUDIOTEST_0XE2835CA1.MMP(54) : SYSTEMINCLUDE path "\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\include\osextensions\stdapis\sys\" not found
  4.  
  5. WARNING: \QtProject\audioTest\AUDIOTEST_0XE2835CA1.MMP(57) : SYSTEMINCLUDE path "\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\include\oem\" not found
  6.  
  7. WARNING: \QtProject\audioTest\AUDIOTEST_0XE2835CA1.MMP(60) : SYSTEMINCLUDE path "\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\include\osextensions\" not found
  8.  
  9. WARNING: \QtProject\audioTest\AUDIOTEST_0XE2835CA1.MMP(61) : SYSTEMINCLUDE path "\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\include\domain\osextensions\" not found
  10.  
  11. WARNING: \QtProject\audioTest\AUDIOTEST_0XE2835CA1.MMP(62) : SYSTEMINCLUDE path "\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\include\domain\osextensions\loc\" not found
  12.  
  13. WARNING: \QtProject\audioTest\AUDIOTEST_0XE2835CA1.MMP(64) : SYSTEMINCLUDE path "\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\include\domain\osextensions\loc\sc\" not found
  14.  
  15. WARNING: \QtProject\audioTest\AUDIOTEST_0XE2835CA1.MMP(65) : SYSTEMINCLUDE path "\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\include\domain\middleware\loc\sc\" not found
  16.  
  17. WARNING: \QtProject\audioTest\AUDIOTEST_0XE2835CA1.MMP(70) : SYSTEMINCLUDE path "\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\include\osextensions\stdapis\stlport\" not found

Does the warning effect my project?

 Signature 

I am still searching for….

December 8, 2010

xsacha xsacha
Lab Rat
517 posts

Those warnings are normal. I always get them. It’s just including some paths in case they are there I think.

I did not think GStreamer is the problem for Symbian, but for Linux. There may be a similar problem with mp3 codecs though.

I will try this code out and find why it doesn’t work, thanks!
I have hope because when searching for bugs I found none except for the N8 (initial firmware can’t play mp3 with qmediaplayer).

 Signature 

- Sacha

December 8, 2010

hisong1988 hisong1988
Lab Rat
72 posts

Thank you very much for your test.

The app will emit a signal while the app can’t play the music.

I have just tried to catch errors by a messagebox when running the app with using SIGNAL/SLOT.

the error I catch are “ResourceError” and “AccessDeniedError”, It seems that the QMediaPlayer play files depended on the codec on the phone, I think.

 Signature 

I am still searching for….

December 8, 2010

hisong1988 hisong1988
Lab Rat
72 posts

Hi,Sacha.
If I want to develop an app that could play music via an URL using Symbian SDK.

Waht should I do? Would you give me some hints?

 Signature 

I am still searching for….

December 8, 2010

xsacha xsacha
Lab Rat
517 posts

Using: C:\Qt\4.7.1-symbian\demos\qmediaplayer\qmediaplayer.pro
It uses Phonon back-end and plays MP3s perfectly on Nokia 5800 here :)

Edit: Nevermind, only local files. HTTP not working as you said.

Edit#2: Got it working using HTTP with: C:\Qt\mobility110\demos\player\player.pro

In ‘player.cpp’ change the following function:

  1. void Player::open()
  2. {
  3.     playlist->addMedia(QUrl("http://www.sheyy.net/mp3/she/music7.mp3"));
  4. }

Then run the app on the device, click Open then Play.

So it seems QMediaPlayer works, Phonon doesn’t work.

 Signature 

- Sacha

December 8, 2010

hisong1988 hisong1988
Lab Rat
72 posts

Hi,Sacha. I’m sorry to bother you again.

I’m almost in desperation.

I try as you said above: I add the code to the open() function the following:

  1. void Player::open()
  2. {
  3. #ifdef Q_WS_MAEMO_5
  4.     QStringList fileNames;
  5.     QString fileName = QFileDialog::getOpenFileName(this, tr("Open Files"), "/");
  6.     if (!fileName.isEmpty())
  7.         fileNames << fileName;
  8. #else
  9.     QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Open Files"));
  10.     playlist->addMedia(QUrl("http://www.sheyy.net/mp3/she/music7.mp3"));*
  11. #endif
  12.     addToPlaylist(fileNames);
  13. }

and I built the project,I clicked “open”, and then arose a dialog,and I cancel it.
the “music” item appeared. I clicked the “music7.mp3” item.
and then the app showed “loading” and then “Buffering 0%”,and last: no sound.
I also tested it on the 5800 device.

I could see the active network.
the player can play the local mp3 file. = =

 Signature 

I am still searching for….

December 8, 2010

xsacha xsacha
Lab Rat
517 posts

Did it connect to a network? You saw it connect to WiFi/3G? It may be that networking was not enabled.

 Signature 

- Sacha

December 8, 2010

hisong1988 hisong1988
Lab Rat
72 posts

Sorry to reply so late.

I can use the network to surf the internet. so the network is all right.
I couldn’t use 3G now. only I could use are GSM and WIFI.

 Signature 

I am still searching for….

December 8, 2010

xsacha xsacha
Lab Rat
517 posts

Can you be sure you are compiling with QtMobility 1.10 and not QtMobility 1.02?
It is actually a bit difficult to install over NokiaQtSDK.

 Signature 

- Sacha

December 8, 2010

hisong1988 hisong1988
Lab Rat
72 posts

Yes. I download from here [qt.nokia.com]

 Signature 

I am still searching for….

December 8, 2010

xsacha xsacha
Lab Rat
517 posts

Did you compile? Just wondering how you installed. I think you may still be using 1.02?

Do you have playlist->setCurrentIndex(..) or playlist->setCurrentPosition(..)?
setCurrentIndex is 1.02 API, setCurrentPosition is 1.10 API afaik.

I ask because I just installed 1.02 and got this thing with Buffering.. 0%. It seems the HTTP loading in 1.02 is just empty (no code).

The documentation [doc.qt.nokia.com] says to use this:

  1. player = new QMediaPlayer;
  2.  
  3. playlist = new QMediaPlaylist(player);
  4. playlist->addMedia(QUrl("http://example.com/myfile1.mp3"));
  5. playlist->addMedia(QUrl("http://example.com/myfile2.mp3"));
  6.  ...
  7. playlist->setCurrentPosition(1);
  8. player->play();

 Signature 

- Sacha

December 8, 2010

hisong1988 hisong1988
Lab Rat
72 posts

Oh,I never changed the version of Qt mobility.

I didn’t compile the Qt mobility. I downloaded the binary version of mobility. and decompression to the corresponding directory followed the course [wiki.forum.nokia.com]

 Signature 

I am still searching for….

December 8, 2010

xsacha xsacha
Lab Rat
517 posts

Oh, I just checked the QtMobility 1.10 they offer at that link. Very strange, it seems outdated?? It also uses setCurrentIndex.
I don’t know what’s going on honestly, lol.

 Signature 

- Sacha

Page  
1

  ‹‹ Augmented reality in Qt      Application is Closed ››

You must log in to post a reply. Not a member yet? Register here!