Portable Multimedia Player on Intel Xscale Outline
Total Page:16
File Type:pdf, Size:1020Kb
Portable Multimedia Player on Intel XScale Outline Introduction Installation libmad Mplayer with FFmpeg and libmad Running Mplayer DVFS Mplayer with DVFS Result Introduction :: Goal Make a media player Plays mp3 Plays various movie files Make it energy-efficient Lower CPU frequency as long as it can play the media file in real- time Sample Files Mp3(320kbps, 128kbps) Divx(640 X 272, 320 X 136, 160 X 68) Report the optimal operating frequency For each media file Maybe you can make it lower with optimized-codecs (optional) libmad, xvid… Introduction :: Media Player …010110… …1110101010110… Video Codec Display …101011… …1010011001011… Audio Codec Speaker MedMediaia FFiillee :: avavii,, mpgmpg,, movmov,, …… VVideoideo CodecCodec :: mpeg1,mpeg1, 22,, 44,, ddiivxvx,, …… AudAudioio CodecCodec :: mp3,mp3, ww m m a, a, rara,, …… Introduction :: FFmpeg A audio/video codec package libavformat : file format parser and generator libavcodec : av encoders and decoders libavutil : various utilities Many PMP devices are actually using FFmpeg Supported Codecs Almost everything! http://ffmpeg.sourceforge.net/ffmpeg-doc.html http://ffmpeg.sourceforge.net/index.php Introduction :: Mplayer The most popular media player on Linux Many ports on various machines Work with many other codecs Internal codecs FFmpeg Libmad Xvid … http://www.underbit.com/products/mad/ Installation :: General Information Installation Steps Host Download source Run configure with proper options Build it(make, make install) Target Make a symbolic link to the library Run the application This slide assumes.. Host user name is ‘embedded’ Use arm-linux-gcc version 3.3.2 All the libraries will be installed in /home/embedded/local/lib Host home(/home/embedded/) is exported by NFS to target /mnt/arm Installation :: Mplayer 1/2 Download mplayer source from CVS server # cvs -z3 -d:pserver:[email protected]:/cvsroot/mplayer co -P main Formal release is too out-dated Download ffmpeg source from CVS server(to a different dir) # cvs -z9 -d:pserver:[email protected]:/cvsroot/ffmpeg co ffmpeg Formal release doesn’t build with mplayer Copy the following directories from ffmpeg to mpalyer libavformat libavcodec libavutil Installation :: Mplayer 2/2 Configure # ./configure --enable-fbdev -- prefix=/home/embedded/local --target=arm-linux --cc=arm-linux-gcc --host-cc=gcc --enable-fbdev : use framebuffer video Build with ffmpeg(autodetected) Build # make # make install Running Mplayer 1/2 ‘man mplayer’ on the host Examples # ./mplayer test.mp3 Use internal codec to play test.mp3 # ./mplayer –ac ffmp3 test.mp3 Use ffmpeg mp3 codec to play test.mp3 #./mplayer –zoom –x 240 –y 160 –ac ffmp3 test.avi Play a video with 240X160 resolution Mainstone supports to 240X320 Play audio with libmad Running Mplayer 2/2 Check CPU utilization Create a telnet terminal, and run ‘top’ utility Experiments Play with various decoders For mp3, use –ac mad, -ac ffmp3 Play various sized movies 640 X 480, 320 X 240, 240 X 180, 160 X 120… DVFS :: Dynamic Voltage and Frequency and Scaling? Change operating frequency and voltage supply dynamically To exploit tradeoff between performance vs power consumption Featured in modern processors Intel Pentium M, XScale Transmeta Crusoe … DVFS :: PXA27x Clock Overview Run Mode X N Turbo Mode Core PLL X L Half Turbo Memory/LCD External 13Mhz UART Oscillator Peripheral PLL I2C Ex) L = 16, N = 2 MMC Turbo Mode = 416Mhz …… DVFS :: How to Change? Reconfigure PLL Modify a few registers Operate in a completely new configuration Take a lot of time( ~ a few ms) Normal<->Turbo Modify only CP14 register Change between preset frequencies Take only a little time (under us) For detailed information, refer to PXA27x Developer’s Manual DVFS :: PXA27x Operating Modes asdf Normal Turbo DVFS :: Usage dvfm voltage and frequency scaling utility Usage # dvfm l_value 2n_value fast_bus_mode turbo_mode mem_clk_conf Examples # dvfm 16 5 1 2 1 520Mhz Turbo Mode # dvfm 8 6 1 0 1 104Mhz Normal Mode For various operating modes, refer to previous page MPlayer with DVFS Play some media files While playing, change frequency using dvfm Check CPU utilization with ‘top’ Result Lowest Operating Frequency? MP3 320Kbps 128Kbps AVI (divx 4.0) 640 X 272 320 X 136 160 X 68 With another codec(optional)?.