Discussion:
'Unanticipated host error' with default output device
(too old to reply)
Rich Eakin
2018-10-27 05:23:23 UTC
Permalink
Hi all,

I'm in the process of adding PortAudio as a backend to a framework I work
on (libcinder) and running into an issue on one computer with the default
selected output device, where the call to Pa_OpenStream is returning error
code -9999 ("Unanticipated host error"). I'm on Windows 10 with both WASAPI
and ASIO enabled. The default and problematic device showing up is 'Realtek
ASIO' on this PC. Has anyone here seen anything like this, or can think of
some ways to debug? This is when trying to just open up a 2 channel output
stream with this realtek asio device.

Below is the full host and device info:

numHosts: 2, default name: ASIO
host index: 0, PaHostApiTypeId: 3, name: ASIO, device count: 1
host index: 1, PaHostApiTypeId: 13, name: Windows WASAPI, device count: 5
device index: 0, host api: 0, name: Realtek ASIO, input channels: 2, output
channels: 2, samplerate: 44100
device index: 1, host api: 1, name: Realtek Digital Output (Realtek High
Definition Audio), input channels: 0, output channels: 2
device index: 2, host api: 1, name: HDMI-4 (NVIDIA High Definition Audio),
input channels: 0, output channels: 2, samplerate: 48000
device index: 3, host api: 1, name: Speakers (Realtek High Definition
Audio), input channels: 0, output channels: 2, samplerate: 44100
device index: 4, host api: 1, name: Microphone (HD Webcam C615), input
channels: 1, output channels: 0, samplerate: 48000
device index: 5, host api: 1, name: Line In (Realtek High Definition
Audio), input channels: 2, output channels: 0, samplerate: 48000
default input: 0, default output: 0

FWIW, I also saw this behavior in a different app I use, Purr-Data (a fork
of pd), where it showed the exact same error message when trying to use the
Realtek ASIO device for both input and output.

Thanks for any help,
Rich Eakin
Franci Zabukovec
2018-10-27 07:25:30 UTC
Permalink
I am currently struggling with this as well - few users of my program
are getting this error.

I did an extensive troubleshooting (Win 10 x64) but i couldn't find a
solutionr. They are getting exactly the same Pa_OpenStream message with
extended code/description "*Hardware is in a bad mode or used in a bad
mode*".

We tried few different soundcards (on-board, Zoom, Steinberg) - no
success . We also removed/disabled all sound devices from the system- no
success.

After more random fiddling, message suddenly changed to *invalid sample
rate* !?!.

I've tried to call/experimenting Pa_OpenStream with all kind of
parameter values, sample rates, buffer sizes - no change. Don't know
what more to do, can't get rid of it. Looks like in this case, there is
something related to sample rate on the system level. All other software
(Reaper etc.) work without any problem on the same system. Must say that
this is the first time is see this issue after cca. 7 years of using
PortAudio, so it might be related to some new Windows updates ???

There is no external wordclock used (that could be a possible reason for
this message).

