2008-05-15 04:46:46     Playing WMA and OGG files with mplayer

Document created by Aaronwu Employee on Aug 6, 2013
Version 1Show Document
  • View in full screen mode

2008-05-15 04:46:46     Playing WMA and OGG files with mplayer

Gyula Kovacs (HUNGARY)

Message: 55856   

 

Hi All,

 

I tried to play several audio files with mplayer, but the playback of WMA and OGG files was bad.

 

- Playing of WAV took 1% of CPU.

 

- Playing of MP3 (44.1kHz, stereo, 128kbps) took 4% of CPU.

 

These values are in range with the values given by  "uClinux as an Embedded OS on an Embedded Processor" white paper.

 

- Playing of AAC (44.1kHz, stereo, 256kbps) took 34% of CPU, which is OK.

 

Playing of WMA (v9.2, 44.1kHz, stereo, CBR, 128kbps) resulted in playing in a staccato voice. The CPU load was 88% against the ~21% specified in the above mentioned white paper. The mplayer status line showed:

 

AO: [oss] 44100Hz 2ch s16le (2 bytes per sample)

Video: no video

Starting playback...

A:  60.3 (01:00.3) of 340.0 (05:40.0) 311.2%

 

Playing of OGG (44.1kHz, stereo, CBR, 256kbps) took 99% of CPU, and there was no sound at all. The mplayer status line showed:

 

AO: [oss] 44100Hz 2ch s16le (2 bytes per sample)

Video: no video

Starting playback...

A:  60.7 (01:00.6) of 336.6 (05:36.5) 223.4%

 

For playing the WMA and OGG the mplayer used the ffmpeg decoder. From the relatively high load values I guess, that the ffmpeg library is using floating point operations instead of fixed point ones.

 

Am I right?

 

Did anybody experience the same problem? Does anybody have a suggestion for solving this?

 

My system is:

 

- BF548-EZKIT with SYSCLK of 131MHz and core clk of 525MHz.

 

- uClinux distribution of 2008r1-rc8

 

- the playback device is the BF548's SoC

 

Best regards,

 

Gyula

QuoteReplyEditDelete

 

 

2008-05-15 10:15:37     Re: Playing WMA and OGG files with mplayer

Mike Frysinger (UNITED STATES)

Message: 55860   

 

there is a fixed point ogg decoder called "tremor" that should be used instead of ffmpeg ... but i dont know if it's integrated into mplayer

QuoteReplyEditDelete

 

 

2008-05-15 21:59:27     Re: Playing WMA and OGG files with mplayer

Meihui Fan (CHINA)

Message: 55875   

 

Hi Gyula,

 

``Playing of MP3 (44.1kHz, stereo, 128kbps) took 4% of CPU.''

 

