フィルターのクリア

PortAudio Error: Unanticipated host error.

17 ビュー (過去 30 日間)
Chris Chow
Chris Chow 2016 年 10 月 28 日
回答済み: Shuvodip Majumdar 2023 年 3 月 18 日
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

回答 (2 件)

Walter Roberson
Walter Roberson 2016 年 10 月 28 日

Shuvodip Majumdar
Shuvodip Majumdar 2023 年 3 月 18 日
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.

カテゴリ

Help Center および File ExchangeSimulation, Tuning, and Visualization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by