[Portaudio] 'Unanticipated host error' with default output device

Rich Eakin rtepub at gmail.com
Fri Nov 2 03:21:24 EDT 2018


>
>
> On 31/10/2018 10:22, Ross Bencina wrote:
>
>
> I'm not sure. Maybe. Otherwise it could indicate that the realtek driver
> only supports an obscure configuration that PortAudio has not encountered
> before. If that is the case, either bufferSize is bad (unlikely) or
> bufferInfos+numChannels is somehow incompatible with what the device
> actually supports. I think that could happen if, say, the driver requires
> different channels to be opened with different formats -- from memoery. I
> don't think the PA code supports that, but I don't recall seeing it in the
> wild before either.
>
>
I can confirm that the bufferSize used is the one that the ASIO driver is
saying it expects (minBufferSize == maxBufferSize == 1024). Not sure about
the other part yet.


>
> You could try digging around with a debugger and check that
>
> asioDeviceInfo->asioChannelInfos[i]->type
>
> is the same for all i from 0 up to
> (asioDeviceInfo->commonDeviceInfo.maxInputChannels +
> asioDeviceInfo->commonDeviceInfo.maxOutputChannels).
>
>
All channel types are reported as 17, or ASIOSTInt24LSB. As a shot in the
dark without really understanding how sample types are handled in
portaudio, I tried using paInt24 and paInt16 for
the outputParams.sampleFormat, but I still get the same asioError -997 from
OpenStream.


>
> Assuming that it's a multichannel device, another thing to try is to open
> all device channels, or just the first 1 or 2.
>
> The device appears to ASIO as supporting 2 input channels and 2 output
channels. I do find this a bit strange, since it appears quite differently
to WASAPI and the windows Sound control Panel (one playback device called
"Speakers", and two different recording devices, one being "Microphone" and
one being "Line In"). Also, I have a laptop with realtek drivers, and
inputs / outputs appear as separate devices. Not really sure if this is
relevant..


> If possible, you could also try building with PA_ENABLE_DEBUG_OUTPUT
> defined and post the output here.
>
> Sure, here is the output from my app, until the failed ASIOCreateBuffers()
call (lines beginning with "|info   |..." are from our framework) :

before paHostApiInitializers[0].
ASIO names[0]:ASIO 2.0 - ESI MAYA44USB
AsioDirectSound
Skipping ASIO device:ASIO 2.0 - ESI MAYA44USB
ASIO names[1]:ASIO Avid Driver
Skipping ASIO device:ASIO Avid Driver
ASIO names[2]:Dante Virtual Soundcard
Skipping ASIO device:Dante Virtual Soundcard
ASIO names[3]:Focusrite Thunderbolt ASIO
Skipping ASIO device:Focusrite Thunderbolt ASIO
ASIO names[4]:Focusrite USB ASIO
Skipping ASIO device:Focusrite USB ASIO
ASIO names[5]:MOTU Audio ASIO
Skipping ASIO device:MOTU Audio ASIO
ASIO names[6]:Realtek ASIO
PaAsio_Initialize: drv:6 name = Realtek ASIO
PaAsio_Initialize: drv:6 inputChannels       = 2
PaAsio_Initialize: drv:6 outputChannels      = 2
PaAsio_Initialize: drv:6 bufferMinSize       = 496
PaAsio_Initialize: drv:6 bufferMaxSize       = 496
PaAsio_Initialize: drv:6 bufferPreferredSize = 496
PaAsio_Initialize: drv:6 bufferGranularity   = 0
PaAsio_Initialize: drv:6 defaultSampleRate = 44100.000000
PaAsio_Initialize: drv:6 defaultLowInputLatency = 0.011247
PaAsio_Initialize: drv:6 defaultLowOutputLatency = 0.011247
PaAsio_Initialize: drv:6 defaultHighInputLatency = 0.011247
PaAsio_Initialize: drv:6 defaultHighOutputLatency = 0.011247
after paHostApiInitializers[0].
before paHostApiInitializers[1].
WASAPI: device idx: 00
WASAPI: ---------------
WASAPI:0| name[Realtek Digital Output (Realtek High Definition Audio)]
WASAPI:0| form-factor[8]
WASAPI: getting Windows version with GetVersion()
WASAPI: Windows version = 3
WASAPI: IAudioClient version = 2
WASAPI:0| def.SR[48000] max.CH[2] latency{hi[0.010000] lo[0.003000]}
WASAPI: device idx: 01
WASAPI: ---------------
WASAPI:1| name[HDMI-4 (NVIDIA High Definition Audio)]
WASAPI:1| form-factor[9]
WASAPI:1| def.SR[48000] max.CH[2] latency{hi[0.010000] lo[0.003000]}
WASAPI: device idx: 02
WASAPI: ---------------
WASAPI:2| name[Speakers (Realtek High Definition Audio)]
WASAPI:2| form-factor[1]
WASAPI:2| def.SR[44100] max.CH[2] latency{hi[0.010159] lo[0.003000]}
WASAPI: device idx: 03
WASAPI: ---------------
WASAPI:3| name[Microphone (HD Webcam C615)]
WASAPI:3| form-factor[4]
WASAPI:3| def.SR[32000] max.CH[1] latency{hi[0.010000] lo[0.003000]}
WASAPI: device idx: 04
WASAPI: ---------------
WASAPI:4| name[Line In (Realtek High Definition Audio)]
WASAPI:4| form-factor[2]
WASAPI:4| def.SR[44100] max.CH[2] latency{hi[0.010159] lo[0.003000]}
WASAPI: initialized ok
after paHostApiInitializers[1].
|info   | PortAudioTestApp::printPaInfo[73] numHosts: 2, default name: ASIO
|info   | PortAudioTestApp::printPaInfo[76] host index: 0, PaHostApiTypeId:
3, name: ASIO, device count: 1
|info   | PortAudioTestApp::printPaInfo[76] host index: 1, PaHostApiTypeId:
13, name: Windows WASAPI, device count: 5
|info   | PortAudioTestApp::printPaInfo[80] numDevices: 6
|info   | PortAudioTestApp::printPaInfo[86] device index: 0, host api: 0,
name: Realtek ASIO, input channels: 2, output channels: 2, samplerate:
44100, latency (low): [0.0112472, 0.0112472], latency (high): [0.0112472,
0.0112472]
|info   | PortAudioTestApp::printPaInfo[86] device index: 1, host api: 1,
name: Realtek Digital Output (Realtek High Definition Audio), input
channels: 0, output channels: 2, samplerate: 48000, latency (low): [0,
0.003], latency (high): [0, 0.01]
|info   | PortAudioTestApp::printPaInfo[86] device index: 2, host api: 1,
name: HDMI-4 (NVIDIA High Definition Audio), input channels: 0, output
channels: 2, samplerate: 48000, latency (low): [0, 0.003], latency (high):
[0, 0.01]
|info   | PortAudioTestApp::printPaInfo[86] device index: 3, host api: 1,
name: Speakers (Realtek High Definition Audio), input channels: 0, output
channels: 2, samplerate: 44100, latency (low): [0, 0.003], latency (high):
[0, 0.0101587]
|info   | PortAudioTestApp::printPaInfo[86] device index: 4, host api: 1,
name: Microphone (HD Webcam C615), input channels: 1, output channels: 0,
samplerate: 32000, latency (low): [0.003, 0], latency (high): [0.01, 0]
|info   | PortAudioTestApp::printPaInfo[86] device index: 5, host api: 1,
name: Line In (Realtek High Definition Audio), input channels: 2, output
channels: 0, samplerate: 44100, latency (low): [0.003, 0], latency (high):
[0.0101587, 0]
|info   | PortAudioTestApp::printPaInfo[89] default input: 0, default
output: 0
TerminateHostApis in
TerminateHostApis out
before paHostApiInitializers[0].
ASIO names[0]:ASIO 2.0 - ESI MAYA44USB
AsioDirectSound
Skipping ASIO device:ASIO 2.0 - ESI MAYA44USB
ASIO names[1]:ASIO Avid Driver
Skipping ASIO device:ASIO Avid Driver
ASIO names[2]:Dante Virtual Soundcard
Skipping ASIO device:Dante Virtual Soundcard
ASIO names[3]:Focusrite Thunderbolt ASIO
Skipping ASIO device:Focusrite Thunderbolt ASIO
ASIO names[4]:Focusrite USB ASIO
Skipping ASIO device:Focusrite USB ASIO
ASIO names[5]:MOTU Audio ASIO
Skipping ASIO device:MOTU Audio ASIO
ASIO names[6]:Realtek ASIO
PaAsio_Initialize: drv:6 name = Realtek ASIO
PaAsio_Initialize: drv:6 inputChannels       = 2
PaAsio_Initialize: drv:6 outputChannels      = 2
PaAsio_Initialize: drv:6 bufferMinSize       = 1024
PaAsio_Initialize: drv:6 bufferMaxSize       = 1024
PaAsio_Initialize: drv:6 bufferPreferredSize = 1024
PaAsio_Initialize: drv:6 bufferGranularity   = 0
PaAsio_Initialize: drv:6 defaultSampleRate = 44100.000000
PaAsio_Initialize: drv:6 defaultLowInputLatency = 0.023220
PaAsio_Initialize: drv:6 defaultLowOutputLatency = 0.023220
PaAsio_Initialize: drv:6 defaultHighInputLatency = 0.023220
PaAsio_Initialize: drv:6 defaultHighOutputLatency = 0.023220
after paHostApiInitializers[0].
before paHostApiInitializers[1].
WASAPI: device idx: 00
WASAPI: ---------------
WASAPI:0| name[Realtek Digital Output (Realtek High Definition Audio)]
WASAPI:0| form-factor[8]
WASAPI:0| def.SR[48000] max.CH[2] latency{hi[0.010000] lo[0.003000]}
WASAPI: device idx: 01
WASAPI: ---------------
WASAPI:1| name[HDMI-4 (NVIDIA High Definition Audio)]
WASAPI:1| form-factor[9]
WASAPI:1| def.SR[48000] max.CH[2] latency{hi[0.010000] lo[0.003000]}
WASAPI: device idx: 02
WASAPI: ---------------
WASAPI:2| name[Speakers (Realtek High Definition Audio)]
WASAPI:2| form-factor[1]
WASAPI:2| def.SR[44100] max.CH[2] latency{hi[0.010159] lo[0.003000]}
WASAPI: device idx: 03
WASAPI: ---------------
WASAPI:3| name[Microphone (HD Webcam C615)]
WASAPI:3| form-factor[4]
WASAPI:3| def.SR[32000] max.CH[1] latency{hi[0.010000] lo[0.003000]}
WASAPI: device idx: 04
WASAPI: ---------------
WASAPI:4| name[Line In (Realtek High Definition Audio)]
WASAPI:4| form-factor[2]
WASAPI:4| def.SR[44100] max.CH[2] latency{hi[0.010159] lo[0.003000]}
WASAPI: initialized ok
after paHostApiInitializers[1].
|info   |
cinder::audio::OutputDeviceNodePortAudio::OutputDeviceNodePortAudio[79]
device key: 0 - ASIO - Realtek ASIO
|info   |
cinder::audio::OutputDeviceNodePortAudio::OutputDeviceNodePortAudio[80]
device channels: 2, samplerate: 44100, framesPerBlock: 1024
|info   | cinder::audio::ContextPortAudio::createOutputDeviceNode[496]
created OutputDeviceNodePortAudio for device named 'Realtek ASIO'
|info   | cinder::audio::OutputDeviceNodePortAudio::initialize[89] bang
|info   | cinder::audio::OutputDeviceNodePortAudio::initialize[142] -
opening half duplex stream
ASIOCanSampleRate(44100.000000):0
ASIOGetSampleRate:0.000000
before ASIOSetSampleRate(44100.000000)
avcore\audiocore\client\audioclient\audioclientcore.cpp(1477)\AUDIOSES.DLL!0FB7BBA3:
(caller: 0FB5624A) ReturnHr(1) tid(54b0) 887C0034
avcore\audiocore\client\audioclient\audioclientcore.cpp(1540)\AUDIOSES.DLL!0FB7C12E:
(caller: 0FB5624A) ReturnHr(2) tid(54b0) 88890019 after
ASIOSetSampleRate(44100.000000)
PaAsioOpenStream: framesPerHostBuffer :1024
OpenStream ERROR9
goto errored
|fatal  | cinder::app::AppBase::executeLaunch[197] Uncaught exception,
type: class cinder::audio::ContextPortAudioExc, what: Failed to open stream
for output device named 'Realtek ASIO (half duplex) (PaError: -9999,
'Unanticipated host error')

Thanks again,
Rich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.columbia.edu/pipermail/portaudio/attachments/20181102/b54c5a96/attachment.html>


More information about the Portaudio mailing list