3GP audio support in Eclair

14 views
Skip to first unread message

Uander

unread,
Apr 8, 2010, 5:37:46 AM4/8/10
to android-porting, android-d...@googlegroups.com
Hi ALL ,

I have observe issue while playing with Android Music app :

 The "Music" application in Android 2.0 {eclair} and 2.1 does not recognize an AMR-NB 
 formatted audio file with the ".3gp" extension although it is listed in the
 Android Supported Media Formats in Android Developer's Guide:-
 
 <http://developer.android.com/intl/ja/guide/appendix/media-formats.html>

 It does recognize the same file with ".amr" extension.

While Music in Android 1.5 {cupcake}  recognizes both AMR-NB formatted audio file with 
 ".3gp" and ".amr" extensions.

I also want to know if it is the current behavior of Music in Android 2.0 and 2.1
or a issue existing ??

If it is discussed earlier in at any thread before please  place the link here .

Thanks :
Uander

Deva R

unread,
Apr 8, 2010, 7:02:57 AM4/8/10
to uand...@gmail.com, android-porting, android-d...@googlegroups.com
Hi,

.3GP files were usually scanned and listed under gallery application
(com.android.gallery or com.android.camera)..
can you check in menu->gallery?

PS.
i've seen the files are listed solely based on file-extension or
container, rather than the encoded data format in it..
just rename .mp3 to .mp4 -> it will appear only in gallery..

> --
> unsubscribe: android-porti...@googlegroups.com
> website: http://groups.google.com/group/android-porting
>

Uander

unread,
Apr 8, 2010, 7:47:16 AM4/8/10
to Deva R, android-porting, android-d...@googlegroups.com
My concern is that 3GP extension file (audio AMR-NB format)were detected in Music (cupcake) but not in Eclair neither in Gallery nor in Music application .

On Thu, Apr 8, 2010 at 4:32 PM, Deva R <r.de...@gmail.com> wrote:
Hi,

.3GP files were usually scanned and listed under gallery application
(com.android.gallery or com.android.camera)..
can you check in menu->gallery?

In my case 3gp extension file not detected in Gallery too . 

Attached my sample music file I've used .

Unader
test_n_3gp.3gp
test_n_amr.amr

Deva R

unread,
Apr 8, 2010, 9:13:17 AM4/8/10
to Uander, android-porting, android-d...@googlegroups.com
Hi Uander, both the files were listed under Music app.., and plays
fine for me. i use android eclair latest..,
nothing much, but attached log from the exercise below..

-deva