Cheers,
Franci
Post by Rich Eakin
Hi all,
I'm in the process of adding PortAudio as a backend to a framework I
work on (libcinder) and running into an issue on one computer with the
default selected output device, where the call to Pa_OpenStream is
returning error code -9999 ("Unanticipated host error"). I'm on
Windows 10 with both WASAPI and ASIO enabled. The default and
problematic device showing up is 'Realtek ASIO' on this PC. Has anyone
here seen anything like this, or can think of some ways to debug? This
is when trying to just open up a 2 channel output stream with this
realtek asio device.
numHosts: 2, default name: ASIO
host index: 0, PaHostApiTypeId: 3, name: ASIO, device count: 1
host index: 1, PaHostApiTypeId: 13, name: Windows WASAPI, device count: 5
device index: 0, host api: 0, name: Realtek ASIO, input channels: 2,
output channels: 2, samplerate: 44100
device index: 1, host api: 1, name: Realtek Digital Output (Realtek
High Definition Audio), input channels: 0, output channels: 2
device index: 2, host api: 1, name: HDMI-4 (NVIDIA High Definition
Audio), input channels: 0, output channels: 2, samplerate: 48000
device index: 3, host api: 1, name: Speakers (Realtek High Definition
Audio), input channels: 0, output channels: 2, samplerate: 44100
device index: 4, host api: 1, name: Microphone (HD Webcam C615), input
channels: 1, output channels: 0, samplerate: 48000
device index: 5, host api: 1, name: Line In (Realtek High Definition
Audio), input channels: 2, output channels: 0, samplerate: 48000
default input: 0, default output: 0
FWIW, I also saw this behavior in a different app I use, Purr-Data (a
fork of pd), where it showed the exact same error message when trying
to use the Realtek ASIO device for both input and output.
Thanks for any help,
Rich Eakin
_______________________________________________
Portaudio mailing list
https://lists.columbia.edu/mailman/listinfo/portaudio
--
Zabukowski Webpage <http://www.zabukowski.com>
Zabukowski on Facebook <http://www.facebook.com/zabukowski>
Zabukowski on Soundcloud <http://www.soundcloud.com/zabukowski>
Zabukowski on Twitter <http://www.twitter.com/zabukowski>
Franci Zabukovec Facebook <http://www.facebook.com/franci.zabukovec>
Zabukowski Software Webpage <http://www.zabukowski.com/software>
Zabukowski Software Facebook <http://www.facebook.com/ZabukowskiSoftware>
Ross Bencina
2018-10-28 06:14:16 UTC
Permalink
Hi Rich,

Not sure whether this helps but you could check whether it's a
permissions issue. Jürgen Müller put this forward as a fix for a similar
If someone has a MS Surface Pro 4 or a similar device with Windows 10
as operating system and you want to use PortAudio to get information
from a microphone, it could be that the "Pa_OpenStream"-call get
"Unanticipated host error" (you can get this for example by using the
test program "pa_fuzz.exe").
Then first you have to examine the privacy settings of the microphone.
Under start menu / settings / privacy / microphone "let apps access
the microphone" have to be "on" and under "choose apps" "linguistic
recording" have to be "on" too. All other points may be "off".
Does that help?

As far as debugging goes, are you able to step through with a debugger
and see which line of pa_asio.cpp is causing the error to be returned?

Ross.
Hi all,
I'm in the process of adding PortAudio as a backend to a framework I
work on (libcinder) and running into an issue on one computer with the
default selected output device, where the call to Pa_OpenStream is
returning error code -9999 ("Unanticipated host error"). I'm on Windows
10 with both WASAPI and ASIO enabled. The default and problematic device
showing up is 'Realtek ASIO' on this PC. Has anyone here seen anything
like this, or can think of some ways to debug? This is when trying to
just open up a 2 channel output stream with this realtek asio device.
numHosts: 2, default name: ASIO
host index: 0, PaHostApiTypeId: 3, name: ASIO, device count: 1
host index: 1, PaHostApiTypeId: 13, name: Windows WASAPI, device count: 5
device index: 0, host api: 0, name: Realtek ASIO, input channels: 2,
output channels: 2, samplerate: 44100
device index: 1, host api: 1, name: Realtek Digital Output (Realtek High
Definition Audio), input channels: 0, output channels: 2
device index: 2, host api: 1, name: HDMI-4 (NVIDIA High Definition
Audio), input channels: 0, output channels: 2, samplerate: 48000
device index: 3, host api: 1, name: Speakers (Realtek High Definition
Audio), input channels: 0, output channels: 2, samplerate: 44100
device index: 4, host api: 1, name: Microphone (HD Webcam C615), input
channels: 1, output channels: 0, samplerate: 48000
device index: 5, host api: 1, name: Line In (Realtek High Definition
Audio), input channels: 2, output channels: 0, samplerate: 48000
default input: 0, default output: 0
FWIW, I also saw this behavior in a different app I use, Purr-Data (a
fork of pd), where it showed the exact same error message when trying to
use the Realtek ASIO device for both input and output.
Thanks for any help,
Rich Eakin
_______________________________________________
Portaudio mailing list
https://lists.columbia.edu/mailman/listinfo/portaudio
Rich Eakin
2018-10-31 01:43:07 UTC
Permalink
Hi Ross, thanks for helping us along..
Post by Ross Bencina
Hi Rich,
Not sure whether this helps but you could check whether it's a
permissions issue. JÃŒrgen MÃŒller put this forward as a fix for a similar
If someone has a MS Surface Pro 4 or a similar device with Windows 10
as operating system and you want to use PortAudio to get information
from a microphone, it could be that the "Pa_OpenStream"-call get
"Unanticipated host error" (you can get this for example by using the
test program "pa_fuzz.exe").
Then first you have to examine the privacy settings of the microphone.
Under start menu / settings / privacy / microphone "let apps access
the microphone" have to be "on" and under "choose apps" "linguistic
recording" have to be "on" too. All other points may be "off".
Does that help?
I can verify that "Allow apps to access your microphone" is on, there is no
"linguistic recording" on my PC (but then, this is a desktop and not a
surface pro).
Post by Ross Bencina
As far as debugging goes, are you able to step through with a debugger
and see which line of pa_asio.cpp is causing the error to be returned?
I've been stepping through the code, error is coming from ASIOCreateBuffers
(pa_asio.cpp line 2303) returning ASE_InvalidMode, from the following line
in asio.cpp:

