22 January 2008, 17:21 | #41 | ||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
Quote:
However, playing a wave file, though much simpler than mpeg audio, is a little bit more complex than just copying data to chipmem. I have code for this, dunno if it can be useful to you. Yes, and 80 khz comes from the speed of the cpu, not the audio hardware. In theory you can reach 3.5Mhz if setting period=1 ! |
||
23 January 2008, 20:06 | #42 | |||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,751
|
Quote:
Quote:
Quote:
|
|||
24 January 2008, 14:53 | #43 | |||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
Quote:
It is as much copying as bmp is : bmp was bgr->rgb. Here it is unsigned->signed (8 bits), little endian (16 bits). Of course few people can tell why it's unsigned if 8 bits and signed if 16. At least it isn't bottom-to-top Things are a little bit more complex when it comes to 16 bit sounds, you have a 14-bit table that comes into play. Here is my conversion code for a mono file (a0=src, a1=dest, d7=# of samples, d6=offset to next channel) : Code:
cn16bl move.l a1,a2 ; v0 (high) - already in a1 add.l d6,a2 ; v1 (low) lea d14b+$8000,a3 .loop move.w (a0)+,d0 ; our sample ror.w #8,d0 ; little -> big endian move.w (a3,d0.w*2),d0 move.b d0,(a2)+ ; low lsr.w #8,d0 move.b d0,(a1)+ ; high subq.l #1,d7 bne.s .loop rts Quote:
However, due to chipmem bandwidth, you simply can't copy the data at this rate. I also have no idea whether the DACs would follow or not. Btw the dma can't cope with periods lower than 123 (28.8 khz), I don't know where's the real limit for a 030 (nor do I know for the copper). |
|||
25 January 2008, 05:41 | #44 | ||||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,751
|
Quote:
Quote:
Quote:
Quote:
|
||||
25 January 2008, 11:31 | #45 | ||||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
Ever noticed that every system-friendly copper program gives a static result ? Quote:
Things become different if we need to downsample. With 44.1 khz (stereo) we have 566 clock cycles (or so) per sample so we'd better be fast. Quote:
Quote:
A limit of 1.5mb per sec, for 4 channels, would be 375khz. Not bad. But the copper has no way to find out if a new data is required or not in AUDxDAT (the cpu simply examines the interrupt request). I really wonder how you plan on solving that issue. |
||||
28 January 2008, 13:32 | #46 | |||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,751
|
Quote:
Quote:
Quote:
|
|||
28 January 2008, 15:23 | #47 | ||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
Quote:
(it's *2 because of stereo) Downsampling is basically very similar to down scaling graphics, just averaging will do the trick. For more advanced methods they will differ ; just don't attempt dithering for audio or you'll likely add noise. Of course for audio you only have 1 dimension, not 2 (you have stereo but you treat this as 2 independent waveforms). The hardware keeps playing the last sample put into AUDxDAT even if you don't want it to (e.g. if you're too slow). But I don't see any link with the double-buffering |
||
28 January 2008, 17:06 | #48 | ||||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,751
|
Quote:
Quote:
Quote:
Quote:
|
||||
28 January 2008, 17:57 | #49 | |||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
Quote:
If you want to see my actual player code (very crude and experimental I'm afraid), you can find it here : http://meynaf.free.fr/tmp/p.zip ... and sorry for the french comments again Quote:
|
|||
29 January 2008, 10:11 | #50 | |||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,751
|
Quote:
Quote:
Quote:
By the way (to get back on topic ), have you made any progress with that damned layer 3 decoding? |
|||
29 January 2008, 11:59 | #51 | ||||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
Quote:
So I won't worry about the comments. Just don't hesitate to ask me instead of trusting online translators Quote:
Quote:
When dealing with high cpu use like in mp3, you simply can't do an ordinary double-buffering. The decoder will send you frames of 1152 (sometimes 576) samples, this is way too small and the slightest activity in the background will make you miss the deadline and have a "hole" in your replay (my actual "p" program emits a warning after it ended the playing, if such thing occured). Furthermore, I wanted to downsample 44.1 to 26.46 khz instead of 22.05 to get better quality. It's not hard to do, however the data I receive from the codec won't be a size it can handle (should be a multiple of 10 samples). And to add another layer of trouble, if you collect many frames before sending them to audio output, there'll be a long delay between the typed command and the time you hear something. Not to mention your chimem buffer not being a multiple of the frame length. Oh, and, yes, did I tell about the file reading problem ? An mp3 is better when read entirely in memory as there will be no i/o while decoding (speed is critical), but that's not the case with a huge wave file... but it could be with a small one If you have ideas, you're welcome... PS: more banghead here - (that thing's driving me nuts, please forgive me ) |
||||
29 January 2008, 15:03 | #52 | ||||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,751
|
Quote:
Quote:
Quote:
Quote:
|
||||
29 January 2008, 15:55 | #53 | ||||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
Quote:
Quote:
Quote:
For read buffers there should be a limit ; if the file fits within the limits it is completely read, else a reasonable buffer size is chosen. But what sizes to chose ??? Actually my player has two options to set up buffers : . maxmem n : n is a number of kilobytes, the max length of the read buffers (will use less memory if the file is smaller than that) . chipbuf n : n is 0 to 5 but I don't remember the exact buffer sizes it gives, it's for chipmem buffers You can test it and tell me what you think of it. If you want files to be played with it I can give you some. |
||||
29 January 2008, 17:07 | #54 | ||||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,751
|
Quote:
Quote:
Quote:
Quote:
|
||||
29 January 2008, 18:32 | #55 | ||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
If you don't know where to look, the source name usually suggests what it does... are they unclear to you ? Quote:
My aiff support is very basic, so I won't be surprised if you run into a problem... |
||
31 January 2008, 15:53 | #56 | |||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,751
|
Quote:
Quote:
Quote:
|
|||
31 January 2008, 16:19 | #57 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
No problem then
Don't hesitate to ask if a particular file looks mysterious to you. I'm eager to see - errh, sorry, to hear - your first results ! I did the aiff implementation before reading the spec, that's why |
01 February 2008, 18:00 | #58 | |||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,751
|
Quote:
Quote:
Quote:
|
|||
04 February 2008, 09:51 | #59 | ||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
Quote:
Anyway it shouldn't crash I will fix this someday. Just need to get a correct frequency from this 10-byte float value (they use an extended 80-bits float to store replay frequency, it looked incredible to me !). |
||
04 February 2008, 15:32 | #60 | ||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,751
|
Quote:
Quote:
|
||
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can it be faster? | oRBIT | Coders. General | 2 | 16 May 2011 20:38 |
Chipram 3x faster? | oRBIT | Coders. General | 10 | 20 July 2010 02:13 |
mpega.library (WarpUP) problem | radzik | support.Apps | 23 | 14 December 2009 17:05 |
Making a shared library from a gcc .a library | JoJo | Coders. General | 1 | 10 March 2003 19:06 |
Faster Emu | Radgam | support.WinUAE | 3 | 27 February 2003 17:16 |
|
|