Welcome, Guest. Please login or register.

Author Topic: mp3 playing on 68k  (Read 1544 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline kas1eTopic starter

mp3 playing on 68k
« on: April 27, 2004, 03:04:16 AM »
hi all. i have some questions about mp3 playing.i want play mp3 on 040/060 over mpega.library. how i can do it ? how i can do it faster ? i mean step by step.

mpega can't play mp3, just decode to raw. but how i can play my mp3 (library,funcs)?

thnx all, sorry for lame questions.
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: mp3 playing on 68k
« Reply #1 on: April 27, 2004, 03:21:49 AM »
On 060 you should be able to get away with realtime decode at up to 44kHz...

The 040 struggles a bit. I found I could only play 22kHz mono on a 25MHz 040 (that was ages ago, however) if I wanted realtime playback.

I recall there was an mpega.library clone recently that used integer (fixed point) rather than floating point maths and is supposedly a fair amount faster on slower CPUs. Not totally sure, however.

Quote
thnx all, sorry for lame questions.


Bad pun ;-)

-edit-

Of course, if you want low overhead, high quality output, you could opt for one of those parallel port decoder things :-)
int p; // A
 

Offline QuikSanz

Re: mp3 playing on 68k
« Reply #2 on: April 27, 2004, 03:58:27 AM »
Hi,

My A2000 060 on DSL can handle Up to 128bit, mostly. From HD, it seems to run up to about high 200's. Next up, repulse update has something called "extract stream". I'll get an optical cable and plug into my DVD and see how much processor load is reduced.This could be nice.

Chris
 

Offline DaNi

  • Sr. Member
  • ****
  • Join Date: Oct 2003
  • Posts: 281
    • Show only replies by DaNi
    • http://morphos.blog.com.es/
Re: mp3 playing on 68k
« Reply #3 on: April 27, 2004, 09:26:56 AM »
you need to use with mpega.library, on my 060 work perfect with the mdalib version optimized for 060. Use the non-fpu version becouse the "normal2 version is much faster compared with the fpu version.
You can use MPEGA (you can see on sys:c dir), this play mpega audio and mpega.library madlib version 060.
Amplifier 2.34 work perfect for play mp3 on 060 =)

PS: for full mp3 play on 040 you need the 40mhz version of this cpu or you can use atlantis or massplayer for decode all by hardware :P

Cheers
EFIKA 5K2 PowerPC G2 400Mhz, MorphOS 2.7, 128MB 266MHz DDR RAM, FSB 133MHz, 500GB HDD, Radeon 9200 PRO 128MB, USB HUB x8.
 

Offline mendark

  • Full Member
  • ***
  • Join Date: Oct 2002
  • Posts: 161
    • Show only replies by mendark
Re: mp3 playing on 68k
« Reply #4 on: April 27, 2004, 11:00:02 AM »
The non-fpu version is great (mpega & madlib). Quality is acceptable and the speed is great. I always play my mp3z at 22khz because there is'nt much hearable differnce when it plays in the back, but it surely helps when multitasking :D
Amplifier is very fast too.  
For encoding to wav, I suggest the fpu (mpega or madlib) version because this sounds sooo much better (less hiss and mp3 artifacts)
 

Offline kas1eTopic starter

Re: mp3 playing on 68k
« Reply #5 on: April 27, 2004, 12:15:24 PM »
sorry all, but my problem is not a "what progs need to me for mp3 play ", but "how i can play mp3 on C". i mean - i try to write little program on sas-c for mp3 playing. i know, for it, i must use mpega.library, but mpega.library have only decode,etc fuction. i mean just decode, not playing. So:

#include
main(){
/* here i open mpega.library */
/* decode mp3 to raw ? */
/* what funcs in aos i must use for play my raw data ? */

so, my question "how i can play mp3 on sas-c". what fuction i must use, etc.

thanks agayn and sorry for poor enlish.

 

Offline Daedalus

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 893
    • Show only replies by Daedalus
    • http://www.robthenerd.com
Re: mp3 playing on 68k
« Reply #6 on: April 27, 2004, 12:26:23 PM »
The MPEGA libraries are interchangeable, you can rename any of the cpu optimised versions to mpega.library and you'll have the characteristics of that version, such as faster decoding with the integer decoding, more accurate decoding with the fpu version etc...
Engineers do it with precision
--
http://www.robthenerd.com
 

Offline kas1eTopic starter

Re: mp3 playing on 68k
« Reply #7 on: April 27, 2004, 12:54:42 PM »
oh mans .. i choiсe this topic - amigaos develop. not amigaos beginer. not "how i can use library". i need write prog on C. for play mp3 ! :) i know that mpega.library is good for _decode_. i know, but my problem in aos fuctions for playing this _decoded_ data :)

ps. where a you, aos programmer?
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: mp3 playing on 68k
« Reply #8 on: April 27, 2004, 01:02:54 PM »
Quote

kas1e wrote:
sorry all, but my problem is not a "what progs need to me for mp3 play ", but "how i can play mp3 on C". i mean - i try to write little program on sas-c for mp3 playing. i know, for it, i must use mpega.library, but mpega.library have only decode,etc fuction. i mean just decode, not playing. So:

#include
main(){
/* here i open mpega.library */
/* decode mp3 to raw ? */
/* what funcs in aos i must use for play my raw data ? */

so, my question "how i can play mp3 on sas-c". what fuction i must use, etc.

thanks agayn and sorry for poor enlish.



I've never used mpega.library, but it probably decodes data into a buffer you set up (perhaps arranged as pairs of WORD for stereo 16-bit etc.) with the decode function you mention. I expect you can specify the length of the buffer to use.

You need to be able to play this - if you look at the documentation for AHI, you will see it has a high level device interface that can play data arranged this way.

You can also set up a double buffer and AHI will keep playing from each alternate buffer. This allows you to fill one buffer while AHI is playing the alternate one. This is described in the AHI documentation.

Sorry for the lack of detail but I don't have the documentation to hand presently.
int p; // A
 

Offline whabang

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 7270
    • Show only replies by whabang
Re: mp3 playing on 68k
« Reply #9 on: April 27, 2004, 01:07:44 PM »
I managed to get low-bitrate MP3s (64kbps) playing with my old 030. I was choppy at times, and quality sucked, but it worked!  :)

I think that a 040@50 is a minimum if you're thinking about music playback.
Beating the dead horse since 2002.
 

Offline Thomas

Re: mp3 playing on 68k
« Reply #10 on: April 27, 2004, 02:01:31 PM »

The easiest way to play some audio samples using AHI is this:

Code: [Select]

BPTR file;
UWORD *buffer;
LONG buffersize;

file = Open("AUDIO:b/16/c/2/f/44100",MODE_NEWFILE);
Write (file,buffer,buffersize);
Close (file);


It assumes that the buffer is filled with 16 bit stereo samples at 44.1 kHz.

Bye,
Thomas

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: mp3 playing on 68k
« Reply #11 on: April 27, 2004, 02:22:29 PM »
@Thomas

If you made a Process to run your example code in a loop using a pair of Semaphore protected memory buffers, you could even make your own double buffered routine and do the decoding in the main thread :-)

Not sure how efficient that would be compared to the genuine double buffered device IO approach. Probably a fair bit more overhead. But it would be a laugh :-D
int p; // A
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show only replies by itix
Re: mp3 playing on 68k
« Reply #12 on: April 27, 2004, 02:25:26 PM »
Topic is wrong, it should read "AHI playing on 68k" :-)

Read AHI documentation. There are examples :-D It is not very difficult really.

You can also use DOS interface suggested by Thomas.
My Amigas: A500, Mac Mini and PowerBook