Dreamcast Media Center

This forum is for discussion pertaining to homebrew and indie software for the Dreamcast, such as homebrew games, emulators/interpreters, and other homebrew software/applications. Porting requests and developmental ideas are not to be made here; you can make those here. If you need any help burning discs for homebrew software, this is the place to ask as well.
Post Reply
Chilly Willy
DC Developer
DC Developer
Posts: 414
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Thu Aug 20, 2009 11:00 am
Has thanked: 0
Been thanked: 2 times

Re: Dreamcast Media Center

Post by Chilly Willy »

I doubt the lack of a cache makes THAT much of a difference to the MIPS. A 68000 will give about 3 MIPS at that clock rate, and the ARM7 is MUCH more efficient about clock usage. In fact, the speed of nearly all instructions are limited by the how fast the bus is; if the bus allows load/store in a single cycle, most ARM instructions are only 2 or 3 cycles long. Given the instructions are 32 bits and the ram bus for the audio in the DC is 16, that should probably be doubled, but that's still MUCH faster than a 68000. The bus speed for the DC sound ram is supposed to be 66MHz, but the CPU will be sharing that with the sound channels, so if a lot of channels are playing, you will slow the CPU down. I doubt a few channels will slow the CPU at all. It sounds like it's close to what you need for SPEEX, which takes 5 to 10 MIPS to decode. It might be worth trying.

Do you have any more specific info on the CPU? Like what the FIQ hooks to (if anything)? I have the ARM7DI datasheet - at least that was easy to find.
Ayla
DC Developer
DC Developer
Posts: 142
Joined: Thu Apr 03, 2008 7:01 am
Has thanked: 0
Been thanked: 4 times
Contact:

Re: Dreamcast Media Center

Post by Ayla »

Have a look at that:
viewtopic.php?f=29&t=51558&p=545827&hilit=+aica#p545827

Heliophobe (RIP) theorized that the ARM would virtually run at ~2.8MHz.
What's funny here is that I benchmarked it, and measured ~2.7 MIPS.

The big problem is that even if the channels are disactivated the mixer still use as much memory baudwidth (see last line of the post).

