Merge pull request #4040 from FIX94/master

(WiiU) more audio driver cleanup
This commit is contained in:
aliaspider 2016-11-22 00:38:53 +01:00 committed by GitHub
commit 797ef01b85
3 changed files with 17 additions and 20 deletions

View File

@ -106,18 +106,18 @@ static void* ax_audio_init(const char* device, unsigned rate, unsigned latency)
DCFlushRange(ax->buffer_r,AX_AUDIO_SIZE);
//shared by both voices
AXVoiceOffsets offsets;
offsets.currentOffset = 0;
offsets.loopOffset = 0;
offsets.endOffset = AX_AUDIO_COUNT - 1;
offsets.loopingEnabled = AX_VOICE_LOOP_ENABLED;
offsets.dataType = AX_VOICE_FORMAT_LPCM16;
AXVoiceOffsets offsets[2];
offsets[0].currentOffset = 0;
offsets[0].loopOffset = 0;
offsets[0].endOffset = AX_AUDIO_COUNT - 1;
offsets[0].loopingEnabled = AX_VOICE_LOOP_ENABLED;
offsets[0].dataType = AX_VOICE_FORMAT_LPCM16;
memcpy(&offsets[1], &offsets[0], sizeof(AXVoiceOffsets));
offsets.data = ax->buffer_l;
AXSetVoiceOffsets(ax->mvoice->v[0], &offsets);
offsets.data = ax->buffer_r;
AXSetVoiceOffsets(ax->mvoice->v[1], &offsets);
//different buffers per voice
offsets[0].data = ax->buffer_l;
offsets[1].data = ax->buffer_r;
AXSetMultiVoiceOffsets(ax->mvoice, offsets);
AXSetMultiVoiceSrcType(ax->mvoice, AX_VOICE_SRC_TYPE_NONE);
AXSetMultiVoiceSrcRatio(ax->mvoice, 1.0f);
@ -125,15 +125,8 @@ static void* ax_audio_init(const char* device, unsigned rate, unsigned latency)
AXVoiceVeData ve = {0xF000, 0};
AXSetMultiVoiceVe(ax->mvoice, &ve);
u32 mix[24] = {0};
mix[0] = 0x80000000;
AXSetVoiceDeviceMix(ax->mvoice->v[0], AX_DEVICE_TYPE_DRC, 0, (AXVoiceDeviceMixData*)mix);
AXSetVoiceDeviceMix(ax->mvoice->v[0], AX_DEVICE_TYPE_TV, 0, (AXVoiceDeviceMixData*)mix);
mix[0] = 0;
mix[4] = 0x80000000;
AXSetVoiceDeviceMix(ax->mvoice->v[1], AX_DEVICE_TYPE_DRC, 0, (AXVoiceDeviceMixData*)mix);
AXSetVoiceDeviceMix(ax->mvoice->v[1], AX_DEVICE_TYPE_TV, 0, (AXVoiceDeviceMixData*)mix);
AXSetMultiVoiceDeviceMix(ax->mvoice, AX_DEVICE_TYPE_DRC, 0, 0, 0x8000, 0);
AXSetMultiVoiceDeviceMix(ax->mvoice, AX_DEVICE_TYPE_TV, 0, 0, 0x8000, 0);
AXSetMultiVoiceState(ax->mvoice, AX_VOICE_STATE_STOPPED);

View File

@ -10,6 +10,8 @@ typedef struct
} AXMVoice;
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 AXSetMultiVoiceState(AXMVoice *mvoice, AXVoiceState state);
void AXSetMultiVoiceVe(AXMVoice *mvoice, AXVoiceVeData *veData);
void AXSetMultiVoiceSrcType(AXMVoice *mvoice, AXVoiceSrcType type);

View File

@ -3,6 +3,8 @@ EXPORT_BEGIN(sndcore2.rpl);
#include "../rpl/libsndcore2/exports.h"
EXPORT(AXAcquireMultiVoice);
EXPORT(AXSetMultiVoiceDeviceMix);
EXPORT(AXSetMultiVoiceOffsets);
EXPORT(AXSetMultiVoiceState);
EXPORT(AXSetMultiVoiceVe);
EXPORT(AXSetMultiVoiceSrcType);