×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Nokia Developer Champion
    Join Date
    Apr 2007
    Posts
    2,708

    Unknown Error message MMAPI

    Hi,
    whilst playing osmewhat with the MMAPI's I am receiving this error :
    Error : javax.microedition.media.MediaException: MUS
    I actually cannot find any documentation regarding this, so I was wodnering if anyone else has ever encountered this ?
    The error is only manifested on a S40 5th edition device and also on the same Nokia Emulator...
    On a N95 I am not getting this error...

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Unknown Error message MMAPI

    Any idea which method throws the exception?

    What are you trying to play?

  3. #3
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: Unknown Error message MMAPI

    This comes from the Player, when it could not create/connect to the DataSource due to some error, because you might be tring to play a live streaming content from server and S40 does not support it. Try to Capture the live stream in chunks and play, one after the other.

    thanks,
    ~Amitabh

  4. #4
    Nokia Developer Champion
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Unknown Error message MMAPI

    hhmm.. thats exactly what i am doing im2amit...
    I am already chopping the "stream" in chunks.. and I'm using "stream" because it's actually NOT a stream but a simple 1.5 megabyte MP3 file which is stored on a server...

    Also the exception is caught while trying to do player.prefetch()... But not on a server-stream but on a ByteArrayInputStream :

    Code:
    HttpConnection conn = (HttpConnection)Connector.open(url, Connector.READ_WRITE);
            
    InputStream is2 = conn.openInputStream();
    size = is2.read(buf);
            
    ByteArrayInputStream bis = new ByteArrayInputStream(buf);
    
    player = Manager.createPlayer(bis,"audio/mpeg");
    
    player.prefetch();
    do you have any link to any documentation or explanation regarding this exception im2amit ?

  5. #5
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: Unknown Error message MMAPI

    See the problem is with the underlining platform that doesnt support streaming.... i.e. the Player tries to prefech the entire MP3 content but your buf is just one chunk of it, so it fails on S40 and works on S60 with supports streaming.

    For test try to put a small MP3 file which completely go inside your buf and you will see if will play -- {solution - you make mutiple small mp3 files on the server}

    or you may need to just add <Start> <EOF> headers/footers of MP3 file to each of your buf before passing it to the player on the client side.

    thanks,
    ~Amitabh

  6. #6
    Nokia Developer Champion
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Unknown Error message MMAPI

    hhmm..
    ok but in the moment I place a chunk in an array it just stops to be a MP3 chunck and simply becomes a byte array with data... after which I tell the player that he can interpret this byte array as an "audio/mpeg" data array... So no headers nor footers should be needed nor expected.. after all I can play .aac as a "audio/mpeg" as well whilst it's not exactly MP3 is it ?
    also the S40's I am talking about actually should support streaming through progressive download.. I am testing on S40 3th FP2 and S40 5th edition... I had another topic about that but unfortunately no-one replied on that...

  7. #7
    Nokia Developer Champion
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Unknown Error message MMAPI

    Oki I tried a complete MP3 file which was around 86Kb and I used 96Kb chunks, still getting the same error on the S40 5th edition emulator...

  8. #8
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Unknown Error message MMAPI

    Just to check the obvious... you checked the return value from read(), and it's read as much as you think?

  9. #9
    Nokia Developer Champion
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Unknown Error message MMAPI

    on the small mp3 file (86Kb) I do get a nice 86606 as return value from is2.read()...
    or should it be tried on the big file (multiple-chunks) ?

    Just checked on the bigger file it returns the buffer size with the is2.read()...

  10. #10
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Unknown Error message MMAPI

    OK. So you're definitely passing the entire (small) file to the API.

    What if you put the small MP3 file in the JAR, and play if from there...?

  11. #11
    Nokia Developer Champion
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Unknown Error message MMAPI

    hhmm.. getting same error on the emulator but it's playing fine on the real device...
    btw, when downloading in chunks it actually played for like 3-4 chunks on real device before getting the error...
    also, I have to admit there is no sound card atm in the development machine which might (or might not) cause the error right away on the emulator ?

    oki just checked on another machine with sound card and I would get same error the second loop...

  12. #12
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Unknown Error message MMAPI

    How are you disposing of Players when they've finished?

    Ideally, use a PlayerListener to pick up events like END_OF_MEDIA and STOPPED, and either close() or deallocate() the Player.

    When you say "second loop", are you using setLoopCount(), re-start()ing the same Player, or creating another Player from the same data?

  13. #13
    Nokia Developer Champion
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Unknown Error message MMAPI

    well actually Im not using setLoopCount(), I am just reinstantiating the same object with the same buffer only new data will be inside it...

  14. #14
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Unknown Error message MMAPI

    So, another call to createPlayer()? What do you do with the old Player?

    When a Player is prefetched, it acquires hardware buffers. If you don't deallocate() the Player, those resource won't get released, and you'll become unable to create any more Players (for that media-type).

    Could this be the problem?

    Graham.

  15. #15
    Nokia Developer Champion
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Unknown Error message MMAPI

    Well, I thought about that and I tried both close() and deallocate() actually when the player get the END_OF_MEDIA interrupt (through playerListener's passed event), but it actually didn't make any difference at all...
    On the device it still plays like 6-7 chunks (using two Players) and then I get that MUS error...
    Still I haven't found a list of al MediaException errors and what they specifically mean... That would be of help to begin with : just knowing what kind of error this is...

Similar Threads

  1. Head Set Status
    By arunmdevan in forum Symbian
    Replies: 15
    Last Post: 2009-02-28, 04:30
  2. illegal use of abstract class error...
    By kannabiran.krish in forum Symbian
    Replies: 7
    Last Post: 2007-08-17, 10:11
  3. Errors compilling and debugging Helloworld
    By doberlet in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2004-03-04, 18:08
  4. Codewarrior import .mmp error
    By serenade in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2004-02-21, 20:06

Posting Permissions

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