This is curious. Because in my `similar' system, Playing of MP3 (44.1kHz, stereo, 128kbps) required 8% of CPU load utilizing libmad.

 

# mplayer foo.mp3

 

MPlayer dev-SVN26779-4.1.2 (C) 2000-2008 MPlayer Team

 

Playing foo.mp3.

 

Audio file file format detected.

 

Clip info:

 

Title: Pahelbel-Canon

 

Artist: j.s.Bach

 

Genre: Classical

 

==========================================================================

 

Opening audio decoder: [libmad] libmad mpeg audio decoder AUDIO: 44100 Hz, 2 ch, s16le,

 

128.0 kbit/9.07% (ratio: 16000->176400) Selected audio codec: [mad] afm: libmad (libMAD

 

MPEG layer 1-2-3)

 

==========================================================================

 

AO: [oss] 44100Hz 2ch s16le (2 bytes per sample)

 

Video: no video Starting playback...

 

A: 10.7 (00:11/05:01) 8.2%

 

 

 

Can you post the mplayer outputs here? Thanks!

 

 

QuoteReplyEditDelete

 

 

2008-05-15 22:27:30     Re: Playing WMA and OGG files with mplayer

Yi Li (CHINA)

Message: 55877   

 

You may use the statistic profiling tool to locate CPU bottle neck : http://docs.blackfin.uclinux.org/doku.php?id=statistical_profiling.

 

 

QuoteReplyEditDelete

 

 

2008-05-15 23:17:12     Re: Playing WMA and OGG files with mplayer

Meihui Fan (CHINA)

Message: 55878   

 

Hi Yi,

 

Thanks, I'm considering your advise, but my (product) hardware isn't pin JTAG out. Then I must tune the kernel/driver to run on my old development/evaluation board, that's quite boring. So I want a true reference which would show me my system is in really low performance, and then it can drive me to fight with the boring thing with no other choice.

 

So Yi, what's the mplayer (playing mp3) perform on your system? Can you post some outputs?

 

Anyway, I'm going to try the statistical profing. Thank you!

 

 

QuoteReplyEditDelete

 

 

2008-05-16 04:02:13     Re: Playing WMA and OGG files with mplayer

Gyula Kovacs (HUNGARY)

Message: 55883   

 

Hi Meihui,

 

I think my description was not detailed enough. Here is some extra info about it:

 

- I played the file from an USB pen drive.

 

- I'm not sure about the mplayer's cpu load measurement, so I used the time command.

 

The complete result of my test is:

 

root:/> time -v mplayer /mnt/audio/01.mp3

MPlayer dev-SVN-rUNKNOWN-4.1.2 (C) 2000-2007 MPlayer Team

117 audio & 238 video codecs

 

Playing /mnt/audio/01.mp3.

Audio file file format detected.

==========================================================================

Opening audio decoder: [libmad] libmad mpeg audio decoder

AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)

Selected audio codec: [mad] afm: libmad (libMAD MPEG layer 1-2-3)

==========================================================================

AO: [oss] 44100Hz 2ch s16le (2 bytes per sample)

Video: no video

Starting playback...

A:  60.8 (01:00.7) of 667.0 (11:07.0) 10.1%

 

MPlayer interrupted by signal 2 in module: play_audio

Command exited with non-zero status 1

        Command being timed: "mplayer /mnt/audio/01.mp3"

        User time (seconds): 2.66

        System time (seconds): 0.37

        Percent of CPU this job got: 4%

        Elapsed (wall clock) time (h:mm:ss or m:ss): 1m 1.32s

        Average shared text size (kbytes): 0

        Average unshared data size (kbytes): 0

        Average stack size (kbytes): 0

        Average total size (kbytes): 0

        Maximum resident set size (kbytes): 0

        Average resident set size (kbytes): 0

        Major (requiring I/O) page faults: 0

        Minor (reclaiming a frame) page faults: 0

        Voluntary context switches: 4302

        Involuntary context switches: 19

        Swaps: 0

        File system inputs: 0

        File system outputs: 0

        Socket messages sent: 0

        Socket messages received: 0

        Signals delivered: 0

        Page size (bytes): 4096

        Exit status: 1

root:/>

 

Today I repeated my test, however the kernel used for that is not exactly the same as before. Additionally, I played the full song, not only the first one minute of that.

 

I got the following result:

 

root:/> time -v mplayer /mnt/audio/01.mp3

MPlayer dev-SVN-rUNKNOWN-4.1.2 (C) 2000-2007 MPlayer Team

Creating config file: //.mplayer/config

117 audio & 238 video codecs

 

Playing /mnt/audio/01.mp3.

Audio file file format detected.

==========================================================================

Opening audio decoder: [libmad] libmad mpeg audio decoder

AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)

Selected audio codec: [mad] afm: libmad (libMAD MPEG layer 1-2-3)

==========================================================================

AO: [oss] 44100Hz 2ch s16le (2 bytes per sample)

Video: no video

Starting playback...

Cannot sync MAD frame 667.0 (11:07.0) 11.2%

Cannot sync MAD frame 667.0 (11:07.0) 11.2%

A: 338.3 (05:38.3) of 667.0 (11:07.0) 11.2%

 

Exiting... (End of file)

        Command being timed: "mplayer /mnt/audio/01.mp3"

        User time (seconds): 17.04

        System time (seconds): 8.04

        Percent of CPU this job got: 7%

        Elapsed (wall clock) time (h:mm:ss or m:ss): 5m 38.51s

        Average shared text size (kbytes): 0

        Average unshared data size (kbytes): 0

        Average stack size (kbytes): 0

        Average total size (kbytes): 0

        Maximum resident set size (kbytes): 0

        Average resident set size (kbytes): 0

        Major (requiring I/O) page faults: 0

        Minor (reclaiming a frame) page faults: 0

        Voluntary context switches: 23860

        Involuntary context switches: 204

        Swaps: 0

        File system inputs: 0

        File system outputs: 0

        Socket messages sent: 0

        Socket messages received: 0

        Signals delivered: 0

        Page size (bytes): 4096

        Exit status: 0

root:/>

 

This looks quite strange. Later, I will check what is the cause of the defferent results.

 

 

 

Best regards,

 

Gyula

QuoteReplyEditDelete

 

 

2008-05-16 04:19:11     Re: Playing WMA and OGG files with mplayer

Gyula Kovacs (HUNGARY)

Message: 55918   

 

Hi Mike,

 

Originally, I started mplayer with the following command: mplayer /mnt/audio/01-cbr-256.ogg

 

By default, the mplayer used ffmpeg codec for decoding the stream:

 

Playing /mnt/audio/01-cbr-256.ogg.

[Ogg] stream 0: audio (Vorbis), -aid 0

Ogg file format detected.

==========================================================================

Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders

AUDIO: 44100 Hz, 2 ch, s16le, 256.0 kbit/18.14% (ratio: 32000->176400)

Selected audio codec: [ffvorbis] afm: ffmpeg (FFmpeg Vorbis decoder)

==========================================================================

AO: [oss] 44100Hz 2ch s16le (2 bytes per sample)

Video: no video

Starting playback...

A:   2.0 (01.9) of 336.6 (05:36.5) 220.8%

 

If I change the codec: mplayer -ac vorbis /mnt/audio/01-cbr-256.ogg, the playback is ok, and the mplayer  (and time) outputs the following info:

 

root:/> time -v mplayer -ac vorbis /mnt/audio/01-cbr-256.ogg

MPlayer dev-SVN-rUNKNOWN-4.1.2 (C) 2000-2007 MPlayer Team

117 audio & 238 video codecs

 

Playing /mnt/audio/01-cbr-256.ogg.

[Ogg] stream 0: audio (Vorbis), -aid 0

Ogg file format detected.

==========================================================================

Forced audio codec: vorbis

Opening audio decoder: [libvorbis] Ogg/Vorbis audio decoder

AUDIO: 44100 Hz, 2 ch, s16le, 256.0 kbit/18.14% (ratio: 32000->176400)

Selected audio codec: [vorbis] afm: libvorbis (OggVorbis Audio Decoder)

==========================================================================

AO: [oss] 44100Hz 2ch s16le (2 bytes per sample)

Video: no video

Starting playback...

A: 336.4 (05:36.4) of 336.6 (05:36.5) 34.2%

 

Exiting... (End of file)

        Command being timed: "mplayer -ac vorbis /mnt/audio/01-cbr-256.ogg"

        User time (seconds): 97.03

        System time (seconds): 17.52

        Percent of CPU this job got: 33%

        Elapsed (wall clock) time (h:mm:ss or m:ss): 5m 36.95s

        Average shared text size (kbytes): 0

        Average unshared data size (kbytes): 0

        Average stack size (kbytes): 0

        Average total size (kbytes): 0

        Maximum resident set size (kbytes): 0

        Average resident set size (kbytes): 0

        Major (requiring I/O) page faults: 0

        Minor (reclaiming a frame) page faults: 0

        Voluntary context switches: 18214

        Involuntary context switches: 275

        Swaps: 0

        File system inputs: 0

        File system outputs: 0

        Socket messages sent: 0

        Socket messages received: 0

        Signals delivered: 0

        Page size (bytes): 4096

        Exit status: 0

root:/>

 

 

Best regards,

 

Gyula

QuoteReplyEditDelete

 

 

2008-05-16 05:04:19     Re: Playing WMA and OGG files with mplayer

Meihui Fan (CHINA)

Message: 55919   

 

Thanks for the inputs. Your new detailed replay make sense to me.

QuoteReplyEditDelete

 

 

2008-05-16 05:06:12     Re: Playing WMA and OGG files with mplayer

Yi Li (CHINA)

Message: 55920   

 

BF537-STAMP CCLK/SCLK: 500/100 HZ.

 

On svn trunk. Using ad1836 driver.

 

However, there seems some issue with the mplayer on trunk. The audio file cannot be played smoothly. So bellow number is just for reference and I think profiling would help.

 

root:/> mplayer test.mp3                                                      

MPlayer dev-SVN-r6686-4.1.2 (C) 2000-2007 MPlayer Team                        

117 audio & 238 video codecs                                                  

                                                                              

Playing test.mp3.                                                             

Audio file file format detected.                                              

Clip info:                                                                    

Title: It's All Over Now, Baby Blue                                          

Artist: Joan Baez                                                            

Album: Baez Sings Dylan                                                      

Year: 1998                                                                   

Comment:                                                                     

Track: 2                                                                     

Genre: Folk                                                                  

==========================================================================    

Opening audio decoder: [libmad] libmad mpeg audio decoder                     

AUDIO: 44100 Hz, 2 ch, s16le, 256.0 kbit/18.14% (ratio: 32000->176400)        

Selected audio codec: [mad] afm: libmad (libMAD MPEG layer 1-2-3)             

==========================================================================    

AO: [oss] 44100Hz 2ch s16le (2 bytes per sample)                              

Video: no video                                                               

Starting playback...                                                          

A:   9.0 (08.9) of 208.0 (03:28.0)  1.4%                                      

                                                                              

MPlayer interrupted by signal 2 in module: play_audio

QuoteReplyEditDelete

 

 

2008-05-16 05:20:48     Re: Playing WMA and OGG files with mplayer

Meihui Fan (CHINA)

Message: 55921   

 

Your cpu load measured by mplayer is quite low(1.4%).

 

 

 

Can you send me a copy of your built mplayer binary program for blackfin target?

 

 

 

Thank your very much!

 

 

 

mhfan@hhcn.com

Attachments

    Outcomes