# cd /sdcard
# ls te*
test_n_3gp.3gp
test_n_amr.amr
#
#
# W/IInputConnectionWrapper( 1357): showStatusIcon on inactive InputConnection
I/ActivityManager( 837): Starting activity: Intent {
act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER]
flg=0x10200000 cmp=com.android.music/.MusicBrowserActivity }
I/ActivityManager( 837): Starting activity: Intent {
act=android.intent.action.PICK dat=
typ=vnd.android.cursor.dir/artistalbum flg=0x4000000
cmp=com.android.music/.ArtistAlbumBrowserActivity (has extras) }
D/dalvikvm( 837): GC freed 18389 objects / 958944 bytes in 88ms
I/ActivityManager( 837): Displayed activity
com.android.music/.ArtistAlbumBrowserActivity: 413 ms (total 429 ms)
E/MusicUtils( 1357): Trying to unbind for unknown Context
E/gralloc ( 837): [unregister] handle 0x4ada60 still locked (state=40000001)
I/ActivityManager( 837): Starting activity: Intent {
act=android.intent.action.PICK dat= typ=vnd.android.cursor.dir/track
cmp=com.android.music/.TrackBrowserActivity (has extras) }
I/ActivityManager( 837): Displayed activity
com.android.music/.TrackBrowserActivity: 274 ms (total 274 ms)
W/MediaPlayer( 1357): info/warning (1, 44)
D/AudioMIO( 1307): Before: ADJ_CLK old clock -462 original correction
462 correction 462 new clock 0
D/AudioMIO( 1307): After: ADJ_CLK old clock -462 correction 462 new clock 0
D/AudioMIO( 1307): Before: ADJ_CLK old clock -461 original correction
461 correction 461 new clock 0
D/AudioMIO( 1307): After: ADJ_CLK old clock -461 correction 461 new clock 0
I/ActivityManager( 837): Starting activity: Intent { flg=0x4000000
cmp=com.android.music/.MediaPlaybackActivity }
I/MediaPlayer( 1357): Info (1,44)
D/AudioHardwareALSA( 1307): INFO: EPIPE
D/AudioMIO( 1307): Before: ADJ_CLK old clock 230 original correction
-137 correction -137 new clock 93
D/AudioMIO( 1307): After: ADJ_CLK old clock 230 correction -137 new clock 93
D/AudioMIO( 1307): Before: ADJ_CLK old clock 230 original correction
-137 correction -137 new clock 93
D/AudioMIO( 1307): After: ADJ_CLK old clock 230 correction -137 new clock 93
I/ActivityManager( 837): Displayed activity
com.android.music/.MediaPlaybackActivity: 311 ms (total 311 ms)
D/AudioMIO( 1307): Before: ADJ_CLK old clock 245 original correction
34 correction 34 new clock 279
D/AudioMIO( 1307): After: ADJ_CLK old clock 245 correction 34 new clock 279
D/AudioMIO( 1307): Before: ADJ_CLK old clock 617 original correction
33 correction 33 new clock 650
D/AudioMIO( 1307): After: ADJ_CLK old clock 617 correction 33 new clock 650
D/dalvikvm( 1357): GC freed 8717 objects / 576920 bytes in 57ms
D/AudioHardwareALSA( 1307): INFO: EPIPE
D/AudioHardwareALSA( 1307): INFO: EPIPE
D/AudioHardwareALSA( 1307): INFO: EPIPE
D/AudioHardwareALSA( 1307): INFO: EPIPE
W/IInputConnectionWrapper( 1357): showStatusIcon on inactive InputConnection
D/AudioHardwareALSA( 1307): INFO: EPIPE
D/AudioHardwareALSA( 1307): INFO: EPIPE
D/AudioHardwareALSA( 1307): INFO: EPIPE
D/dalvikvm( 987): GC freed 4432 objects / 204272 bytes in 51ms
D/dalvikvm( 1357): GC freed 4616 objects / 279040 bytes in 52ms

Uander

unread,
Apr 8, 2010, 11:51:09 PM4/8/10
to Deva R, android-porting, android-d...@googlegroups.com
Thanks Deva .
 
I am also using Eclair Android 2.0 . but donno what bad happened with my luck .
 
Does anyone faced this problem if Yes please put some points here How to look around with this oor what all I should cross check on my file system / opencore / codecs etc ?.
 
Thanks :
Uander

Uander

unread,
Apr 9, 2010, 1:01:01 AM4/9/10
to Deva R, android-porting, android-d...@googlegroups.com
I want to check if I m able to play those files in command line in Android .
 
what is the command to play a .3gp audio file . ?
 
Thanks :
Uander

Deva R

unread,
Apr 9, 2010, 5:12:48 AM4/9/10
to Uander, android-porting, android-d...@googlegroups.com
Hi,

- have ever seen a file inside gallery or music app? after booting
eclair for first time, i always have to wait like 5 minutes for
mediascanner to finish loading files.. manually you can trigger like
menu -> Dev Tools -> Mediascanner, and wait for /sdcard scan to
complete..

- rename .3gp as like .mp4 and see if it gets played under gallery
app.. i've tried this on a broken setup, where Music app will crash on
opening..

- regarding command line testing, alsa_aplay can test raw and selected formats..
u can use mediaframework tests to test audio/video record/playback
via command line (adb/shell)

source location: ./frameworks/base/media/tests/MediaFrameworkTest
build command: ./make mediaframeworktest

sample test command to play amr
./adb shell am instrument -e class
com.android.mediaframeworktest.functional.MediaPlayerApiTest#testAMRGetDuration
-w com.android.mediaframeworktest/.MediaFrameworkTestRunner

