diff --git a/audio/drivers/wiiu_audio.c b/audio/drivers/wiiu_audio.c index 44b9324faa..ed912eabc6 100644 --- a/audio/drivers/wiiu_audio.c +++ b/audio/drivers/wiiu_audio.c @@ -79,9 +79,7 @@ void wiiu_ax_callback(void) //buffer underrun, stop playback to let it fill up if(ax->written < AX_AUDIO_SAMPLE_MIN) AXSetMultiVoiceState(ax->mvoice, AX_VOICE_STATE_STOPPED); - //make sure to update written value if voice is running - if(AXIsMultiVoiceRunning(ax->mvoice)) - ax->written -= AX_AUDIO_SAMPLE_COUNT; + ax->written -= AX_AUDIO_SAMPLE_COUNT; OSUninterruptibleSpinLock_Release(&ax->spinlock); } } @@ -188,8 +186,10 @@ static bool ax_audio_start(void* data) //set back to playing on enough buffered data if(ax->written > AX_AUDIO_SAMPLE_LOAD) + { + AXSetMultiVoiceCurrentOffset(ax->mvoice, (ax->pos - ax->written) & AX_AUDIO_COUNT_MASK); AXSetMultiVoiceState(ax->mvoice, AX_VOICE_STATE_PLAYING); - + } return true; } diff --git a/wiiu/multivoice.h b/wiiu/multivoice.h index 5f197d7216..b8ab2284e5 100644 --- a/wiiu/multivoice.h +++ b/wiiu/multivoice.h @@ -12,6 +12,7 @@ typedef struct void AXAcquireMultiVoice(uint32_t prio, void *cb, uint32_t cbarg, void *setup, AXMVoice **mvoice); void AXSetMultiVoiceDeviceMix(AXMVoice *mvoice, AXDeviceType type, uint32_t id, uint32_t bus, uint16_t vol, int16_t delta); void AXSetMultiVoiceOffsets(AXMVoice *mvoice, AXVoiceOffsets *offsets); +void AXSetMultiVoiceCurrentOffset(AXMVoice *mvoice, uint32_t offset); void AXSetMultiVoiceState(AXMVoice *mvoice, AXVoiceState state); void AXSetMultiVoiceVe(AXMVoice *mvoice, AXVoiceVeData *veData); void AXSetMultiVoiceSrcType(AXMVoice *mvoice, AXVoiceSrcType type); diff --git a/wiiu/system/imports.h b/wiiu/system/imports.h index 26cc467b6d..5dd058c516 100644 --- a/wiiu/system/imports.h +++ b/wiiu/system/imports.h @@ -149,6 +149,7 @@ IMPORT(AXRegisterFrameCallback); IMPORT(AXAcquireMultiVoice); IMPORT(AXSetMultiVoiceDeviceMix); IMPORT(AXSetMultiVoiceOffsets); +IMPORT(AXSetMultiVoiceCurrentOffset); IMPORT(AXSetMultiVoiceState); IMPORT(AXSetMultiVoiceVe); IMPORT(AXSetMultiVoiceSrcType);