Confirm MediaPlayer automatic retry on streaming HTTP error

by Skyler » Fri, 20 May 2011 09:34:08 GMT


Sponsored Links
 Hi all,
I have an app which streams mp3s from the web, proxied through a local HTTP 
server. At times, this local proxy server returns an HTTP error. It seems 
that upon receiving this error during the prepare state, the MediaPlayer 
makes one more attempt to stream, sending another request to the URL 
specified in setDataSource().

thread, I can see that after sending an HTTP error response, another request 
for the same URL is made. Can someone confirm this behavior? I'm seeing this 
from the emulator running a 1.6 AVD.

Additionally, can I disable this automatic retry? Is there a specific HTTP 
error code that I can send that will prevent this retry?

Thanks!

-- 



Other Threads

1. problem in service in manifest file

Hello,

I have created the one class named MyService which extends Service. it
is in com.saltriver.service package. Now  can some one tell me how i
should specified it in anroidmanfiest.xml file. The following is
content of xml file but it is giving error in <service>. so can some
one tell me what is wrong in it.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.saltriver.service"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/
app_name">
        <activity android:name=".ServiceExample"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category
android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
    <service android:name=".service.MyService"/>

<intent-filter>


</intent-filter>

</service>
    <uses-sdk android:minSdkVersion="3" />
</manifest>


--~--~---------~--~----~------------~-------~--~----~

2. Video Capture with sounder Crashed(cupcake 1.5 opencore 2.03)

Hi  everyone

 I want to capture videos with sounde, but when I click start button,
the video captrure application crashed, and can not preview, but the
time counter  is still run, and if I click button to stop video
capture , the camrecorder can back to preview state.


If I  capture audio single ,the mediarecorder can  work successfully.
and if I capture video without audio  the libopencore_authore.lib and
libopencore_common.lib will shown a poniter error and then crashed.
but If I deleted the statemen:

OSCL_EXPORT_REF
void AndroidCameraInput::setPeer(PvmiMediaTransfer* aPeer)
{
    LOGV("setPeer");
    if (iPeer || !aPeer) {
        if (iPeer) {
            LOGE("iPeer already exists");
        } else {
            LOGE("aPeer is a NULL pointer");
        }
//        OSCL_LEAVE(OsclErrGeneral);      //delete this statement
        return;
    }

    iPeer = aPeer;
}



in android_camera_input.cpp  , it can success.




Can someone tell why  and how to resolve the error to achieve
capturing video including audio?  my error log information is :


V/videocamera( 2245): startVideoRecording
W/AuthorDriverWrapper( 1805): AuthorDriverWrapper::enqueueCommand(int
*max)
W/AuthorDriver( 1805): AuthorDriver::enqueueCommand
W/AuthorDriver( 1805): AuthorDriver::Run
W/AuthorDriver( 1805): AuthorDriver::dequeueCommand()
W/AuthorDriver( 1805): AuthorDriver::handleStart(author_command *ac)

W/audio_input( 1805): Start
W/CameraInput( 1805): ++++++++++AndroidCameraInput::Run()
D/CameraService( 1805): startCameraMode(1)
W/audio_input( 1805): +++++++++DoStart
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/audio_input( 1805): create  AudioRecord 0x52e48