-Deva

Uander

unread,
Apr 9, 2010, 7:08:27 AM4/9/10
to Deva R, android-porting, android-d...@googlegroups.com
Followed by your comments , plz find my inline replies :

On Fri, Apr 9, 2010 at 2:42 PM, Deva R <r.de...@gmail.com> wrote:
Hi,

- have ever seen a file inside gallery or music app? after booting
eclair for first time, i always have to wait like 5 minutes for
mediascanner to finish loading files.. manually you can trigger like
menu -> Dev Tools -> Mediascanner, and wait for /sdcard scan to
complete..


Tried this MediaScanner to scan sdcard  . .3gp not scanned though .
 
- rename .3gp as like .mp4 and see if it gets played under gallery
app.. i've tried this on a broken setup, where Music app will crash on
opening..

renamed .3gp to .mp4 .  test_n_3gp.mp4 also not detected in Music and Gallery app .

- regarding command line testing, alsa_aplay can test raw and selected formats..

 alsa_aplay sdcard/test_n_3gp.3gp  gives
Playing raw data 'sdcard/test_n_3gp.3gp' : Unsigned 8 bit, Rate 8000 Hz, Mono
for 2 minutes and then exited . no sound yet .
 
 u can use mediaframework tests to test audio/video record/playback
via command line (adb/shell)

 source location:  ./frameworks/base/media/tests/MediaFrameworkTest
 build command:  ./make mediaframeworktest
 
sample test command to play amr
./adb shell am instrument -e class
com.android.mediaframeworktest.functional.MediaPlayerApiTest#testAMRGetDuration
-w com.android.mediaframeworktest/.MediaFrameworkTestRunner

Tried this on minicom for device . output comes as   :

com.android.mediaframeworktest.functional.MediaPlayerApiTest:
Failure in testAMRGetDuration:
junit.framework.AssertionFailedError: AMR getDuration
        at com.android.mediaframeworktest.functional.MediaPlayerApiTest.testAMRGetDuration(MediaPlayerApiTest.java:101)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:205)
        at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:195)
        at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
        at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
        at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:449)
        at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)

Test results for MediaFrameworkTestRunner=.F
Time: 0.74

FAILURES!!!
Tests run: 1,  Failures: 1,  Errors: 0


Thanks :
Uander

Deva R

unread,
Apr 9, 2010, 7:17:03 AM4/9/10
to Uander, android-porting, android-d...@googlegroups.com
nothing looks positive yet., can you make sure 'ls /sdcard' is showing
valid conent??

>junit.framework.AssertionFailedError: AMR getDuration
> at com.android.mediaframeworktest.functional.MediaPlayerApiTest.testAMRGetDuration(MediaPlayerApiTest.java:101)


Assertionn is probably due to missing files., and i guess these MTS
test file paths are hardcoded.,
can you place attached file in sdcard in below path and play??
/sdcard/mts_tests/media_api/music/test_amr_ietf.amr

test_amr_ietf.amr

Uander

unread,
Apr 9, 2010, 8:16:16 AM4/9/10
to Deva R, android-porting, android-d...@googlegroups.com
On Fri, Apr 9, 2010 at 4:47 PM, Deva R <r.de...@gmail.com> wrote:
nothing looks positive yet., can you make sure 'ls /sdcard' is showing
valid conent??

It shows all file including .3gp one as well :
ls  -l /sdcard

 audio
bigplanet
dcim
images
video
MLO_working
uImage
uImage_Amit
test2.3gp
test_d_3gp.3gp
test_d_amr.amr
test_n_3gp.3gp


>junit.framework.AssertionFailedError: AMR getDuration
>        at com.android.mediaframeworktest.functional.MediaPlayerApiTest.testAMRGetDuration(MediaPlayerApiTest.java:101)


Assertionn is probably due to missing files., and i guess these MTS
test file paths are hardcoded.,
can you place attached file in sdcard in below path and play??
/sdcard/mts_tests/media_api/music/test_amr_ietf.amr


