0

I wrote a streaming radio app that is fairly basic in functionality but some devices refuse to "prepare" such as my Optimus One running 2.2. My app runs on other 2.2 devices any my brother's S2 running 2.3 and my Prime running 4.0.3.

Any idea why my specific devise will not prepare the audio?

Edit: Added some code below

private void togglePlay() {
    try {
        if(!this.player.isPlaying()) {
            this.player.setAudioStreamType(AudioManager.STREAM_MUSIC);
            this.player.setDataSource(this.address);
            this.player.prepareAsync();
        } else {
            this.player.reset();
        }
    } catch (IllegalArgumentException e) {
        ;
    } catch (IllegalStateException e) {
        ;
    } catch (IOException e) {
        ;
    }
}

Edit: Added ADB log

03-09 08:17:26.933: I/ActivityManager(1352): Starting activity: Intent { cmp=com.landonmanning.mediaplayer.celestiaradio/.Media }
03-09 08:17:27.003: V/PVPlayer(1281): PVPlayer constructor
03-09 08:17:27.003: V/PVPlayer(1281): construct PlayerDriver
03-09 08:17:27.003: V/PlayerDriver(1281): constructor
03-09 08:17:27.013: V/PlayerDriver(1281): OpenCore hardware module loaded
03-09 08:17:27.013: V/PlayerDriver(1281): start player thread
03-09 08:17:27.023: V/PlayerDriver(1281): startPlayerThread
03-09 08:17:27.023: V/PlayerDriver(1281): InitializeForThread
03-09 08:17:27.023: V/PlayerDriver(1281): OMX_MasterInit
03-09 08:17:27.043: V/PlayerDriver(1281): OsclScheduler::Init
03-09 08:17:27.043: V/PlayerDriver(1281): CreatePlayer
03-09 08:17:27.083: V/PlayerDriver(1281): AddToScheduler
03-09 08:17:27.083: V/PlayerDriver(1281): PendForExec
03-09 08:17:27.083: V/PlayerDriver(1281): OsclActiveScheduler::Current
03-09 08:17:27.083: V/PlayerDriver(1281): StartScheduler
03-09 08:17:27.093: V/PVPlayer(1281): send PLAYER_SETUP
03-09 08:17:27.093: V/PlayerDriver(1281): Send player code: 2
03-09 08:17:27.093: V/PlayerDriver(1281): CommandCompleted
03-09 08:17:27.093: V/PlayerDriver(1281): Completed command PLAYER_SETUP status=PVMFSuccess
03-09 08:17:27.093: V/PVPlayer(1281): setDataSource(http://molestia.ponify.me:8062)
03-09 08:17:27.093: V/PVPlayer(1281): prepareAsync
03-09 08:17:27.093: V/PVPlayer(1281):   data source = http://molestia.ponify.me:8062
03-09 08:17:27.103: V/PlayerDriver(1281): Send player code: 3
03-09 08:17:27.103: V/PlayerDriver(1281): handleSetDataSource
03-09 08:17:27.103: V/PlayerDriver(1281): handleSetDataSource- scanning for extension
03-09 08:17:27.193: V/PlayerDriver(1281): CommandCompleted
03-09 08:17:27.193: V/PlayerDriver(1281): Completed command PLAYER_SET_DATA_SOURCE status=PVMFSuccess
03-09 08:17:27.193: V/PVPlayer(1281): run_init s=0, cancelled=0
03-09 08:17:27.193: V/PlayerDriver(1281): Send player code: 6
03-09 08:17:27.193: V/PlayerDriver(1281): release string is 2.2 len 3
03-09 08:17:27.453: D/StatusBarPolicy(1352): [BRIGHTHY] 0. mDataNetType: 3
03-09 08:17:27.453: D/StatusBarPolicy(1352): [BRIGHTHY] curNetwork=302220 curHPLMN=302220
03-09 08:17:27.903: I/ActivityManager(1352): Displayed activity com.landonmanning.mediaplayer.celestiaradio/.Media: 951 ms (total 4183 ms)
03-09 08:17:28.123: V/PlayerDriver(1281): HandleInformationalEvent: PVMFInfoErrorHandlingStart
03-09 08:17:28.123: V/PlayerDriver(1281): HandleInformationalEvent: type=26 UNHANDLED
03-09 08:17:28.123: W/MediaPlayer(20004): info/warning (1, 26)
03-09 08:17:28.123: I/MediaPlayer(20004): Info (1,26)
03-09 08:17:28.133: V/PlayerDriver(1281): CommandCompleted
03-09 08:17:28.133: V/PlayerDriver(1281): Completed command PLAYER_INIT status=PVMFFailure
03-09 08:17:28.133: E/PlayerDriver(1281): Command PLAYER_INIT completed with an error or info PVMFFailure, -1
03-09 08:17:28.133: E/MediaPlayer(20004): error (1, -1)
03-09 08:17:28.133: E/MediaPlayer(20004): Error (1,-1)
03-09 08:17:28.133: V/PVPlayer(1281): run_set_video_surface s=-2147483648, cancelled=0
03-09 08:17:28.133: V/PlayerDriver(1281): HandleInformationalEvent: PVMFInfoErrorHandlingComplete
03-09 08:17:28.133: W/PlayerDriver(1281): PVMFInfoErrorHandlingComplete
NullUserException
  • 83,810
  • 28
  • 209
  • 234
Karai17
  • 923
  • 2
  • 9
  • 26

3 Answers3

0

You made need to drop a release() in there first. It could be crashing due to multiple mediaplayer instances.

Andy
  • 75
  • 1
  • 8
0

The interesting line from the log is this one:

Command PLAYER_INIT completed with an error or info PVMFFailure, -1

That's your error code, -1, which unfortunately is utterly generic ... it has no particular meaning. Fortunately the name, PVMFFailure is suitably Googlable... it looks from the linked thread that the media format is a likely suspect. Older platforms probably can't handle the same bitrates and formats as newer ones.

https://groups.google.com/forum/?fromgroups#!topic/android-developers/6uGbh37bVEQ

Reuben Scratton
  • 38,595
  • 9
  • 77
  • 86
  • The same radio stream works well using XiiaLive. I'm not really sure what XiiaLitve does differantly than me but running ADB on that app shows they are using the MediaPlayer view and it is able to prepare properly. – Karai17 Mar 09 '12 at 18:10
  • You're saying that XiaaLive succeeds and your app fails *on the same device*? – Reuben Scratton Mar 09 '12 at 19:55
0

I just flashed CyanogenMod 7 on my phone and my app now works great. Apparently LG is retarded and likes to break things. Still not sure why other apps work and mine didn't but I'll just have to add a note to my app description explaining the issue to other LG users.

Karai17
  • 923
  • 2
  • 9
  • 26