Problem:
I can't seem to achieve working audio input and output simultaneously on 32-bit Ubuntu system with an ARM v7l processor, and I don't understand why.
Summary:
I have written PortAudio code that successfully initializes, records, processes, and plays back live audio on several different hardware devices operating on the major platforms and architectures (Windows, Linux, OS X, both x32 and x64).
For some reason, on the ARM v7l platform I most need to work (NVIDIA Jetson), the audio callbacks stop occurring after a very brief period of functioning correctly. It is always after some arbitrary number of frames which is constant between runs and different Jetsons (with different OSes).
I discovered this only occurs when I initialize the PortAudio stream for both input AND output, but if I pass nullptr for the outputParams, everything functions normally.
What I've tried:
- Every available backend (Jack, OSS, ALSA, etc.)
- Changing the sample rate, input and output channels.
- Removing the audio processing step that we're performing to eliminate latency as the issue, turning the device into a simple loopback setup.
- Various hardware device, such as an iO4, an XMOS board, and both external and built-in mics and speakers on numerous computers from disparate manufacturers.
- Adding back and removing some code in PortAudio source that mentions potential dead-locking issues on some platforms (sorry for vagueness, but can't remember exactly where---
grep'ing reveals many possible places, but definitely haven't exhausted this option).
Diagnosis:
This seems to be a bug in PortAudio and I've found bug reports documenting similar behavior. I'm following very simple documented procedures for identifying the hardware device I want to use, extracting the relevant properties, and preparing my stream accordingly. Again, it works almost everywhere.
Does anybody need more information to diagonose this or have a possible explanation, experiment, or temporary workaround?