You can generate a FIQ on the ARM with a end of DMA transfer, a timer event, or from the SH-4, and probably from the DSP.
Does that answer your question (sorry if I didn't get it correctly)?
Chilly Willy
DC Developer
DC Developer
Posts: 414
Joined: Thu Aug 20, 2009 11:00 am
Has thanked: 0
Been thanked: 2 times

Re: Dreamcast Media Center

Post by Chilly Willy »

That was all conjecture. I rather doubt the AICA keeps the registers in ram - that's just plain silly and was only even suggested because it was the only way the person could think of using ram cycles to slow the ARM. It's more likely like Quzar mentioned - that speed control for the ARM... perhaps it's not the master clock but the bus clock for the ARM. It seems there needs to be some more testing done.

The info on the FIQ is what I meant, but where are the specifics? I'm having trouble finding that in the KOS code.

By the way, the multiply on the ARM7DI takes a minimum of 2 clock cycles, and a max of 17 clock cycles... assuming no bus slow downs.
Ayla
DC Developer
DC Developer
Posts: 142
Joined: Thu Apr 03, 2008 7:01 am
Has thanked: 0
Been thanked: 4 times
Contact:

Re: Dreamcast Media Center

Post by Ayla »

Yes it does, but as far as I remember the ARM7DI does not have a 32*32=>64 mul opcode, so a MP3 player which would be possible on a 25MHz ARM7TDMI becomes impossible here.

And as you said, Heliophobe conjectured it. However, as I said earlier, I did benchmark it, with a hand-made ASM program which counts the number of NOP instructions executed in one second. And the speed control register does not help at all (and I guess it overclocks correctly, it crashes the ARM with too high values) : the MIPS value I get is still the same, probably because while the clock is higher, the processor still spends its time waiting tiredlessly.

About the AICA, all the info you need is on one file I mirrored here: http://crapouillou.net/~paul/aica_v08.txt
Chilly Willy
DC Developer
DC Developer
Posts: 414
Joined: Thu Aug 20, 2009 11:00 am
Has thanked: 0
Been thanked: 2 times

Re: Dreamcast Media Center

Post by Chilly Willy »

Ayla wrote:Yes it does, but as far as I remember the ARM7DI does not have a 32*32=>64 mul opcode, so a MP3 player which would be possible on a 25MHz ARM7TDMI becomes impossible here.
Yeah, it's 32*32->32. That can be used to make a 64 bit multiply exactly like the 16*16->32 on the 68000, but it's still slower doing so. You'd have to find some way around that... new assembly code that perhaps loses accuracy in exchange for speed. Still, it looks like it's probably not possible. SPEEX might be given its lower computational requirements.

And as you said, Heliophobe conjectured it. However, as I said earlier, I did benchmark it, with a hand-made ASM program which counts the number of NOP instructions executed in one second. And the speed control register does not help at all (and I guess it overclocks correctly, it crashes the ARM with too high values) : the MIPS value I get is still the same, probably because while the clock is higher, the processor still spends its time waiting tiredlessly.
Hmm - how did you time it? It might be worth trying to do several million nops while timing it by hand to double check that it wasn't some timer issue.

About the AICA, all the info you need is on one file I mirrored here: http://crapouillou.net/~paul/aica_v08.txt
Ah, I see. Thanks!

One thing I noticed in that note is that the DSP uses a ring buffer for the DSP program. Given there's a pointer and size you set, that would be in ram. So perhaps it's the DSP slowing the bus access by the ARM. That would make more sense than blaming it on the AICA channel registers. Perhaps a different DSP program would help. Of course there's even less on the DSP than the rest.
User avatar
PH3NOM
DC Developer
DC Developer
Posts: 576
Joined: Fri Jun 18, 2010 9:29 pm
Has thanked: 0
Been thanked: 5 times

Re: Dreamcast Media Center

Post by PH3NOM »

Chilly Willy wrote:
Ayla wrote:Yes it does, but as far as I remember the ARM7DI does not have a 32*32=>64 mul opcode, so a MP3 player which would be possible on a 25MHz ARM7TDMI becomes impossible here.
Yeah, it's 32*32->32. That can be used to make a 64 bit multiply exactly like the 16*16->32 on the 68000, but it's still slower doing so. You'd have to find some way around that... new assembly code that perhaps loses accuracy in exchange for speed. Still, it looks like it's probably not possible. SPEEX might be given its lower computational requirements.
Yeah... thats what i believe stopped the helix mp3 decoder assembly code from compiling for the DC's ARM, and thats what stopped me from continuing with this idea.

It would be interesting to really know how many MIPS it can handle. 3MIPS seems quite low, but its probably right.
Ayla
DC Developer
DC Developer
Posts: 142
Joined: Thu Apr 03, 2008 7:01 am
Has thanked: 0
Been thanked: 4 times
Contact:

Re: Dreamcast Media Center

Post by Ayla »

Chilly Willy wrote:Hmm - how did you time it? It might be worth trying to do several million nops while timing it by hand to double check that it wasn't some timer issue.
Well I did it twice, at first by starting the process with a signal from the SH-4, and stopping it by raising an interrupt on the ARM7 from the SH-4. Then I tried with one of the AICA's timers and got the same result.
Chilly Willy wrote:One thing I noticed in that note is that the DSP uses a ring buffer for the DSP program. Given there's a pointer and size you set, that would be in ram. So perhaps it's the DSP slowing the bus access by the ARM. That would make more sense than blaming it on the AICA channel registers. Perhaps a different DSP program would help. Of course there's even less on the DSP than the rest.
Well I think that in that case I would get a "bus" FIQ which is AFAIK occuring when the DSP tries to read the shared memory.
However, that would be interesting to verify. I know it is possible to really disactivate some parts of the AICA like the hardware mixer or the DSP.
User avatar
Quzar
Dream Coder
Dream Coder
Posts: 7497
Joined: Wed Jul 31, 2002 12:14 am
Location: Miami, FL
Has thanked: 4 times
Been thanked: 9 times
Contact:

Re: Dreamcast Media Center

Post by Quzar »

Chilly Willy wrote:That was all conjecture. I rather doubt the AICA keeps the registers in ram - that's just plain silly and was only even suggested because it was the only way the person could think of using ram cycles to slow the ARM. It's more likely like Quzar mentioned - that speed control for the ARM... perhaps it's not the master clock but the bus clock for the ARM. It seems there needs to be some more testing done.
Only problem is that there is no evidence that the ARM actually does change clock speed. You'd think that tidbit would have been discovered by emulator authors no? My point was purely conjecture. I believe Ayla's testing, as I've followed what he's been doing. Though I still think it would be interesting to attempt a modification of the clock as mentioned in the docs and then run a benchmark. Not sure it's ever been done.
"When you post fewer lines of text than your signature, consider not posting at all." - A Wise Man
Chilly Willy
DC Developer
DC Developer
Posts: 414
Joined: Thu Aug 20, 2009 11:00 am
Has thanked: 0
Been thanked: 2 times

Re: Dreamcast Media Center

Post by Chilly Willy »

Hmm - we've pretty thoroughly hijacked this thread. Perhaps one of the mods could split this into its own thread?

It's just hard to believe that a 22.5 MHz ARM7DI would get less than 3 MIPS. Just look at the charts... even the early architectures got better MIPS at much lower clock rates.

http://en.wikipedia.org/wiki/List_of_AR ... ssor_cores

If an ARM2 with no cache can get 4 MIPS at 8 MHz, I find it very hard to believe a 22 MHz ARM7 gets 3 MIPS; it should be getting close to 10 MIPS.
User avatar
Quzar
Dream Coder
Dream Coder
Posts: 7497
Joined: Wed Jul 31, 2002 12:14 am
Location: Miami, FL
Has thanked: 4 times
Been thanked: 9 times
Contact:

Re: Dreamcast Media Center

Post by Quzar »

Chilly Willy wrote:Hmm - we've pretty thoroughly hijacked this thread. Perhaps one of the mods could split this into its own thread?

It's just hard to believe that a 22.5 MHz ARM7DI would get less than 3 MIPS. Just look at the charts... even the early architectures got better MIPS at much lower clock rates.

http://en.wikipedia.org/wiki/List_of_AR ... ssor_cores

If an ARM2 with no cache can get 4 MIPS at 8 MHz, I find it very hard to believe a 22 MHz ARM7 gets 3 MIPS; it should be getting close to 10 MIPS.
The following links are the basic resource for this. Rand Linden's various hints on the forum about the DC's ARM/AICA. We've basically held Rand's word on DC hardware and capabilities as gospel since he went over the entire system with a fine toothed comb.

viewtopic.php?f=29&t=64862 "There is NO cache for AICA."
viewtopic.php?f=29&t=27769 "Instructions must run from memory directly..." (which directly follows if it's true it has no cache.
viewtopic.php?p=545709#p545709 "Incomprehensibly slow"
"When you post fewer lines of text than your signature, consider not posting at all." - A Wise Man
User avatar
PH3NOM
DC Developer
DC Developer
Posts: 576
Joined: Fri Jun 18, 2010 9:29 pm
Has thanked: 0
Been thanked: 5 times

Re: Dreamcast Media Center

Post by PH3NOM »

Quzar wrote:
Chilly Willy wrote:Hmm - we've pretty thoroughly hijacked this thread. Perhaps one of the mods could split this into its own thread?

It's just hard to believe that a 22.5 MHz ARM7DI would get less than 3 MIPS. Just look at the charts... even the early architectures got better MIPS at much lower clock rates.

http://en.wikipedia.org/wiki/List_of_AR ... ssor_cores

If an ARM2 with no cache can get 4 MIPS at 8 MHz, I find it very hard to believe a 22 MHz ARM7 gets 3 MIPS; it should be getting close to 10 MIPS.
The following links are the basic resource for this. Rand Linden's various hints on the forum about the DC's ARM/AICA. We've basically held Rand's word on DC hardware and capabilities as gospel since he went over the entire system with a fine toothed comb.

viewtopic.php?f=29&t=64862 "There is NO cache for AICA."
viewtopic.php?f=29&t=27769 "Instructions must run from memory directly..." (which directly follows if it's true it has no cache.
viewtopic.php?p=545709#p545709 "Incomprehensibly slow"
@Chilly - No, I believe the topic of discussion fits this thread just fine. We'll let the moderators decide...

@Quazar - I had read one of those threads, and Rand's words were what stopped me from pursuing the idea further
Rand Linden wrote:...a sound system is definitely feasible -- it all depends on how much time you want to spend on it... If you're looking for a research project that'll suck huge amount of time and have little progress to show for it, this is the one.

Rand.
But, what did you end up deciding about sending multi-channel streams to the SPU?
Would it be possible to send 6-ch wave to the SPU, and let the hardware do the mixing?
Or is data transfer too slow to send 6-ch wave to the SPU in real-time?
User avatar
Quzar
Dream Coder
Dream Coder
Posts: 7497
Joined: Wed Jul 31, 2002 12:14 am
Location: Miami, FL
Has thanked: 4 times
Been thanked: 9 times
Contact:

Re: Dreamcast Media Center

Post by Quzar »

PH3NOM wrote:But, what did you end up deciding about sending multi-channel streams to the SPU?
Would it be possible to send 6-ch wave to the SPU, and let the hardware do the mixing?
Or is data transfer too slow to send 6-ch wave to the SPU in real-time?
Don't know. I have tested 44k/16bit stereo wav and it's faster to mix on the AICA. Never tried more channels. I believe that Scherzo had 5 channel audio in Nester DC and found it faster. It would likely be a worthwhile benchmark to test software vs hardware mixing across different numbers of channels and audio formats (bitrates, sampling rates, encodings).

I would expect that it would always be faster to mix to hardware until the point where you would simply be unable to transfer the audio fast enough to update (even with DMA there could be significant impacts against performance of main memory). It's possible though that something like mixing two channels down while transferring 4 others, then transferring the new mixed one might be faster than transferring 6. Really don't know.
"When you post fewer lines of text than your signature, consider not posting at all." - A Wise Man
User avatar
Maturion
Moderator
Moderator
Posts: 619
Joined: Fri Oct 12, 2007 1:52 pm
Location: Munich, Germany
Has thanked: 0
Been thanked: 0
Contact:

Re: Dreamcast Media Center

Post by Maturion »

I just noticed this topic. "JUST FUCKING AWESOME" is all I can say. If you need any more beta testers, count me in.
mouZ
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 16
Joined: Sun Apr 03, 2011 10:48 am
Has thanked: 0
Been thanked: 0

Re: Dreamcast Media Center

Post by mouZ »

No news ? Thanks.
Darksidehearts
DCEmu Newbie
DCEmu Newbie
Posts: 5
Joined: Mon Jul 25, 2011 9:03 pm
Has thanked: 0
Been thanked: 0

Re: Dreamcast Media Center

Post by Darksidehearts »

Give it some time mouZ, they'll have more updates when they can post them.
User avatar
PH3NOM
DC Developer
DC Developer
Posts: 576
Joined: Fri Jun 18, 2010 9:29 pm
Has thanked: 0
Been thanked: 5 times

Re: Dreamcast Media Center

Post by PH3NOM »

Thanks for the interest.

In the early stages, progress was very rapid on this project.
Reaching later stages, it seems more time is spent with less to show for it.

The photo, music, and application loaders are basically finished.
Funny, the thing I have been working on the longest, still proves to need the most work :evil:

Take a look at some of my other posts here recently to get an idea of what progress is being made on various aspects of this project.

Something I have not mentioned yet, I would like to add support for some emulators.
For example, SNES4ALL can be compiled to load a certain rom at load time.
So, I can implement rom browsing in DCMC, and when a rom is selected, load the emulator binary, referencing the selected rom.
I will also add a return function, so you can return back to DCMC when your done playing :lol:
User avatar
Neoblast
DC Developer
DC Developer
Posts: 314
Joined: Sat Dec 01, 2007 8:51 am
Has thanked: 3 times
Been thanked: 1 time

Re: Dreamcast Media Center

Post by Neoblast »

Great, but wouldn't it be better ( and obviously more diff and take more time ) to use the emulator core ( and not load the emu bin ) to load the rom directly from dcmc?

Two cons of this are the rom recognision, either using a different file extension for each rom type would work or maybe the header, but I get the feeling it would be a mess when loading bins.
User avatar
Quzar
Dream Coder
Dream Coder
Posts: 7497
Joined: Wed Jul 31, 2002 12:14 am
Location: Miami, FL
Has thanked: 4 times
Been thanked: 9 times
Contact:

Re: Dreamcast Media Center

Post by Quzar »

Neoblast wrote:Great, but wouldn't it be better ( and obviously more diff and take more time ) to use the emulator core ( and not load the emu bin ) to load the rom directly from dcmc?

Two cons of this are the rom recognision, either using a different file extension for each rom type would work or maybe the header, but I get the feeling it would be a mess when loading bins.
The problem with doing something like that is the memory overhead of having the rest of the system still working. Remember, at a minimum the binary must be loaded into memory and an extra few MB isn't nothing. This might be a workable solution for one or two emulators, but beyond that and you may find things breaking (also video playback will suffer).
"When you post fewer lines of text than your signature, consider not posting at all." - A Wise Man
User avatar
PH3NOM
DC Developer
DC Developer
Posts: 576
Joined: Fri Jun 18, 2010 9:29 pm
Has thanked: 0
Been thanked: 5 times

Re: Dreamcast Media Center

Post by PH3NOM »

Neoblast wrote:Great, but wouldn't it be better ( and obviously more diff and take more time ) to use the emulator core ( and not load the emu bin ) to load the rom directly from dcmc?

Two cons of this are the rom recognision, either using a different file extension for each rom type would work or maybe the header, but I get the feeling it would be a mess when loading bins.
As far as rom recognition, I don't see any problems.
True, the build of DCMC you tested determines how to process a file based on its extension.
It would be easy to change this to actually open the file first, read its header, then decide how to process it.
Simply, there has been no need to do so, until now...

Adding the EMU CORE into DCMC is a good idea.
But, as Quzar mentioned, this would inflate the binary size, that is something I dont want to do.
DCMC ( including romdisk ) is currently ~2.5Mb
If I had enough time, which I dont, I would implement a module system, similar to how Dreamshell functions.
Considering my time constraints, it is a realistic goal to simply go about this the way I originally mentioned.
Darksidehearts
DCEmu Newbie
DCEmu Newbie
Posts: 5
Joined: Mon Jul 25, 2011 9:03 pm
Has thanked: 0
Been thanked: 0

Re: Dreamcast Media Center

Post by Darksidehearts »

No rush here, real life takes precedence over development. It's just great to see people still willing to work on applications for the Dreamcast, I along with the community appreciate the efforts being made on this project.
Post Reply