I have placed your test_amr_ietf.amr in  /sdcard/mts_tests/media_api/music . now running command : am instrument -e class com.android.mediaframeworktest.functional.MediaPlayerApiTest#testAMRGetDuration -w com.android.m... says  :

com.android.mediaframeworktest.functional.MediaPlayerApiTest:NOHZ: local_softirq_pending 02

NOHZ: local_softirq_pending 02

NOHZ: local_softirq_pending 02

and it is not exiting .

Thanks :
Uander

 

Deva R

unread,
Apr 9, 2010, 8:34:31 AM4/9/10
to Uander, android-porting, android-d...@googlegroups.com
can you enable logcat before the test? 'logcat &'


>I have placed your test_amr_ietf.amr in /sdcard/mts_tests/media_api/music . now running command : am instrument -e class >com.android.mediaframeworktest.functional.MediaPlayerApiTest#testAMRGetDuration -w com.android.m... says :

Uander

unread,
Apr 13, 2010, 12:52:49 AM4/13/10
to Deva R, android-porting, android-d...@googlegroups.com
Hi ALL  ,

I am still in trouble . My 3gp file (Amr-nb encoded , 3Gp extension audio file ) not getting detected in Eclair .

I tried with this attached FileManager.apk , with this apk , my 3gp file is detected  but agian on trying to play it says "Application not  available".

Is it like only 3gp - video file will be detected that too in Gallery application . And I have only Music in eclair not Gallery ?

Is the problem with my file being audio - 3Gp  not video one ?

Does result should vary from hardware to emulator since emulator doesn't have hardware codecs ?

Anyone else have faced this issue ?


Thanks :
Uander
FileManager.apk

bhupesh

unread,
Apr 20, 2010, 1:33:59 AM4/20/10
to android-porting


On Apr 13, 9:52 am, Uander <uandro...@gmail.com> wrote:
> Hi ALL  ,
>
> I am still in trouble . My 3gp file (Amr-nb encoded , 3Gp extension audio
> file ) not getting detected in Eclair .
>

Why you want to rename and AMR file to 3GP? 3GP files are usually
video and that get listed in Gallery Application. AMR file will get
displayed in Music application. Android documentation does not say
which format/extension will get displayed in which application
(Gallery or Music).

BTW i have list of all valid extension as well as format which are not
getting displayed in either apps so it's all matter of documentation
what exactly is supported in Android Applications.

> I tried with this attached FileManager.apk , with this apk , my 3gp file is
> detected  but agian on trying to play it says "Application not  available".
>
> Is it like only 3gp - video file will be detected that too in Gallery
> application . And I have only Music in eclair not Gallery ?
>
> Is the problem with my file being audio - 3Gp  not video one ?
>
> Does result should vary from hardware to emulator since emulator doesn't
> have hardware codecs ?
>
> Anyone else have faced this issue ?
>
> Thanks :
> Uander
>
>
>
> On Fri, Apr 9, 2010 at 6:04 PM, Deva R <r.deva...@gmail.com> wrote:
> > can you enable logcat before the test? 'logcat &'
>
> > >I have placed your test_amr_ietf.amr in  /sdcard/mts_tests/media_api/music
> > . now running command : am instrument -e class
> > >com.android.mediaframeworktest.functional.MediaPlayerApiTest#testAMRGetDur ation
> > -w com.android.m... says  :
>
> > On Fri, Apr 9, 2010 at 5:46 PM, Uander <uandro...@gmail.com> wrote:
>
> > > On Fri, Apr 9, 2010 at 4:47 PM, Deva R <r.deva...@gmail.com> wrote:
>
> > >> nothing looks positive yet., can you make sure 'ls /sdcard' is showing
> > >> valid conent??
>
> > > It shows all file including .3gp one as well :
> > > ls  -l /sdcard
>
> > >  audio
> > > bigplanet
> > > dcim
> > > images
> > > video
> > > MLO_working
> > > uImage
> > > uImage_Amit
> > > test2.3gp
> > > test_d_3gp.3gp
> > > test_d_amr.amr
> > > test_n_3gp.3gp
>
> > >> >junit.framework.AssertionFailedError: AMR getDuration
> > >> >        at
>
> > com.android.mediaframeworktest.functional.MediaPlayerApiTest.testAMRGetDura tion(MediaPlayerApiTest.java:101)
>
> > >> Assertionn is probably due to missing files., and i guess these MTS
> > >> test file paths are hardcoded.,
> > >> can you place attached file in sdcard in below path and play??
> > >> /sdcard/mts_tests/media_api/music/test_amr_ietf.amr
>
> > > I have placed your test_amr_ietf.amr in
> > /sdcard/mts_tests/media_api/music .
> > > now running command : am instrument -e class
>
> > com.android.mediaframeworktest.functional.MediaPlayerApiTest#testAMRGetDura tion
> > > -w com.android.m... says  :
>
> > > com.android.mediaframeworktest.functional.MediaPlayerApiTest:NOHZ:
> > > local_softirq_pending 02
>
> > > NOHZ: local_softirq_pending 02
>
> > > NOHZ: local_softirq_pending 02
>
> > > and it is not exiting .
>
> > > Thanks :
> > > Uander
>
> > >> On Fri, Apr 9, 2010 at 4:38 PM, Uander <uandro...@gmail.com> wrote:
> > >> > Followed by your comments , plz find my inline replies :
>
> > com.android.mediaframeworktest.functional.MediaPlayerApiTest.testAMRGetDura tion(MediaPlayerApiTest.java:101)
> > >> >         at java.lang.reflect.Method.invokeNative(Native Method)
> > >> >         at
>
> > android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java :205)
> > >> >         at
>
> > android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:1 95)
> > >> >         at
> > >> > android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
> > >> >         at
> > >> > android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
> > >> >         at
>
> > android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.ja va:449)
> > >> >         at
>
> > android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java: 1447)
>
> > >> > Test results for MediaFrameworkTestRunner=.F
> > >> > Time: 0.74
>
> > >> > FAILURES!!!
> > >> > Tests run: 1,  Failures: 1,  Errors: 0
>
> > >> > Thanks :
> > >> > Uander
>
> > >> >> -Deva
>
> > >> >> On Fri, Apr 9, 2010 at 10:31 AM, Uander <uandro...@gmail.com> wrote:
> > >> >> > I want to check if I m able to play those files in command line in
> > >> >> > Android .
>
> > >> >> > what is the command to play a .3gp audio file . ?
>
> > >> >> > Thanks :
> > >> >> > Uander
>
> > >> >> > On Thu, Apr 8, 2010 at 10:51 PM, Uander <uandro...@gmail.com>
> > wrote:
>
> > >> >> >> Thanks Deva .
>
> > >> >> >> I am also using Eclair Android 2.0 . but donno what bad happened
> > >> >> >> with
> > >> >> >> my
> > >> >> >> luck .
>
> > >> >> >> Does anyone faced this problem if Yes please put some points here
> > >> >> >> How
> > >> >> >> to
> > >> >> >> look around with this oor what all I should cross check on my file
> > >> >> >> system /
> > >> >> >> opencore / codecs etc ?.
>
> > >> >> >> Thanks :
> > >> >> >> Uander
>
> > >> >> >> On Thu, Apr 8, 2010 at 8:13 AM, Deva R <r.deva...@gmail.com>
> ...
>
> read more »
>
>  FileManager.apk
> 125KViewDownload

Deva R

unread,
Apr 20, 2010, 5:57:46 AM4/20/10
to bhupes...@gmail.com, android-porting


>>Why you want to rename and AMR file to 3GP? 3GP files are usually
>>video and that get listed in Gallery Application.

3GP is only container, it can contain encoded audio/video data.,
files are listed under gallery or music app based on content type in MIME header. (i was wrong about file extension earlier).
Eclair 2.1 Music app indeed lists .3gp file w amr-nb encoded audio data.

have a check at formats, filetypes supported at
http://developer.android.com/intl/fr/guide/appendix/media-formats.html
Reply all
Reply to author
Forward
0 new messages