Map ASIO errors to meaningful values not paUnanticipatedHostApiError
In many cases should be performing the following mappings from ASIO error codes to PortAudio error codes:
ASE_NoMemory => paInsufficientMemory
ASE_NotPresent => paDeviceUnavailable
and possibly:
ASE_HWMalfunction => paDeviceUnavailable
ASE_NoMemory => paInsufficientMemory
ASE_NotPresent => paDeviceUnavailable
and possibly:
ASE_HWMalfunction => paDeviceUnavailable
Leave a comment
You can find all the ASIO functions in pa_asio.c for searching for the ones that start with ASIO (all caps). Mostly you'll see the code maps them to paUnanticipatedHostApiError. Probably a helper function should be used to map the error codes and set up the host-specific error text where necessary.
There is some contention about whether this is a defect or an enhancment. It is really non-conformance to the specification. In practical terms it is much better if host APIs avoid returning paUnanticipatedHostApiError where ever possible -- it allows clients to return much more user friendly error messages.