return theAsioDriver->createBuffers(bufferInfos, numChannels, bufferSize,
callbacks);

Does this indicate it is an issue with the realtek driver itself?

Thanks again,
Rich
Ross Bencina
2018-10-31 09:22:03 UTC
Permalink
Hi Rich,
Post by Rich Eakin
I've been stepping through the code, error is coming from
ASIOCreateBuffers (pa_asio.cpp line 2303) returning ASE_InvalidMode,
return theAsioDriver->createBuffers(bufferInfos, numChannels,
bufferSize, callbacks);
Does this indicate it is an issue with the realtek driver itself?
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.

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).


Assuming that it's a multichannel device, another thing to try is to
open all device channels, or just the first 1 or 2.

If possible, you could also try building with PA_ENABLE_DEBUG_OUTPUT
defined and post the output here.

Thanks,

Ross.
Franci Zabukovec
2018-10-31 22:13:49 UTC
Permalink
HI Rich and Ross,

ASE_InvalidMode is the error my customer is getting as well - asio.h
describes it as "hardware is in a bad mode or used in a bad mode".

Unfortunately, debugging on customer computer is not possible and i
can't replicate this on any of my computers and virtual machines :(

Any additional information would be greatly appreciated. As i said we
tried three different audio interfaces (one of them was actually
Realtek) on problematic computer with no success.

Cheers,
Franci
Post by Ross Bencina
Hi Rich,
Post by Rich Eakin
I've been stepping through the code, error is coming from
ASIOCreateBuffers (pa_asio.cpp line 2303) returning ASE_InvalidMode,
return theAsioDriver->createBuffers(bufferInfos, numChannels,
bufferSize, callbacks);
Does this indicate it is an issue with the realtek driver itself?
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.
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).
Assuming that it's a multichannel device, another thing to try is to
open all device channels, or just the first 1 or 2.
If possible, you could also try building with PA_ENABLE_DEBUG_OUTPUT
defined and post the output here.
Thanks,
Ross.
_______________________________________________
Portaudio mailing list
https://lists.columbia.edu/mailman/listinfo/portaudio
--
Zabukowski Webpage <http://www.zabukowski.com>
Zabukowski on Facebook <http://www.facebook.com/zabukowski>
Zabukowski on Soundcloud <http://www.soundcloud.com/zabukowski>
Zabukowski on Twitter <http://www.twitter.com/zabukowski>
Franci Zabukovec Facebook <http://www.facebook.com/franci.zabukovec>
Zabukowski Software Webpage <http://www.zabukowski.com/software>
Zabukowski Software Facebook <http://www.facebook.com/ZabukowskiSoftware>
Rich Eakin
2018-11-02 07:21:24 UTC
Permalink
Post by Ross Bencina
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.
Post by Ross Bencina
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.
Post by Ross Bencina
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..
Post by Ross Bencina
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
Ross Bencina
2018-11-03 05:04:09 UTC
Permalink
Hi Rich,

