-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add QEMU audio output to APU #25
base: master
Are you sure you want to change the base?
Conversation
for(unsigned int frame = 0; frame < frames; frame++) { | ||
se_frame(opaque); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a hack... I'm not sure how it ended up in this branch? This was part of the DSP testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved into separate commit already.
@@ -0,0 +1,35 @@ | |||
#!/usr/bin/python3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
License?
@@ -0,0 +1,35 @@ | |||
#!/usr/bin/python3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other repository or something? I asked on XQEMU IRC a couple of minutes ago
157c128
to
01bd642
Compare
Removing comment:
|
d->gp.dsp = dsp_init(d, gp_scratch_rw, gp_fifo_rw); | ||
d->ep.dsp = dsp_init(d, ep_scratch_rw, ep_fifo_rw); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comment that only debug functionality is found beyond this point, or something?
dae54dc
to
93ba86e
Compare
/* TODO: this should be on a thread so it waits on the voice lock */ | ||
static void se_frame(void *opaque) | ||
#if (PLAYBACK_VP_BINS_MASK > 0) || (DUMP_VP_BINS_MASK > 0) | ||
static void route_vs_bins(MCPXAPUState *d, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*vp
d->gp.dsp = dsp_init(d, gp_scratch_rw, gp_fifo_rw); | ||
d->ep.dsp = dsp_init(d, ep_scratch_rw, ep_fifo_rw); | ||
|
||
|
||
#if PLAYBACK_VP_BINS_MASK || PLAYBACK_XBOX_DS_GP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> 0
This PR adds routing options for the GP audio output.
In Xbox, audio flows from VP (playback) → GP (effects) → EP (encoding) → ACI (actual output).
However, only the VP → GP transfer is hardwired. The other transfers are performed manually though programmable code. Hence, we can't easily sniff the audio data.
But: We can still make assumptions what Xbox DirectSound will do (HLE style). While the GP code is game specific, it always has a similar structure and it always seems to use the same memory layout.
The GP will DMA to scratch memory that is shared with the EP. So once the GP has ran, we just read the memory where we believe the GP must have written it.
This code will read this memory back and decode the samples.
We also make assumptions about the format: 5.1, 24 bit.
This assumption should hold true for all Xbox DirectSound versions.
- However, it doesn't hold true for the DirectSound variant used during the boot animation, because it runs a different GP-mainloop (as EP is disabled, GP must output to ACI directly; so this HLE hack doesn't see audio between GP / EP where expected).
The basic flow of the audio is (bold list items implemented in this PR), ordered chronologically:
Hardwired processing of VP
process_voice
framework implemented here, which provides the MIXBINs, but nothing else]Programmable processing of audio by GP (Game specific DSP Code for Xbox)
Programmable processing of audio by EP (Common DSP Code for Xbox)
(As the EP code is crashing in XQEMU, it's disabled; however, because the task common to all games, we can temporarily HLE it by doing its job on our own)
ACI / AC97
(As the EP is broken / disabled, no audio ever reaches this component. It doesn't matter because we have our temporary HLE output from GP)
TODO:
Split GP debug via HLE into separate PRIt's a commit already