Borrar filtros
Borrar filtros

PortAudio Error: Unanticipated host error.

17 visualizaciones (últimos 30 días)
Chris Chow
Chris Chow el 28 de Oct. de 2016
Respondida: Shuvodip Majumdar el 18 de Mzo. de 2023
I'm trying to use a digiducer accelerometer on an Ubuntu 16.04 system running Matlab R2012a.
I used H = dsp.AudioRecorder(.....) function and get no errors. But when I subsequently use AUDIO = step(H), I get 'PortAudio Error: Unanticipated host error.' What causes this?
device = '333D01 10595173209464075160919: USB Audio (hw:1,0)';
fs = 22050; % fs = Hz
FrameSize = 1024;
H = dsp.AudioRecorder('DeviceName', device, ...
'SampleRate', fs, ...
'NumChannels', 2, ...
'DeviceDataType', '16-bit integer', ...
'BufferSizeSource', 'Property', ...
'BufferSize', 4096, ...
'QueueDuration', 1, ...
'SamplesPerFrame', FrameSize, ...
'OutputDataType', 'double');
AUDIO = step(H);
On calling this step(H) function, I get the following errors in my Linux terminal:
Expression 'alsa_snd_pcm_hw_params_set_buffer_size_near( self->pcm, hwParams, &bufSz )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1996
Expression 'PaAlsaStreamComponent_FinishConfigure( &self->capture, hwParamsCapture, inParams, self->primeBuffers, realSr, inputLatency )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2646
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2758

Respuestas (2)

Walter Roberson
Walter Roberson el 28 de Oct. de 2016

Shuvodip Majumdar
Shuvodip Majumdar el 18 de Mzo. de 2023
For me this error occured because the audio writer was expecting a sample rate of 45600 Hz, but I was using 48000 Hz. Once I changed the output sample rate to 45600 Hz, the error disappeared.

Categorías

Más información sobre Simulation, Tuning, and Visualization en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by