AICA audio driver in the works

This forum is for the posting of new newsposts, and it stores the site's news and comments archives. Only newsposters have access to post new news in here; if you wish to submit news, please post it in the discussion section for your particular topic. We may choose to move it here as a newspost if we find that it's worthy for the front page.
Post Reply
User avatar
Juan
DCEmu Commie
DCEmu Commie
Posts: 3398
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Sun Jun 15, 2003 11:47 pm
Location: Montevideo
Has thanked: 39 times
Been thanked: 3 times

AICA audio driver in the works

Post by Juan »

Bouz announced that he's working on an AICA audio driver that will be able to process S3M stereo files directly through the sound chip. This should be an improvement to the way the KOS driver handles it, since it uses the main SH4 CPU to treat sound and the AICA co-processor for the balance.

Image

You can get a demo for the driver (ELF file for dc-tool) at DC-France

Source: Dreamcast.es
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5652
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: AICA audio driver in the works

Post by BlueCrab »

Not to put this down or anything, but there have been S3M players running on the ARM before. Granted, 2ndmix is the only thing that ever did such a thing to my knowledge (and sadly, the "source" to the S3M player in there is just a byte array of the ARM opcodes).

Still, its nice to see people trying out new ideas for how to do things on the Dreamcast. :) If only it were possible to do more interesting sound decoding on the ARM (like OGG). Sadly, I think that would be practically impossible (due to memory constraints (no room for the actual music after putting the decoder in the AICA's RAM), and the crappy bus that the ARM is on).
User avatar
Christuserloeser
Moderator
Moderator
Posts: 5948
Joined: Thu Aug 28, 2003 12:16 am
Location: DCEvolution.net
Has thanked: 10 times
Been thanked: 0
Contact:

Re: AICA audio driver in the works

Post by Christuserloeser »

While I agree with BlueCrab that OGG decompression would be fantastic to see at one point, I think that this is a freakin' sweet release, Bouz! :grin:


The only other homebrew that I know that use the AICA would be Neill Corlett's Beats of Rage port and thus OpenBoR:

https://openbor.svn.sourceforge.net/svn ... /dcsound.c
Insane homebrew collector.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5652
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: AICA audio driver in the works

Post by BlueCrab »

Christuserloeser wrote:The only other homebrew that I know that use the AICA would be Neill Corlett's Beats of Rage port and thus OpenBoR:

https://openbor.svn.sourceforge.net/svn ... /dcsound.c
That code runs on the SH4, not the ARM.
User avatar
Christuserloeser
Moderator
Moderator
Posts: 5948
Joined: Thu Aug 28, 2003 12:16 am
Location: DCEvolution.net
Has thanked: 10 times
Been thanked: 0
Contact:

Re: AICA audio driver in the works

Post by Christuserloeser »

Hm, okay. :oops: - Actually, Beats of Rage uses the AICA's ADPCM decoder I think, not the ARM:
https://openbor.svn.sourceforge.net/svn ... soundmix.c
Insane homebrew collector.
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: AICA audio driver in the works

Post by Quzar »

Everything that plays sound uses the aica... it's the only way to do it. The point is to run code other than what is in KOS to run on the arm.
"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: AICA audio driver in the works

Post by PH3NOM »

BlueCrab wrote:Not to put this down or anything, but there have been S3M players running on the ARM before. Granted, 2ndmix is the only thing that ever did such a thing to my knowledge (and sadly, the "source" to the S3M player in there is just a byte array of the ARM opcodes).
Good News!
The source code was not lost, entirely!

I have released the source for compiling the S3M player, on the arm processor.
http://www.megaupload.com/?d=0DCD27IG
This is the same example included in kos:
kos\examples\dreamcast\2ndmix

However, the source code for the ARM program was not included,
instead only the compiled header.

There exists a non-compiling LibS3M:
kos-ports\libs3m

I have made a new makefile for the ARM code from LibS3M.
2ndmix\s3mplay\Makefile

This will build the ARM program, stream.drv

Use the custom version of 'bin2c' I have included
2ndmix\s3mplay\bin2c

to convert the stream.drv into s3mplay.h with this command:
bin2c stream.drv s3mplay.h s3mplay

-PH3NOM 2011
User avatar
RyoDC
Mental DCEmu
Mental DCEmu
Posts: 366
Joined: Wed Mar 30, 2011 12:13 pm
Has thanked: 2 times
Been thanked: 0

Re: AICA audio driver in the works

Post by RyoDC »

Can someone please post code containing arm commands
How do I try to build a Dreamcast toolchain:
Image
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: AICA audio driver in the works

Post by PH3NOM »

RyoDC wrote:Can someone please post code containing arm commands
Research the web, there is a lot of information on ARM language.
I have been reviewing some information here:
http://simplemachines.it/doc/arm_inst.pdf

Somebody please correct me, this is based off of what I have learned from that document:
This code in c:

Code: Select all

    int i=0;
    for ( i=0; i<1000; i++ )
          ;
Can be written in ARM inline-assembly as:

Code: Select all

    __asm__ volatile (
    	"mov r0, #0;"
    	"mov r1, #1000;"
        "loop:"
          "add	 r0,r0,#1;"
          "cmp   r0,r1;"
          "BLT loop;"
   	);
User avatar
RyoDC
Mental DCEmu
Mental DCEmu
Posts: 366
Joined: Wed Mar 30, 2011 12:13 pm
Has thanked: 2 times
Been thanked: 0

Re: AICA audio driver in the works

Post by RyoDC »

Pretty typical architecture, in some ways reminds me sh-4.
About an asm code, I'm surprised, I always thought that key 'volatile' can be assigned only to variables, that don't need to be controlled by the program (can't be optimized as well).

And yeah, that symbol of quotes, that we must put before and after each command, it's so inconvenient.
How do I try to build a Dreamcast toolchain:
Image
Ayla
DC Developer
DC Developer
Posts: 142
Joined: Thu Apr 03, 2008 7:01 am
Has thanked: 0
Been thanked: 4 times
Contact:

Re: AICA audio driver in the works

Post by Ayla »

The "volatile" flag is there to prevent the compiler from modifying the ASM (for optimization purposes).
User avatar
RyoDC
Mental DCEmu
Mental DCEmu
Posts: 366
Joined: Wed Mar 30, 2011 12:13 pm
Has thanked: 2 times
Been thanked: 0

Re: AICA audio driver in the works

Post by RyoDC »

Omg is that now even possible :o
Well I know compilers optimizing lot of things now, even throwing away things that must not be thrown in any way, but even assembly...

P.S. Ayla, did you take my apologizes?
How do I try to build a Dreamcast toolchain:
Image
Chilly Willy
DC Developer
DC Developer
Posts: 414
Joined: Thu Aug 20, 2009 11:00 am
Has thanked: 0
Been thanked: 2 times

Re: AICA audio driver in the works

Post by Chilly Willy »

Inline assembly is a big pain; I've never cared for how it's handled. It's much better to put all your assembly into a separate .s/.S file - unless you NEED it to be inline, then you're stuck with sucky inline syntax. One of the biggest problems is that ALL inline assembly guides are ONLY x86. Just try to find a guide to inline assembly for SH, for example. You wind up digging through existing source to find examples which never are exactly what you need. :evil:
User avatar
RyoDC
Mental DCEmu
Mental DCEmu
Posts: 366
Joined: Wed Mar 30, 2011 12:13 pm
Has thanked: 2 times
Been thanked: 0

Re: AICA audio driver in the works

Post by RyoDC »

Hmm, I can recommend you to look through the WinCE docs, I've seen some help files containing sh4 inline assembly in there.

P.S. Another good tutorial http://www.scss.tcd.ie/~waldroj/3d1/arm_arm.pdf
How do I try to build a Dreamcast toolchain:
Image
Chilly Willy
DC Developer
DC Developer
Posts: 414
Joined: Thu Aug 20, 2009 11:00 am
Has thanked: 0
Been thanked: 2 times

Re: AICA audio driver in the works

Post by Chilly Willy »

RyoDC wrote:Hmm, I can recommend you to look through the WinCE docs, I've seen some help files containing sh4 inline assembly in there.
Thanks for the tip. I'll have to check it out.
Post Reply