yoyofr / modizer

iOS chiptune/module player
http://yoyofr.blogspot.com/p/modizer.html
138 stars 45 forks source link

DSF plays back at the wrong speed when 22kHz is selected at the menu #12

Closed mistydemeo closed 12 years ago

mistydemeo commented 12 years ago

I think this was introduced by pull request #3. The DSF playback ratio is now hardcoded to 22kHz, but the player will still try to adjust the playback speed depending on what's chosen in the options menu even though the options do nothing. As a result the audio plays back at half speed if 22kHz is selected in the AOSDK options.

yoyofr commented 12 years ago

I'll have a look it should not be too hard to fix.

yoyofr commented 12 years ago

I've had a quick look at the code, are you sure there is an issue ? in modizmusicplayer, there is only a switch to change the aosdk_dsf_22khz flag. This flag is used to switch the dsf audio buffer generation between 2 code paths. No other options are changed, so it should work... Maybe there is an issue with the 22Khz version of dsf audio buffer generation. With which files did you test ?

mistydemeo commented 12 years ago

I'm 100% sure there's an issue - it's happened with every song I played. I tried with songs from the Skies of Arcadia and Guilty Gear X soundtracks. All of them play at half speed when the menu option is set to 22kHz, and full speed when the menu option is set to 44kHz.

yoyofr commented 12 years ago

ok, I think I found an issue with Sappharad 22khz path: the arm emu was executing only half of the cycles. I just checked-in a patch. Can you try and confirm it is ok ?

mistydemeo commented 12 years ago

I can confirm that the speed issue is fixed if the DSF emu ratio is 1 or 5; it will still play at half speed at emu ratio is 15 or 30.

yoyofr commented 12 years ago

but in this case is it not the same issue between 44 & 22Khz ? emu ratio is a hack and basically it is "normal" it doesn't work that good with high values

mistydemeo commented 12 years ago

OK, makes sense. Behaviour isn't 100% identical between 44 and 22kHz, but since it's a hack that's not really a big deal. Closing the issue now then! Thanks for fixing the bug.

Sappharad commented 12 years ago

Sorry I didn't notice this. I was testing with Shenmue 1 & 2, which both have a massive number of songs (600+ between them). The problem didn't occur there, nor did it occur with the old soatest.dsf that Neil ripped to test the first in_dsf player.