W/audio_input( 1805): AudioRecord created 0x85618, this 0x52e48
E/ALSALib ( 1805): external/alsa-lib/src/pcm/pcm.c:2201:
(snd_pcm_open_noupdate) Unknown PCM AndroidRecord_Off_idle
E/ALSALib ( 1805): external/alsa-lib/src/pcm/pcm.c:2201:
(snd_pcm_open_noupdate) Unknown PCM AndroidRecord_Off
E/ALSALib ( 1805): external/alsa-lib/src/pcm/pcm.c:2201:
(snd_pcm_open_noupdate) Unknown PCM AndroidRecord
I/AudioHardwareALSA( 1805): Initialized ALSA CAPTURE device hw:00,0
D/AudioHardwareALSA( 1805): Set CAPTURE PCM format to S16_LE (Signed
16 bit Little Endian)
D/AudioHardwareALSA( 1805): Using 1 channel for CAPTURE.
D/AudioHardwareALSA( 1805): Set CAPTURE sample rate to 8000 HZ
D/AudioHardwareALSA( 1805): Buffer size: 2048
D/AudioHardwareALSA( 1805): Latency: 256000
D/AudioHardwareALSA( 1805): ###In open Input Steam
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
D/dalvikvm( 2042): GC freed 171 objects / 7288 bytes in 122ms
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
E/ALSALib ( 1805): external/alsa-lib/src/pcm/pcm.c:2201:
(snd_pcm_open_noupdate) Unknown PCM AndroidRecord_Speaker_normal
E/ALSALib ( 1805): external/alsa-lib/src/pcm/pcm.c:2201:
(snd_pcm_open_noupdate) Unknown PCM AndroidRecord_Speaker
E/ALSALib ( 1805): external/alsa-lib/src/pcm/pcm.c:2201:
(snd_pcm_open_noupdate) Unknown PCM AndroidRecord
I/AudioHardwareALSA( 1805): Initialized ALSA CAPTURE device hw:00,0
D/AudioHardwareALSA( 1805): Set CAPTURE PCM format to S16_LE (Signed
16 bit Little Endian)
D/AudioHardwareALSA( 1805): Using 1 channel for CAPTURE.
D/AudioHardwareALSA( 1805): Set CAPTURE sample rate to 8000 HZ
D/AudioHardwareALSA( 1805): Buffer size: 2048
D/AudioHardwareALSA( 1805): Latency: 256000
W/audio_input( 1805): AndroidAudioInput::audin_thread_func()  L1
W/AuthorDriver( 1805): CommandCompleted(const PVCmdResponse&
aResponse)
W/AuthorDriver( 1805): AuthorDriver::syncCompletion()
W/CameraInput( 1805): ++++++++++AndroidCameraInput::Run()
V/videocamera( 2245): startVideoRecording  L5
W/        ( 1805): ++++++++++PvmfMediaInputNodeOutPort::writeAsync()
W/        ( 1805): PVMI_MEDIAXFER_FMT_TYPE_DATA == format_type()
W/        ( 1805): ++++++++++PvmfMediaInputNodeOutPort::writeAsync()
W/        ( 1805): PVMI_MEDIAXFER_FMT_TYPE_DATA == format_type()
W/        ( 1805): ++++++++++PvmfMediaInputNodeOutPort::writeAsync()
W/        ( 1805): PVMI_MEDIAXFER_FMT_TYPE_DATA == format_type()
W/        ( 1805): ++++++++++PvmfMediaInputNodeOutPort::writeAsync()
W/        ( 1805): PVMI_MEDIAXFER_FMT_TYPE_DATA == format_type()
W/        ( 1805): ++++++++++PvmfMediaInputNodeOutPort::writeAsync()
W/        ( 1805): PVMI_MEDIAXFER_FMT_TYPE_DATA == format_type()
W/        ( 1805): ++++++++++PvmfMediaInputNodeOutPort::writeAsync()
W/        ( 1805): PVMI_MEDIAXFER_FMT_TYPE_DATA == format_type()
W/        ( 1805): ++++++++++PvmfMediaInputNodeOutPort::writeAsync()
W/        ( 1805): PVMI_MEDIAXFER_FMT_TYPE_DATA == format_type()
W/        ( 1805): ++++++++++PvmfMediaInputNodeOutPort::writeAsync()
W/        ( 1805): PVMI_MEDIAXFER_FMT_TYPE_DATA == format_type()
W/        ( 1805): ++++++++++PvmfMediaInputNodeOutPort::writeAsync()
W/        ( 1805): PVMI_MEDIAXFER_FMT_TYPE_DATA == format_type()
W/        ( 1805): ++++++++++PvmfMediaInputNodeOutPort::writeAsync()

