View Single Post
Old 30 October 2016, 18:20   #44
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,942
I tested WinUAE 3.4.0b14. Some notes (see extracts from log output below)...

WASAPI EX: At high sample rates (88.2kHz+) setting sound buffer size to 1 or 2 results in no sound playing. I assume that's because the buffer that WinUAE requests is smaller than the hardware/driver minimum. Setting buffer size to Min does work. For high sample rates, perhaps you could scale all buffer size settings >= 1 so they are larger than the driver minimum?

WASAPI EX and shared: While WinUAE is playing sound, opening Sound control panel and changing the sound format (e.g. from 48kHz to 88.2kHz) causes WinUAE to stop playing sound. That's not really a problem, but if you press F12, change sound emulation back to Enabled and click OK, sound plays again even though no other audio settings were changed. Perhaps WinUAE could restart sound playing automatically then?

Repeat the above, but press F12 to open settings window (which pauses emulation) before changing default format in Sound control panel. When you click OK to continue emulation WinUAE hangs (stops responding).


At 176.4kHz, Min buffer sound works:
WASAPI: AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED: 0 -> 480
WASAPI: '{0.0.0.00000000}.{b32283a3-ec24-40ed-a52a-7128ab296ef6}'
WASAPI: Exclusive Pull CH=2 FREQ=176400 BUF=480 (480)


On changing buffer setting to 1 or 2 there is no sound and this output:
WASAPI: Initialize() 88890020
Sorry, can't initialize sound.


Sound works with buffer 3 (and higher). The same applies for 192kHz.

At 88.2kHz, Min buffer works:
WASAPI: AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED: 0 -> 256
WASAPI: '{0.0.0.00000000}.{b32283a3-ec24-40ed-a52a-7128ab296ef6}'
WASAPI: Exclusive Pull CH=2 FREQ=88200 BUF=256 (256)


No sound with Buffer = 1. Buffer = 2 and higher work.


Shared WASAPI. Sound control panel format set to 48kHz 16-bit. WinUAE set to 88.2kHz, buffer Min:
WASAPI: IsFormatSupported(2,00000003,88200) (2,48000) 00000001
WASAPI: GetCurrentSharedModeEnginePeriod() CH=2 FREQ=48000 BITS=32 CurrentPeriodInFrames=480
WASAPI: GetSharedModeEnginePeriod() DPIF=480 FPIF=32 MinPIF=128 MaxPIF=480
WASAPI: IsOffloadCapable() returned 0 00000000
WASAPI: InitializeSharedAudioStream() Period=128. HRESULT=00000000
WASAPI: GetCurrentSharedModeEnginePeriod() CH=2 FREQ=48000 BITS=32 CurrentPeriodInFrames=128
WASAPI: '{0.0.0.00000000}.{b32283a3-ec24-40ed-a52a-7128ab296ef6}'
WASAPI: Shared Pull CH=2 FREQ=48000 BUF=140 (280)


Sound plays, but at the shared rate of 48kHz (which is correct). With sound playing, I opened Sound control panel and changed the default format to 88.2kHz. Control panel showed a dialog box saying:
"The device is being used by another application. If you continue, that
application may stop working.
Do you want to continue?"

Clicking Yes resulted in this log output:
WASAPI: GetCurrentPadding() 88890004
WASAPI: IsFormatSupported(2,00000003,48000) (2,88200) 00000001
WASAPI: GetCurrentSharedModeEnginePeriod() CH=2 FREQ=88200 BITS=32 CurrentPeriodInFrames=896
WASAPI: GetSharedModeEnginePeriod() DPIF=896 FPIF=32 MinPIF=224 MaxPIF=896
WASAPI: IsOffloadCapable() returned 0 00000000
WASAPI: InitializeSharedAudioStream() Period=224. HRESULT=00000000
WASAPI: GetCurrentSharedModeEnginePeriod() CH=2 FREQ=88200 BITS=32 CurrentPeriodInFrames=224
WASAPI: '{0.0.0.00000000}.{b32283a3-ec24-40ed-a52a-7128ab296ef6}'
WASAPI: Shared Pull CH=2 FREQ=88200 BUF=246 (492)


And sound stopped playing. (On pressing F12, sound is set to disabled but emulated). Enable it and sound plays again:
WASAPI: GetCurrentSharedModeEnginePeriod() CH=2 FREQ=88200 BITS=32 CurrentPeriodInFrames=896
WASAPI: GetSharedModeEnginePeriod() DPIF=896 FPIF=32 MinPIF=224 MaxPIF=896
WASAPI: IsOffloadCapable() returned 0 00000000
WASAPI: InitializeSharedAudioStream() Period=224. HRESULT=00000000
WASAPI: GetCurrentSharedModeEnginePeriod() CH=2 FREQ=88200 BITS=32 CurrentPeriodInFrames=224
WASAPI: '{0.0.0.00000000}.{b32283a3-ec24-40ed-a52a-7128ab296ef6}'
WASAPI: Shared Pull CH=2 FREQ=88200 BUF=246 (492)


While sound playing, change format in Sound control panel back to 48kHz. WinUAE sound stops with this log output:
WASAPI: GetCurrentPadding() 88890004
WASAPI: IsFormatSupported(2,00000003,88200) (2,48000) 00000001
WASAPI: GetCurrentSharedModeEnginePeriod() CH=2 FREQ=48000 BITS=32 CurrentPeriodInFrames=480
WASAPI: GetSharedModeEnginePeriod() DPIF=480 FPIF=32 MinPIF=128 MaxPIF=480
WASAPI: IsOffloadCapable() returned 0 00000000
WASAPI: InitializeSharedAudioStream() Period=128. HRESULT=00000000
WASAPI: GetCurrentSharedModeEnginePeriod() CH=2 FREQ=48000 BITS=32 CurrentPeriodInFrames=128
WASAPI: '{0.0.0.00000000}.{b32283a3-ec24-40ed-a52a-7128ab296ef6}'
WASAPI: Shared Pull CH=2 FREQ=48000 BUF=140 (280)



Now try something different... Sound cpl 48kHz, run WinUAE, start emulation with WASAPI shared sound, it plays at 48kHz as above. Press F12 to open settings window. Using Sound cpl change default format (e.g. to 88.2kHz). Continue emulation. WinUAE hangs (stops responding) with this log output:
WASAPI: Resume GetBuffer() 88890004
mark_k is online now  
 
Page generated in 0.03998 seconds with 10 queries