Skip to content
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

apu: Add VP debug output #28

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

apu: Add VP debug output #28

wants to merge 4 commits into from

Conversation

JayFoxRox
Copy link
Owner

@JayFoxRox JayFoxRox commented Feb 1, 2019

This PR adds debug routing options for the VP audio output.

On hardware, the VP is hardwired to output to the GP in a fixed and known format. We already have a framework for calculating VP audio, we can just take this 32 channel audio and re-route it. Options are:

QEMU audio card (1x mono audio output)

This adds a QEMU Audio card for the MCPX APU, with an output for the VP.
In reality APU shouldn't be an audio-card as it has no physical audio outputs (it just does audio processing; output is done by ACI) - so this is only a debug interface.

As QEMU audio is fed to speakers in realtime, any gaps in the playback will cause audible gaps in the audio. Any buffer overrun will drop packets or add audio latency.

File-output (32x mono audio output)

This custom debug function exists, because the wavcapture QMP command only supports resampled mono or stereo output.
However, for debugging we want to preserve the original data of all 32 channels, without audio gaps or resampling.

The file output provides this continuous raw audio data without gaps.

There's a script to convert the binary APU audio dumps to audible wav files.

TODO:

  • The script thats mentioned in PR desc, is not present in repo
  • Fix directory structure
  • Re-integrate code
  • Consider mono wave output
  • PR desc

#endif

#if (PLAYBACK_VP_BINS_MASK > 0) || (DUMP_VP_BINS_MASK > 0)
void initialize_audio_debugger(MCPXAPUState *d)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style is <object>_<verb>; also init?


#if DUMP_VP_BINS_MASK > 0
MCPX_APU_DPRINTF("mcpx frame ping\n");
for (int i = 0; i < NUM_MIXBINS; i++) {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C99 not allowed

#if PLAYBACK_VP_BINS_MASK > 0
/* Output will be S32 mono; mix this now */
int32_t mixed[NUM_SAMPLES_PER_FRAME] = { 0 };
for (int i = 0; i < NUM_MIXBINS; i++) {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C99 not allowed

// AUD_set_active_out(d->vp_bins_out, 1); //FIXME: Why does this hang GTK UI?
#endif
#if DUMP_VP_BINS_MASK > 0
for (unsigned int i = 0; i < NUM_MIXBINS; i++) {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C99 not allowed

@JayFoxRox JayFoxRox force-pushed the vp-debug branch 2 times, most recently from 535bc5c to 4384bef Compare February 20, 2019 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant