home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Multimed / Multimed.zip / jmpg123.zip / mpg123.txt < prev    next >
Text File  |  1998-06-10  |  5KB  |  138 lines

  1. mpg123.dll from pm123 beta 2 based on mpg123 0.59m
  2. Samuel Audet <guardia@cam.org> (C) 1998
  3.  
  4. BTW I'm looking for some information on how to program an equalizer (the one in
  5. mpg123 source code is a sound mangler).
  6.  
  7. For programmers, the DLL can be used seperatetely from pm123.  mp123.h
  8. explains what you need to know in C.  An example is include in test.c.  Use
  9. mpg123.lib to compile.
  10.  
  11. It can also be used in REXX.  However, since I don't know if people will
  12. find this useful, I didn't take the time to make a documentation on how to
  13. use it in REXX, but I'm sure anybody can manage to get something working by
  14. looking at test.cmd and mp123.h.
  15.  
  16. Notes on features
  17. =================
  18.  
  19. This is from mpg123/2 0.20 documentation.
  20.  
  21. Dynamic priority boost
  22. ----------------------
  23.  
  24. What it does, is that it checks if the second ahead buffer is filled, if it
  25. is not, it boosts the decoder priority.  When the decoder realizes it has
  26. the third ahead buffer filled, it drops to normal priority. The second
  27. buffer ahead is important here.  During a boost, priority should normally
  28. be in time critical class, where the decoder can get all the CPU attention
  29. it needs.  Up there, if the CPU is fast enough to decode and fill the
  30. second ahead buffer before the first ahead buffer is played (which is
  31. always the case if your CPU can play MP3s in realtime in the first place),
  32. you can easily imagine it's impossible for mpg123/2 to skip in those
  33. conditions.  I have played *2* MP3s on my P150 and watched a "dir /s"
  34. smooothly and happily scrolling in the foreground without either MP3
  35. skipping... I think that's pretty convincing.
  36.  
  37. I know hardware level bottlenecks which could make mpg123/2 skip, but they
  38. are the same ones that can make a Zmodem transfer give "CRC32 errors", and
  39. a PPP connection complains about "Invalid FCS":
  40.  
  41. - You have a polling device (like for example old old 2x CD-ROMs, and
  42.   PRINT01.SYS without /IRQ).
  43. - You have a video card that supports "automatic PCI bus retry", but your
  44.   motherboard stops processing during those retries.  Disable that feature.
  45. - You have an ATI Barf64 and you are experiencing a bug in the video driver
  46.   using software mouse pointers (ie.: colored mouse pointers).
  47. - Your motherboard or controller card plain sucks.
  48.  
  49. I recommend the default values that are class Time Critical delta 0 for
  50. boost and Regular delta 31 for normal.  The former leaves higher priority
  51. tasks like multimedia do their job.  The latter permits mpg123/2 to have
  52. priority over hogging DOS and Win-OS/2 sessions while leaving foreground
  53. OS/2 application responsive.
  54.  
  55. However, I recently found out that dynamically resizing a heavy window
  56. (like a webbrowser or wordprocessor) hogs the CPU beyong belief.  Rest
  57. calm, this is not a failure of the Dynamic Priority Boost.  You can try it
  58. with mpg123 running with -b 5 -B 330 -N 330 and it will still skip.
  59.  
  60. The format for the priority parameters -B and -N is [class number][delta number]
  61.  
  62. class number in order of priority: 1,2,4,3
  63. delta number varies from -31 to 31
  64.  
  65. For example:  use normal priority Foreground delta -31
  66.  
  67. [C:\]mpg123 -N 4-31
  68.  
  69. If you don't want to use dynamic priority boost, just set -B and -N to the
  70. same value.
  71.  
  72.  
  73. Buffers
  74. -------
  75.  
  76. You can specify the number of audio buffer to fill in advance.  The default
  77. is 32, and since each buffer is 16KB, this gives about 3 seconds decoder
  78. independancy to the audio engine before a priority boost or a skip occurs
  79. with 44.1kHz, 16bit and stereo output.
  80.  
  81. The recommended minimum is 5, and maximum is 200.
  82.  
  83.  
  84. Rewind, Fast Forward, Position Jump
  85. -----------------------------------
  86.  
  87. These are only "kludges".  They kind of work fine on consistent MPEG stream,
  88. but MPEG streams are not like straight PCM files.  They contain packets all
  89. over the place.  To make it work properly, I'd have to read all of them,
  90. and it would make the player seek a lot slower.
  91.  
  92. The Jump to accepts seconds, or minutes and seconds separated by a colon.
  93.  
  94. ie.: Jump to: 1:50  or Jump to: 110
  95.  
  96.  
  97. The Played, Remaining and Total timers
  98. --------------------------------------
  99.  
  100. None of them relies on the system timer.  It only counts the number of
  101. frames that have passed by (that is, played by the audio device, so in a
  102. certain sense, the audio device determines where we are).  The calculation
  103. seems to work fine on the MPEG streams I tried, but because of the above,
  104. the timers might get lost on inconsistent MPEG streams.
  105.  
  106. It should also be noted that the Total time is recalculated each frame, so
  107. if you are currently playing an MP3 being d/led, the total time will
  108. increase with it.
  109.  
  110. Of course, they make mpg123 use a tiny bit more CPU time...
  111.  
  112.  
  113. Legal stuff
  114. ===========
  115.  
  116. This freeware product is used at your own risk, although it is highly
  117. improbable it can cause any damage.
  118.  
  119. If you plan on copying me, please give me the credits, thanks.
  120.  
  121.  
  122. Contacting the author
  123. =====================
  124.  
  125. Samuel Audet
  126.  
  127. E-mail:      guardia@cam.org
  128. Homepage:    http://www.cam.org/~guardia
  129. IRC nick:    Guardian_ (be sure it's me before starting asking questions though)
  130. Talk Client: Guardian@guardian.dyn.ml.org
  131.  
  132. Snail Mail:
  133.  
  134.    377, rue D'Argenteuil
  135.    Laval, Quebec
  136.    H7N 1P7   CANADA
  137.  
  138.