W/        ( 1805): +++++++++OUT busy
W/        ( 1805): +++++++++OsclError::Leave()
W/        ( 1805): +++++++++OsclError::Leave( )   L1
W/        ( 1805): +++++++++OsclError::Leave() L2
W/        ( 1805): ++++++++OsclJump::StaticJump()
W/        ( 1805): ++++++++OsclJump::StaticJump() L4
W/        ( 1805): ++++++++Jump
W/        ( 1805): ++++++++Jump()  L3
E/CameraInput( 1805): Ln 783 Run writeAsync BUSY mFrameRefCount 9
W/        ( 1805): +++++++++OsclError::Leave()
W/        ( 1805): +++++++++OsclError::Leave( )   L1
W/        ( 1805): +++++++++OsclError::Leave() L2
W/        ( 1805): ++++++++OsclJump::StaticJump()
W/        ( 1805): ++++++++OsclJump::StaticJump() L4
W/        ( 1805): ++++++++Jump
W/        ( 1805): ++++++++Jump()  L3
W/        ( 1805): +++++++++OsclError::Leave()
W/        ( 1805): +++++++++OsclError::Leave( )   L1
W/        ( 1805): +++++++++OsclError::Leave() L2
W/        ( 1805): ++++++++OsclJump::StaticJump()
W/        ( 1805): ++++++++OsclJump::StaticJump() L4
W/        ( 1805): ++++++++Jump
W/        ( 1805): ++++++++Jump()  L3
W/        ( 1805): +++++++++OsclError::Leave()
W/        ( 1805): +++++++++OsclError::Leave( )   L1
W/        ( 1805): +++++++++OsclError::Leave() L2
W/        ( 1805): ++++++++OsclJump::StaticJump()
W/        ( 1805): ++++++++OsclJump::StaticJump() L4
W/        ( 1805): ++++++++Jump
W/        ( 1805): ++++++++Jump()  L3
D/libc-abort( 1805): abort() called in pid 1805
I/DEBUG   ( 1801): *** *** *** *** *** *** *** *** *** *** *** *** ***
*** *** ***
I/DEBUG   ( 1801): Build fingerprint: 'sec/sec_smdk6410/smdk6410/:1.5/
CUPCAKE/eng.jeff.20090730.164903:eng/test-keys'
I/DEBUG   ( 1801): pid: 1805, tid: 2253  >>> /system/bin/mediaserver
<<<
I/DEBUG   ( 1801): signal 11 (SIGSEGV), fault addr deadbaad
I/DEBUG   ( 1801):  r0 00000003  r1 deadbaad  r2 00000027  r3 ffff6150

I/DEBUG   ( 1801):  r4 ffff6128  r5 afe2fef8  r6 afe39dd0  r7 a7b4eaec
I/DEBUG   ( 1801):  r8 4040ac0c  r9 afe39dd0  10 a9d2856d  fp 00000001
I/DEBUG   ( 1801):  ip 0000001b  sp 40a0ae38  lr afe1ff33  pc
afe1066a  cpsr 20000030
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
W/audio_input( 1805): AndroidAudioInput::audin_thread_func()  L2
W/audio_input( 1805): AndroidAudioInput::audin_thread_func()  L5
W/CameraInput( 1805): +++++++postWriteAsync
W/CameraInput( 1805): +++++++ input camera data size =152064
W/CameraInput( 1805): +++++++ RunIfNotReady()
D/ CameraHWInterface( 1805): ----------------------
CameraHWInterface::m_previewThreadFunc
I/DEBUG   ( 1801):          #00  pc 0001066a  /system/lib/libc.so
I/DEBUG   ( 1801):          #01  pc 0000ddb0  /system/lib/libc.so
I/DEBUG   ( 1801): stack:
I/DEBUG   ( 1801):     40a0adf8  000829c0  [heap]
I/DEBUG   ( 1801):     40a0adfc  afe12e99  /system/lib/libc.so
I/DEBUG   ( 1801):     40a0ae00  afe3ce24
I/DEBUG   ( 1801):     40a0ae04  afe39ff0
I/DEBUG   ( 1801):     40a0ae08  0000000d
I/DEBUG   ( 1801):     40a0ae0c  afe13e4d  /system/lib/libc.so
I/DEBUG   ( 1801):     40a0ae10  4040ac0c
I/DEBUG   ( 1801):     40a0ae14  a8ad5cae
I/DEBUG   ( 1801):     40a0ae18  0004e8ac  [heap]
I/DEBUG   ( 1801):     40a0ae1c  ffff6128
I/DEBUG   ( 1801):     40a0ae20  afe2fef8  /system/lib/libc.so
I/DEBUG   ( 1801):     40a0ae24  afe39dd0
I/DEBUG   ( 1801):     40a0ae28  a7b4eaec  /system/lib/
libopencore_author.so
I/DEBUG   ( 1801):     40a0ae2c  afe10663  /system/lib/libc.so
I/DEBUG   ( 1801):     40a0ae30  df002777
I/DEBUG   ( 1801):     40a0ae34  e3a070ad
I/DEBUG   ( 1801): #00 40a0ae38  00051338  [heap]
I/DEBUG   ( 1801):     40a0ae3c  a8ad5cae
I/DEBUG   ( 1801):     40a0ae40  4040ac0c
I/DEBUG   ( 1801):     40a0ae44  a73d70e4  /system/lib/
libopencore_common.so
I/DEBUG   ( 1801):     40a0ae48  00051a40  [heap]
I/DEBUG   ( 1801):     40a0ae4c  fffffbdf

Thanks!
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. Instrumentation

4. Doing something every second

5. ExpandableList With ContextMenu

6. Taking Control of Phone Events from App

7. Load progressive ListView