Audio Streaming Plan

Discuss one of the most feature filled GameCube applications here :)
Locked
User avatar
emu_kidid
Site Admin
Posts: 4628
Joined: Mon Mar 29, 2010 10:06 am
Location: Australia
Contact:

Audio Streaming Plan

Post by emu_kidid » Mon Oct 17, 2011 2:19 am

Just gathering some notes together on a way to get Audio Streaming working from SD Gecko.

If anyone has something genuine to add, please let me know.

So, the way things happen from DVD Audio Streaming as I understand it are:
1. When initializing the drive, send 0xE4010000 to enable Audio Streaming.
2. Game is booted up/etc, reads occur, at some point the game sends 0xE1000000,StreamPos,Length
3. DVD Drive sends ADPCM to the DSP which up/down samples it to 32/48KHz depending on what the game is using
4. Game will check the status of the stream which is playing occasionally using 0xE2000000 (1 = playing, 0 = done)

To implement this in Swiss to work from SD Gecko I suggest the following:
1. Hook VSync/some other common function with a call to a small state machine which will sit in memory
2. Catch all 0xE1/0xE2 commands and set/get parameters which our state machine will adjust every time it's called
3. The state machine will work by sending cached (1 second worth?) of PCM data to the Audio Interface

Issues with the above:
1. To not bog down the CPU, the PCM data would need to be pre-converted and somehow attached onto the ISO
2. If ADPCM data can be sent straight to the DSP, great, then we can cache even more data to avoid jitter
3. It WILL be slow since the SD Gecko doesn't have DMA and will block to fill the cache - but maybe some people prefer it over nothing
4. Caching might not be an option on games that don't like the ArenaHi pushed down (given less memory)
Image
disaster3ad
Posts: 8
Joined: Tue Sep 21, 2010 6:21 am
Location: RUS

Re: Audio Streaming Plan

Post by disaster3ad » Mon Oct 17, 2011 2:39 am

Hi, emu_kidid. I would like to clarify the principle of audio streaming process.

Maybe I'm wrong, but the drive sends the sound passing DSP? Whether there is documentation on this topic?
User avatar
emu_kidid
Site Admin
Posts: 4628
Joined: Mon Mar 29, 2010 10:06 am
Location: Australia
Contact:

Re: Audio Streaming Plan

Post by emu_kidid » Mon Oct 17, 2011 2:51 am

I believe there are 3 hardware lines mapped directly to DSP registers from DVD->DSP and that is how this gets done. I don't think I can upload directly to the DSP from the PPC side and have it do what I want (ADPCM->PCM->Play).
Image
disaster3ad
Posts: 8
Joined: Tue Sep 21, 2010 6:21 am
Location: RUS

Re: Audio Streaming Plan

Post by disaster3ad » Tue Oct 18, 2011 7:21 pm

Is the process stream output drive does not send data directly, bypassing the sound chip. Immediately to the mixer and then to the amplifier. So, the PPC processor and the RAM is not involved..

Hmm May be I am totally wrong?
User avatar
emu_kidid
Site Admin
Posts: 4628
Joined: Mon Mar 29, 2010 10:06 am
Location: Australia
Contact:

Re: Audio Streaming Plan

Post by emu_kidid » Tue Oct 18, 2011 10:03 pm

drive sends ADPCM to somewhere and then the DSP makes it into PCM and pumps it out of the audio system.
Image
TheManuel
Posts: 17
Joined: Fri Nov 05, 2010 7:52 pm

Re: Audio Streaming Plan

Post by TheManuel » Thu Mar 01, 2012 6:14 pm

I find it very exciting that you are looking at this, even if at an exploratory stage.
I don't really know anything about this, as will be obvious from the comments that follow, but isn't there an audio format that could achieve full playback speed at the expense of storage space?
Video streams from GCN games on SD card play back at full frame-rate using using DML, even the top quality ones, like the Soul Calibur II intro screen, so the SD card does not seem like a limitation in that particular case.
User avatar
emu_kidid
Site Admin
Posts: 4628
Joined: Mon Mar 29, 2010 10:06 am
Location: Australia
Contact:

Re: Audio Streaming Plan

Post by emu_kidid » Thu Mar 01, 2012 9:51 pm

DML is full frame-rate, however the SD card reads there are slower. It's all because DML has DMA access to the front-sd card, which can allow it to simulate the DVD Reads properly and not "block" code
Image
TheManuel
Posts: 17
Joined: Fri Nov 05, 2010 7:52 pm

Re: Audio Streaming Plan

Post by TheManuel » Thu Mar 01, 2012 10:11 pm

