Ok, so I think I have this pinned down to the MPEG4 sniffer. There's a lot
of OMAPness within. They have preprocessor removed the default MPEG4
sniffer, and there is an error being thrown within. I still need to check
what the output of that method is.

There is a vector list object within the DataSource class which contains
one entry for every filetype "sniffer". The first one in the list is the
MPEG4 sniffer, followed by the WAV, MP3, OGG, etc. Interesting. I'm going
to try gutting the OMAPness from the sniffers related to audio files only
and move the video format sniffers to the back of the list. Looking at the
code, when a sniffer returns false, it moves onto the next one.

I'll need to add some logcat debugging info to the other sniffers to be
sure of what's exactly getting called/going on...


...what a mess...

-kieran

On Wed, Jan 4, 2012 at 1:40 AM, 袁啸宇 <[email protected]> wrote:

> Maybe the ALSA implementation was filling in here somehow?
> i think it"s impossible.Maybe you delete more files than actually needed.
>
> I don't really have to include a file parser for every type of file do
> I?!?!
> no need to do so . Android inherently support mp3 file but not wmv or asf.
>
>
> At 2012-01-04 17:21:31,"Kieran Cox" <[email protected]> wrote:
>
> Thanks for the help with this!
>
> I checked the file in the emulator and on my Android phone it plays fine,
> so it's not the file. When playing via the emulator I get the following
> output, while music is playing:
>
> ****Emulator*****
> D/AndroidRuntime(  409): >>>>>> AndroidRuntime START
> com.android.internal.os.RuntimeInit <<<<<<
> D/AndroidRuntime(  409): CheckJNI is ON
> D/AndroidRuntime(  409): Calling main entry com.android.commands.am.Am
> I/ActivityManager(   77): Starting: Intent {
> act=com.android.music.PAYEBACK_VIEWER dat=file:///mnt/sdcard/sine1000.mp3
> flg=0x10000000 cmp=com.android.music/.MediaPlaybackActivity } from pid 409
> D/AndroidRuntime(  409): Shutting down VM
> D/dalvikvm(  409): GC_CONCURRENT freed 103K, 69% free 320K/1024K, external
> 0K/0K, paused 1ms+3ms
> D/dalvikvm(  409): Debugger has detached; object registry had 1 entries
> I/AudioService(   77):   Remote Control
> registerMediaButtonEventReceiver() for
> ComponentInfo{com.android.music/com.android.music.MediaButtonIntentReceiver}
> I/StagefrightPlayer(   34): setDataSource('/mnt/sdcard/sine1000.mp3')
> I/AudioService(   77):  AudioFocus  requestAudioFocus() from
> android.media.AudioManager@4053b1e0com.android.music.MediaPlaybackService
> $3@405247d0
> I/AudioService(   77):   Remote Control
> registerMediaButtonEventReceiver() for
> ComponentInfo{com.android.music/com.android.music.MediaButtonIntentReceiver}
> D/AudioSink(   34): bufferCount (4) is too small and increased to 12
> D/dalvikvm(  310): GC_EXTERNAL_ALLOC freed 472K, 56% free 2785K/6279K,
> external 2703K/2858K, paused 97ms
> I/ActivityManager(   77): Displayed
> com.android.music/.MediaPlaybackActivity: +1s271ms
> W/AudioFlinger(   34): write blocked for 109 msecs, 1 delayed writes,
> thread 0xc658
> D/dalvikvm(  270): GC_EXPLICIT freed 161K, 54% free 2787K/6023K, external
> 2196K/2692K, paused 48ms
> D/dalvikvm(  224): GC_EXPLICIT freed 60K, 49% free 2922K/5703K, external
> 8145K/9743K, paused 64ms
> D/MediaPlaybackService(  310): No play queue
> *********
>
>
> The file is played to the end. I also tried killing the
> "/system/bin/mediaserver" to see if it would reinitialize the audio HAL,
> which it seemed to do ie:
> **************
>  # kill 1979
> binder: 2023:2023 transaction failed 29189, size 64-0
> @@ audio_codec_release Codec Device is released 2, count 0#
> @@ audio_codec_release_helper state before close is 0
> @@ OSS Core : (soundcore_open)
> @@ OSS Core : (soundcore_open) Chain 3 Unit 3
> @@ OSS Core : (soundcore_open) open c039162c
> @@ audio_codec_open state 0 fw 0
> @@ audio_codec_open open_ct 1
> @@ OSS Core : (soundcore_open) err 0
> *****************
>
> Very curious. So the audio HAL is initialized properly it seems. This
> issue is looking more and more like the file parser is at fault, but that
> really seems strange. I will say this Android distribution is Gingerbread
> for the TI Blaze, which originally used the Alsa audio that I compiled out
> in favor of another codec solution. Maybe the ALSA implementation was
> filling in here somehow?  I don't really have to include a file parser for
> every type of file do I?!?!
>
> Thanks for all the help,
>
> -kieran
>
> On Wed, Jan 4, 2012 at 1:11 AM, 袁啸宇 <[email protected]> wrote:
>
>> make sure that your board can play mp3 successfully befor you change the
>> aduio driver or you can paly the mp3 file on another borad  or on you pc.
>> It seems that there is something wrong when parsing the file .Neither the
>> file is broken nor the parser is wrong .
>> hope that helps.
>> At 2012-01-04 15:40:53,52x15 <[email protected]> wrote:
>> >I tried that, and very similar result. :-(
>> >
>> >D/AndroidRuntime( 1908): >>>>>> AndroidRuntime START
>> >com.android.internal.os.RuntimeInit <<<<<<
>> >D/AndroidRuntime( 1908): CheckJNI is ON
>> >D/dalvikvm( 1908): creating instr width table
>> >D/AndroidRuntime( 1908): Calling main entry com.android.commands.am.Am
>> >V/RenderScript_jni( 1682): surfaceDestroyed
>> >I/ActivityManager( 1475): Starting: Intent
>> >{ act=com.android.music.PAYEBACK_VIEWER dat=file:///mnt/sdcard/
>> >sine1000.mp3 flg=0x10000000
>> >cmp=com.android.music/.MediaPlaybackActivity } from pid 1908
>> >D/AndroidRuntime( 1908): Shutting down VM
>> >D/dalvikvm( 1908): GC_CONCURRENT freed 102K, 69% free 320K/1024K,
>> >external 0K/0K, paused 0ms+1ms
>> >D/jdwp    ( 1908): adbd disconnected
>> >I/AndroidRuntime( 1908): NOTE: attach of thread 'Binder Thread #2'
>> >failed
>> >I/AudioService( 1475):   Remote Control
>> >registerMediaButtonEventReceiver() for ComponentInfo{com.android.music/
>> >com.android.music.MediaButtonIntentReceiver}
>> >W/ASFDummyExtractor( 1466): ASF parser is not available
>> >I/StagefrightPlayer( 1466): setDataSource('/mnt/sdcard/sine1000.mp3')
>> >D/AwesomePlayer( 1466): setDataSource_l(/mnt/sdcard/sine1000.mp3)
>> >E/MPEG4Extractor( 1466): both mdat,ftyp not found
>> >I/AudioService( 1475):  AudioFocus  requestAudioFocus() from
>> >
>> android.media.AudioManager@405a3e48com.android.music.MediaPlaybackService
>> >$3@405a2ca8
>> >I/AudioService( 1475):   Remote Control
>> >registerMediaButtonEventReceiver() for ComponentInfo{com.android.music/
>> >com.android.music.MediaButtonIntentReceiver}
>> >I/gralloc ( 1475): Allocated 1024 x 600 fmt: 2 usage: 0x133
>> >D/dalvikvm( 1752): GC_EXTERNAL_ALLOC freed 593K, 52% free 2850K/5895K,
>> >external 2067K/2137K, paused 25ms
>> >I/gralloc ( 1475): Allocated 1024 x 600 fmt: 2 usage: 0x133
>> >D/MediaPlaybackService( 1752): No play queue
>> >D/dalvikvm( 1682): GC_EXPLICIT freed 229K, 47% free 3096K/5831K,
>> >external 4240K/4901K, paused 84ms
>> >D/dalvikvm( 1771): GC_EXPLICIT freed 126K, 58% free 2879K/6727K,
>> >external 1625K/2137K,
>> >
>> >On Jan 3, 6:12 pm, 袁啸宇 <[email protected]> wrote:
>> >> W/ASFDummyExtractor( 1428): ASF parser is not available
>> >> i guess you don't have the right parser.try mp3 file.
>> >> At 2012-01-04 06:14:58,52x15 <[email protected]> wrote:
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> >Hello,  I'm trying to integrate an OSS audio driver into Gingerbread
>> >> >for a TI based device, (based on OMAP4). I've correctly (or what seems
>> >> >to be) subclassed AudioHardwareBase and implemented the virtual
>> >> >methods for my audio solution (most of them).  I've also added the the
>> >> >changes to the bulid system to build my  changes into a libaudio as
>> >> >well.
>> >>
>> >> >Everything builds fine, and the system starts up fine. There are
>> >> >messages indicating my libaudio has been called and setup, ie:
>> >>
>> >**************************************************************************
>> ***************************
>> >> >:~$ adb logcat AudioFlinger:V AudioService:V AudioHardware:V
>> >> >AudioHardwareInterface:V AudioPolicyManagerBase:V *:S
>> >> >--------- beginning of /dev/log/main
>> >> >--------- beginning of /dev/log/system
>> >> >D/AudioHardware( 1327): AudioHardware505() called. Opening RDONLY for
>> >> >now
>> >> >D/AudioHardware( 1327): AudioHardware505(): initialized.  REF_COUNT =
>> >> >1
>> >> >D/AudioHardware( 1327): initCheck() called.
>> >> >D/AudioHardware( 1327): initCheck() called.
>> >> >D/AudioHardwareInterface( 1327): setMode(NORMAL)
>> >> >D/AudioHardware( 1327): setMasterVolume(1.000000) called
>> >> >D/AudioHardware( 1327): openOutputStream(2, 0, 0, 0, 45224) called
>> >> >D/AudioHardware( 1327): AudioStreamOut505() called
>> >> >D/AudioHardware( 1327): set(0xb0c0, 2, 0, 0, 0) called
>> >> >I/AudioFlinger( 1327): AudioFlinger's thread 0x13f88 ready to run
>> >> >D/AudioHardware( 1327): setVoiceVolume(1.000000) called, NOT
>> >> >IMPLEMENTED
>> >> >D/AudioHardware( 1428): AudioHardware505() called. Opening RDONLY for
>> >> >now
>> >> >D/AudioHardware( 1428): AudioHardware505(): initialized.  REF_COUNT =
>> >> >1
>> >> >D/AudioHardware( 1428): initCheck() called.
>> >> >D/AudioHardware( 1428): initCheck() called.
>> >> >D/AudioHardwareInterface( 1428): setMode(NORMAL)
>> >> >D/AudioHardware( 1428): setMasterVolume(1.000000) called
>> >> >D/AudioHardware( 1428): openOutputStream(2, 0, 0, 0, 45224) called
>> >> >D/AudioHardware( 1428): AudioStreamOut505() called
>> >> >D/AudioHardware( 1428): set(0xb0c0, 2, 0, 0, 0) called
>> >> >I/AudioFlinger( 1428): AudioFlinger's thread 0x13fb8 ready to run
>> >> >D/AudioHardware( 1428): setVoiceVolume(1.000000) called, NOT
>> >> >IMPLEMENTED
>> >> >D/AudioHardware( 1428): setVoiceVolume(0.800000) called, NOT
>> >> >IMPLEMENTED
>> >> >D/AudioHardwareInterface( 1428): setMode(NORMAL)
>> >> >W/AudioPolicyManagerBase( 1428): setPhoneState() setting same state 0
>> >> >I/AudioService( 1448):   Remote Control
>> >> >registerMediaButtonEventReceiver() for
>> ComponentInfo{com.android.music/
>> >> >com.android.music.MediaButtonIntentReceiver}
>> >> >I/AudioService( 1448):  AudioFocus  requestAudioFocus() from
>> >>
>> >android.media.AudioMana...@405a37b8com.android.music.MediaPlaybackService
>> >> >$3@405a2618
>> >> >I/AudioService( 1448):   Remote Control
>> >> >registerMediaButtonEventReceiver() for
>> ComponentInfo{com.android.music/
>> >> >com.android.music.MediaButtonIntentReceiver}
>> >>
>> >>
>> >**************************************************************************
>> ***************************
>> >>
>> >> >The issue is obviously I'm not getting any sound, but more
>> >> >specifically I get messages that do not help debug when trying to play
>> >> >a *.wav file with the native media player. For example:
>> >>
>> >>
>> >**************************************************************************
>> ***************************
>> >> >D/AndroidRuntime( 1756): >>>>>> AndroidRuntime START
>> >> >com.android.internal.os.RuntimeInit <<<<<<
>> >> >D/AndroidRuntime( 1756): CheckJNI is ON
>> >> >D/dalvikvm( 1756): creating instr width table
>> >> >D/AndroidRuntime( 1756): Calling main entry
>> com.android.commands.am.Am
>> >> >I/ActivityManager( 1448): Starting: Intent
>> >> >{ act=com.android.music.PAYEBACK_VIEWER dat=file:///mnt/sdcard/
>> >> >sine1000.wav flg=0x10000000
>> >> >cmp=com.android.music/.MediaPlaybackActivity } from pid 1756
>> >> >V/RenderScript_jni( 1553): surfaceDestroyed
>> >> >D/AndroidRuntime( 1756): Shutting down VM
>> >> >D/dalvikvm( 1756): GC_CONCURRENT freed 102K, 69% free 320K/1024K,
>> >> >external 0K/0K, paused 0ms+0ms
>> >> >D/jdwp    ( 1756): adbd disconnected
>> >> >I/AudioService( 1448):   Remote Control
>> >> >registerMediaButtonEventReceiver() for
>> ComponentInfo{com.android.music/
>> >> >com.android.music.MediaButtonIntentReceiver}
>> >> >W/ASFDummyExtractor( 1428): ASF parser is not available
>> >> >I/StagefrightPlayer( 1428): setDataSource('/mnt/sdcard/sine1000.wav')
>> >> >D/AwesomePlayer( 1428): setDataSource_l(/mnt/sdcard/sine1000.wav)
>> >> >E/MPEG4Extractor( 1428): both mdat,ftyp not found
>> >> >I/AudioService( 1448):  AudioFocus  requestAudioFocus() from
>> >>
>> >android.media.AudioMana...@405a37b8com.android.music.MediaPlaybackService
>> >> >$3@405a2618
>> >> >I/AudioService( 1448):   Remote Control
>> >> >registerMediaButtonEventReceiver() for
>> ComponentInfo{com.android.music/
>> >> >com.android.music.MediaButtonIntentReceiver}
>> >> >D/dalvikvm( 1448): GC_EXPLICIT freed 1277K, 47% free 4337K/8071K,
>> >> >external 5268K/6579K, paused 43ms
>> >> >I/gralloc ( 1448): Allocated 1024 x 600 fmt: 2 usage: 0x133
>> >> >W/ASFDummyExtractor( 1428): ASF parser is not available
>> >> >E/MPEG4Extractor( 1428): both mdat,ftyp not found
>> >> >E/MetadataRetrieverClient( 1428): failed to extract an album art
>> >> >W/ASFDummyExtractor( 1428): ASF parser is not available
>> >> >E/MPEG4Extractor( 1428): both mdat,ftyp not found
>> >> >E/MetadataRetrieverClient( 1428): failed to extract an album art
>> >> >D/dalvikvm( 1728): GC_EXTERNAL_ALLOC freed 661K, 52% free 2861K/5959K,
>> >> >external 2067K/2137K, paused 27m
>> >>
>> >**************************************************************************
>> ***************************
>> >>
>> >> >My best guess is that AudioService is not actually getting a request
>> >> >to play the file, as I have debug messages in my libaudio that would
>> >> >show up during a call through. This is confusing as I've made no
>> >> >changes to the audio middleware other than swapping in a different
>> >> >libaudio for interacting with the hardware. I would expect at the very
>> >> >least some calls into my audio classes during an normal attempt to
>> >> >play media.
>> >>
>> >> >Thanks for taking a look at this, and any help is greatly appreciated!
>> >>
>> >> >-kieran
>> >>
>> >> >--
>> >> >unsubscribe: [email protected]
>> >> >website:http://groups.google.com/group/android-porting
>> >
>> >--
>> >unsubscribe: [email protected]
>> >website: http://groups.google.com/group/android-porting
>>
>>
>
>
>

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

Reply via email to