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

Xbox ADPCM decoder is limited to 64 samples instead of IMA's 65 samples #76

Open
BinToss opened this issue Apr 14, 2020 · 3 comments
Open

Comments

@BinToss
Copy link

BinToss commented Apr 14, 2020

Source: a trustworthy Halo CE community member
Source: a trusted Halo CE community member

@JayFoxRox
Copy link
Owner

Is that comment about my decoder in particular? I wrote it specifically for Xbox emulation (but it was never fully integrated).

The ultimate decision as to how it should be implemented (64 vs. 65 output samples) can only be made by looking at the APU (https://xboxdevwiki.net/APU).

I will eventually run unit-tests by decoding ADPCM with a real APU. But so far, I have not written a driver for the APU, so it would be tedious to do. 64 output samples does indeed sound more likely to me, too (it's what the WAV header claims as block size). But most of what I've looked at suggested 65 samples of decoder output (I believe this even included playback duration on a real APU; but I might be wrong).

If Mosesofegypt has more information as to why they think it's 64 samples of output, that would be nice to have. I have some contact options. Also I'd like to know if they have a good test to confirm which nibble is being ignored on hardware (they claim the last one; I doubt that - I'd rather ditch the predictor like most software decoders do). Note that doing a hardware test requires a clean environment without pitch modifications. Ideally they'd check with 24-bit PCM 48kHz first (the actual format the APU uses internally I believe).

If it's not 65 output samples then we'd have to fix it here, too: https://xboxdevwiki.net/Xbox_ADPCM

@BinToss
Copy link
Author

BinToss commented Apr 24, 2020

I forwarded this to Moses last week. I'm not sure if he got in contact with you yet.

@JayFoxRox
Copy link
Owner

We did talk about this on Discord DMs.

Their point of view is from the software side and about Halo. I think that's not a good approach for what I need / want (the definite answer). So I'll keep this issue opened until we had hardware tests at 48kHz (native APU frequency), decoded to RAM.

I'll add a comment and link to test results once I (or someone else) have done that. This is not a priority for me, so this might take a couple of months.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants