home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 24 / CDACTUAL24.iso / SHARE / os2 / mp123 / mpg123.txt < prev    next >
Encoding:
Text File  |  1998-04-13  |  8.0 KB  |  211 lines

  1. PM123 beta decoder notes
  2. ========================
  3.  
  4. This file is from my mpg123 port readme, but it still applies to the
  5. decoder part of pm123.  Until I have time to reformat this, and until pm123
  6. interface stabalizes, the following should be nonetheless usable.
  7.  
  8.  
  9. mpg123 0.59m for OS/2  (mpg123/2 0.11)
  10. Modified and ported by Samuel Audet <guardia@cam.org> (C) 1998
  11.  
  12. Introduction
  13. ============
  14.  
  15. I got sooo fed up with other ports (and their authors) of other MP3 players
  16. for OS/2 that I just decided to kludge mine up.  Here are the reasons for
  17. those interested:
  18.  
  19. - Nobody could (nor wanted to) get a working dynamic priority engine.  It WAS
  20.   quite annoying having to chose between a slowly responsive system and
  21.   skipping MP3s.  but no more!  mpg123/2 is here!
  22.  
  23. - Not a freaking single player could tell me the remaining time of an MP3,
  24.   come on guys!  Even the cheapest CD player can do that.
  25.  
  26. - There were no players that could fast forward, rewind, or jump to an
  27.   arbitrary value in an MP3 file, but it is now a reality!  Now we just
  28.   need get something like XAudio or X11Amp to easily get all that juicy
  29.   stuff without using the current kludges in mpg123.  Hey BTW, XAudio dudes
  30.   are looking for a FREE copy of Warp 3 or 4 (at least Gilles Boccon-Gibod
  31.   <bok@bok.net> is).  Check their web page http://www.xaudio.com .  If you
  32.   send them something, let me know, I'll guide them to program in OS/2.
  33.  
  34. - No players could smooothly play an MP3 file... I couldn't even do a "dir"
  35.   without it jerking.  But now, you can even play DOS games with the
  36.   remaining CPU time! (although some games' sound engine don't like it
  37.   anyway).
  38.  
  39. - And last but not least, mpg123/2 opens the audio device in shareable mode
  40.   by default.  What's the use of having a brain and human ear that can
  41.   differentiate different sounds in the a stream if you have your sound
  42.   device locked to play ONE damn MP3!?!?  Now answer me... doesn't make sense
  43.   to me. And you can also choose which sound card to use.
  44.  
  45. The EXE has been compiled with Pentium optimized GCC 1.0, and linked with
  46. ILINK 01.08.r1a_CTC308c (?), but to save space, as usual you will need the
  47.  
  48.                            ************
  49.                            *-=LATEST=-* (ie.: the most recent version)
  50.                            ************
  51. EMX runtime libraries.
  52. ftp://hobbes.nmsu.edu/pub/os2/dev/emx/v0.9c/emxrt.zip
  53. GCC290.DLL is a new DLL like the EMX ones, so you might as well keep it.
  54.  
  55. I'm looking for some information on how to program an equalizer (the one in
  56. mpg123 source code is a sound mangler).
  57.  
  58. And NO, I don't want to do anything what so ever for 8 bit sound support.
  59. Get your ass up and buy a $10 16 bit sound card down the street.
  60.  
  61.  
  62. Notes on features
  63. =================
  64.  
  65. Read mpg123.txt for things not discussed here.
  66.  
  67. Dynamic priority boost
  68. ----------------------
  69.  
  70. What it does, is that it checks if the second ahead buffer is filled, if it
  71. is not, it boosts the decoder priority.  When the decoder realizes it has
  72. the third ahead buffer filled, it drops to normal priority. The second
  73. buffer ahead is important here.  During a boost, priority should normally
  74. be in time critical class, where the decoder can get all the CPU attention
  75. it needs.  Up there, if the CPU is fast enough to decode and fill the
  76. second ahead buffer before the first ahead buffer is played (which is
  77. always the case if your CPU can play MP3s in realtime in the first place),
  78. you can easily imagine it's impossible for mpg123/2 to skip in those
  79. conditions.  I have played *2* MP3s on my P150 and watched a "dir /s"
  80. smooothly and happily scrolling in the foreground without either MP3
  81. skipping... I think that's pretty convincing.
  82.  
  83. I know hardware level bottlenecks which could make mpg123/2 skip, but they
  84. are the same ones that can make a Zmodem transfer give "CRC32 errors", and
  85. a PPP connection complains about "Invalid FCS":
  86.  
  87. - You have a polling device (like for example old old 2x CD-ROMs, and
  88.   PRINT01.SYS without /IRQ).
  89. - You have a video card that supports "automatic PCI bus retry", but your
  90.   motherboard stops processing during those retries.  Disable that feature.
  91. - You have an ATI Barf64 and you are experiencing a bug in the video driver
  92.   using software mouse pointers (ie.: colored mouse pointers).
  93.  
  94. I recommend the default values that are class Time Critical delta 0 for
  95. boost and Regular delta 31 for normal.  The former leaves higher priority
  96. tasks like multimedia do their job.  The latter permits mpg123/2 to have
  97. priority over hogging DOS and Win-OS/2 sessions while leaving foreground
  98. OS/2 application responsive.
  99.  
  100. However, I recently found out that dynamically resizing a heavy window
  101. (like a webbrowser or wordprocessor) hogs the CPU beyong belief.  Rest
  102. calm, this is not a failure of the Dynamic Priority Boost.  You can try it
  103. with mpg123 running with -b 5 -B 330 -N 330 and it will still skip.
  104.  
  105. The format for the priority parameters -B and -N is [class number][delta number]
  106.  
  107. class number in order of priority: 1,2,4,3
  108. delta number varies from -31 to 31
  109.  
  110. For example:  use normal priority Foreground delta -31
  111.  
  112. [C:\]mpg123 -N 4-31
  113.  
  114. If you don't want to use dynamic priority boost, just set -B and -N to the
  115. same value.
  116.  
  117.  
  118. Buffers
  119. -------
  120.  
  121. You can specify the number of audio buffer to fill in advance.  The default
  122. is 32, and since each buffer is 16KB, this gives about 3 seconds decoder
  123. independancy to the audio engine before a priority boost or a skip occurs
  124. with 44.1kHz, 16bit and stereo output.
  125.  
  126. The recommended minimum is 5, and the _bare_ minimum (ie.: if you don't
  127. want to) is 4.
  128.  
  129.  
  130. Rewind, Fast Forward, Position Jump
  131. -----------------------------------
  132.  
  133. They are still only kludges. Especially the rewind.  I only used some
  134. already in place code in mpg123.  Well they work, so it's better than
  135. nothing for now.  You will have problems with rewind around the 0 seconds.
  136. Try 5 or more seconds.
  137.  
  138. The Jump to accepts seconds, or minutes and seconds separated by a colon.
  139.  
  140. ie.: Jump to: 1:50  or Jump to: 110
  141.  
  142. Since these mechanisms act upon the decoder, the more audio buffer you have,
  143. the greater the latency.  With 5 buffers, you have less than half a second
  144. latency.
  145.  
  146.  
  147. The Played, Remaining and Total timers
  148. --------------------------------------
  149.  
  150. None of them relies on the system timer.  It only counts the number of
  151. frames that have passed by (that is, played by the audio device, so in a
  152. certain sense, the audio device determines where we are).  The calculation
  153. seems to work, if they don't on some MPEG Audio streams, oh well...
  154.  
  155. It should also be noted that the Total time is updated each frame, so if
  156. you are currently playing an MP3 being d/led, the total time will increase
  157. with it.
  158.  
  159. These also act on the decoder, so it shows the amount _decoded_ and not
  160. _played_ per se.
  161.  
  162. Of course, they make mpg123 use a tiny bit more CPU time...
  163.  
  164.  
  165. MP3 filenames and playlists
  166. ---------------------------
  167.  
  168. Ok, a nice little feature requested by William Young <young@phonet.com>.
  169. You don't have to specify ".mp3", mpg123/2 will automatically append it if
  170. it doesn't find the file.
  171.  
  172. A trick to easily generate playlists:
  173.  
  174. [C:\MP3]dir /f/-p > playlist
  175.  
  176. Use /s for all subdirs.
  177.  
  178.  
  179. Well have phun!  Expect to see some nice MP3 player around (maybe pm123?).
  180.  
  181.  
  182. Legal stuff
  183. ===========
  184.  
  185. This freeware product is used at your own risk, although it is highly
  186. improbable it can cause any damage.
  187.  
  188. If you plan on copying me, please give me the credits, thanks.
  189.  
  190. Oh and SDG you are not allowed to use this sound engine until you implement
  191. all the features in here AND LET ME TRY IT BEFORE YOU DISTRIBUTE IT. That
  192. should do it. :)
  193.  
  194.  
  195. Contacting the author
  196. =====================
  197.  
  198. Samuel Audet
  199.  
  200. E-mail:      guardia@cam.org
  201. Homepage:    http://www.cam.org/~guardia
  202. IRC nick:    Guardian_ (be sure it's me before starting asking questions though)
  203. Talk Client: Guardian@guardian.dyn.ml.org
  204.  
  205. Snail Mail:
  206.  
  207.    377, rue D'Argenteuil
  208.    Laval, Quebec
  209.    H7N 1P7   CANADA
  210.  
  211.