It looks like you're initializing PA twice and you get different buffer
sizes on each init. Is that correct?
Post by Rich Eakin
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
[snip]
Post by Rich Eakin
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
Cheers,

Ross.
Rich Eakin
2018-11-03 21:50:55 UTC
Permalink
Hi Ross,

Yes, apologies for the noise in the logs - I was calling a little test
function before anything else that was initializing portaudio, printing the
device properties, then calling Pa_Terminate(). When I don't call that
routine, so I only get the second one within the rest of my audio engine, I
still end up getting the -997 asio error.

Something I find strange, is that in the test run where I pasted the code
to you, the buffer min/max size is 496 and then 1024. Whereas when I run it
now (without changing any other hardware settings), it reports 1024 both
times. I'll have to keep a look out to see if it ever says 496 again.

cheers,
Rich
Post by Ross Bencina
Hi Rich,
It looks like you're initializing PA twice and you get different buffer
sizes on each init. Is that correct?
Post by Rich Eakin
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
[snip]
Post by Rich Eakin
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
Cheers,
Ross.
Ross Bencina
2018-11-04 02:59:16 UTC
Permalink
Hi Rich,

Another thing you could try is to build PA with ASIO support only (no
WASAPI or other host APIs) and see if you get the same error.

Ross.
Post by Rich Eakin
Hi Ross,
Yes, apologies for the noise in the logs - I was calling a little test
function before anything else that was initializing portaudio, printing
the device properties, then calling Pa_Terminate(). When I don't call
that routine, so I only get the second one within the rest of my audio
engine, I still end up getting the -997 asio error.
Something I find strange, is that in the test run where I pasted the
code to you, the buffer min/max size is 496 and then 1024. Whereas when
I run it now (without changing any other hardware settings), it reports
1024 both times. I'll have to keep a look out to see if it ever says 496
again.
cheers,
Rich
Hi Rich,
It looks like you're initializing PA twice and you get different buffer
sizes on each init. Is that correct?
Post by Rich Eakin
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
[snip]
Post by Rich Eakin
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
Cheers,
Ross.
Rich Eakin
2018-11-05 22:26:36 UTC
Permalink
Hi Ross,

Tried with just ASIO enabled, still reporting the -997 with the default
Realtek device.

I wonder, is there a cheap way to test if ASIO will work with the device
and current params before I set it as default in my engine? For example in
WASAPI, there is the method IAudioClient::IsFormatSupported().

cheers,
Rich
Post by Ross Bencina
Hi Rich,
Another thing you could try is to build PA with ASIO support only (no
WASAPI or other host APIs) and see if you get the same error.
Ross.
Post by Rich Eakin
Hi Ross,
Yes, apologies for the noise in the logs - I was calling a little test
function before anything else that was initializing portaudio, printing
the device properties, then calling Pa_Terminate(). When I don't call
that routine, so I only get the second one within the rest of my audio
engine, I still end up getting the -997 asio error.
Something I find strange, is that in the test run where I pasted the
code to you, the buffer min/max size is 496 and then 1024. Whereas when
I run it now (without changing any other hardware settings), it reports
1024 both times. I'll have to keep a look out to see if it ever says 496
again.
cheers,
Rich
Hi Rich,
It looks like you're initializing PA twice and you get different
buffer
Post by Rich Eakin
sizes on each init. Is that correct?
Post by Rich Eakin
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
[snip]
Post by Rich Eakin
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
Cheers,
Ross.
Loading...