I see. So it sounds like if this ever was made to work, it could do so at full speed from front SD but not from SD Gecko.

Thanks for your answer.
User avatar
infact
Posts: 347
Joined: Tue Mar 29, 2011 4:35 am
Location: Germany

Re: Audio Streaming Plan

Post by infact » Fri Mar 02, 2012 12:12 am

Yep, unless we have a sdgecko with dma support.
infact
Image Image
User avatar
Diego borella
Posts: 65
Joined: Sat Jan 11, 2020 8:37 pm
Location: Brazil

Re: Audio Streaming Plan

Post by Diego borella » Sat Feb 08, 2020 8:48 pm

emu_kidid wrote:
Mon Oct 17, 2011 2:19 am
Just gathering some notes together on a way to get Audio Streaming working from SD Gecko.

If anyone has something genuine to add, please let me know.

So, the way things happen from DVD Audio Streaming as I understand it are:
1. When initializing the drive, send 0xE4010000 to enable Audio Streaming.
2. Game is booted up/etc, reads occur, at some point the game sends 0xE1000000,StreamPos,Length
3. DVD Drive sends ADPCM to the DSP which up/down samples it to 32/48KHz depending on what the game is using
4. Game will check the status of the stream which is playing occasionally using 0xE2000000 (1 = playing, 0 = done)

To implement this in Swiss to work from SD Gecko I suggest the following:
1. Hook VSync/some other common function with a call to a small state machine which will sit in memory
2. Catch all 0xE1/0xE2 commands and set/get parameters which our state machine will adjust every time it's called
3. The state machine will work by sending cached (1 second worth?) of PCM data to the Audio Interface

Issues with the above:
1. To not bog down the CPU, the PCM data would need to be pre-converted and somehow attached onto the ISO
2. If ADPCM data can be sent straight to the DSP, great, then we can cache even more data to avoid jitter
3. It WILL be slow since the SD Gecko doesn't have DMA and will block to fill the cache - but maybe some people prefer it over nothing
4. Caching might not be an option on games that don't like the ArenaHi pushed down (given less memory)
the carousel mode of the new Swiss 775
made an absurd difference in the audio of Metroid Prime.
the sound is searched and played practically all the time!
sd2sp2 used.
tests in previous Swiss have not given the same result.
when the sound fails, going to and returning to that area will remedy the problem by saving the game.
User avatar
Extrems
Posts: 892
Joined: Tue Aug 17, 2010 10:40 pm
Location: Québec, Canada
Contact:

Re: Audio Streaming Plan

Post by Extrems » Sat Feb 08, 2020 9:13 pm

Uh, that has nothing to do with the carousel mode or streaming audio.
User avatar
Diego borella
Posts: 65
Joined: Sat Jan 11, 2020 8:37 pm
Location: Brazil

Re: Audio Streaming Plan

Post by Diego borella » Sat Feb 08, 2020 10:31 pm

Extrems wrote:
Sat Feb 08, 2020 9:13 pm
Uh, that has nothing to do with the carousel mode or streaming audio.
but when you disable the carousel, the audio does not work properly! :roll:
User avatar
Extrems
Posts: 892
Joined: Tue Aug 17, 2010 10:40 pm
Location: Québec, Canada
Contact:

Re: Audio Streaming Plan

Post by Extrems » Sat Feb 08, 2020 11:44 pm

I'm telling you it has nothing to do with it.
User avatar
Diego borella
Posts: 65
Joined: Sat Jan 11, 2020 8:37 pm
Location: Brazil

Re: Audio Streaming Plan

Post by Diego borella » Sun Feb 09, 2020 6:13 pm

Extrems wrote:
Sat Feb 08, 2020 11:44 pm
I'm telling you it has nothing to do with it.
I'm not at odds with you, I just report my Swiss experience and behavior to me with serial port 2 ...
I can't tell you the relationship between things. and activating the carousel seemed to have something to do with it, but I can't say how or if it is.
You say and have the authority to say yes or no.
I just know that the audio has improved a lot compared to previous revisions.
Brazil is a Portuguese colony, English is not familiar to me. maybe I have expressed myself badly.
I saw that you are a co-author and contributor to Emu_kidid in Switzerland.
thank you for working with Switzerland, friend Extrems. !!!
Towards 0.5!
User avatar
emu_kidid
Site Admin
Posts: 4628
Joined: Mon Mar 29, 2010 10:06 am
Location: Australia
Contact:

Re: Audio Streaming Plan

Post by emu_kidid » Wed Feb 12, 2020 10:06 pm

Topic locked, recent comments have been completely irrelevant and off topic.
Image
Locked