Only one channel from two-channel Behringer UCA202

I have been trying to get both audio channels to come from my Behringer UCA202. What I get is the same channel duplicated in two columns the received vector.
I am running R2022a in Win7 and Win10.
I am running the quick example "AudioStreamFromDeviceToDeviceExample.mlx" from the audio toolbox.
I have tried to set up the UCA202 device with these various commands, but none gave a distinct pair of channels. In the case of ASIO, I have also used asiosettings.
% deviceReader = audioDeviceReader; % this gives a single vector output
deviceReader = audioDeviceReader('NumChannels',2);
% deviceReader = audioDeviceReader('SampleRate',16000,'Driver','ASIO');
% deviceReader = audioDeviceReader('Driver','ASIO','NumChannels',2);
% deviceReader = audioDeviceReader('Driver','ASIO','Device','ASIO4ALL v2','NumChannels',2);
% deviceReader = audioDeviceReader('Driver','WASAPI','NumChannels',2);
Elsewhere in this forum, someone has used the UCA202.
Regards,
-Joe

답변 (1개)

Jimmy Lapierre
Jimmy Lapierre 2022년 5월 3일
편집: Jimmy Lapierre 2022년 5월 3일

0 개 추천

1. Try specifying the name of the device as well, in case you are picking up another (mono) device instead of you UCA202.
>> audioDeviceReader('Device','Name of my device')
2. Make sure there are no "mono" switches on the device or in asiosettings.
3. Also try an alternate method, using channel mapping:
>> audioDeviceReader('ChannelMappingSource','Property','ChannelMapping',1:2)

댓글 수: 16

Thank you very much for the suggestions. I had already verifed that only the left channel is being received in duplicate from the UCA202. I will try your other suggestions next.
BTW, the UCA202 works fine with REAPER daw.
Another suggestion would be to try audiorecorder as well
Thank you for the suggestions. After trying many combinations, I finally got both channels separately using the ASIO driver for reading and writing. I am driving the Left with a 1kHz sinewave and the Right with music. This command worked:
deviceReader = audioDeviceReader('Driver','ASIO','NumChannels',2,'SamplesPerFrame',1024,'SampleRate',32000);
However,now I have a different issue. It appears that I only get 160 samples in the 1024 sample frames.There is also no audio coming out of the UCA202. The audio came out earlier, when I could only get duplicates of the left channel.The process gain on line 22 has no effect.
See the attached screenshots for the ASIO settings and for a plot of mySignal and myProcessedSignal. I attached the AudioStreamFromDeviceToDeviceExample_JoeM.m.
The ASIO4ALL driver is only a "wrapper", so it is not the most reliable. That being said, if you want to both read and write, I highly recommend using audioPlayerRecorder to make sure you get proper full duplex operation (it uses ASIO on Windows by default). You'll also want to use the same sample rate as you have set in the driver (48k instead of 32k). I also recommend specifying the "Device" property to be on the safe side.
Thank you Jimmy for the further suggestions. I explored audioPlayerRecorder, but was able to read only one channel from the the microphone pair, while I was able to write two different tones to the stereo headphone. Both of these attached to the UCA202.
But I finally may have stumbled upon the solution. The problem is that I was testing with just 1 sec tests. This truncated the results to just 160 samples. When I extended the test to 10 sec, both chanels came back from the UCA202 inputs, one with a tone and the other with music. And after a moment's delay, the processed sound came back out of the UCA202 outputs.
This was all run in Win7. I attached the script that worked with the extended 10s test at line 34 (While toc<10). I also attached the plot showing complete 1024 frames that were collected from the UCA202.
So far, this is not working in my Surface GO win10.
Thanks for the update. And for the Surface, is it not working because it's not keeping up? You can check the extra output of the read/write functions to check for dropouts.
It appears that I have the same original issue that I had with the Win7 Lenovo X-1 also appear in the Win10 Surface-GO. I only get one mike channel repeated twice.
I get channel 2 twice with music using
deviceReader = audioDeviceReader('Device','ASIO4ALL v2','Driver','ASIO','NumChannels',2,'SamplesPerFrame',1024,'SampleRate',48000);
and I get channel 1 twice with the 440Hz tone using
deviceReader = audioDeviceReader('Device','Default','Driver','DirectSound','NumChannels',2,'SamplesPerFrame',1024,'SampleRate',48000);
I am using the following after either of the commands above
deviceWriter = audioDeviceWriter('SampleRate',deviceReader.SampleRate);
Regards,
-Joe
One small correction, the sound card in question is not the UCA202, but the UCA222. The first model name is embossed in the bottom, but the label on top says the latter.
-Joe
The default device is probably the onboard mono microphone on your laptop. Please specify the name of the device you want to use (should appear with autocomplete after typing 'Device',[tab] or with getAudioDevices(deviceReader)', with deviceReader Driver property set to what you want to use).
I finally found the issue. The microphone input for the external USB sound card UCA222 was configured as one channel in the Win10 settings. After I changed to 2channel 48000Hz, I got both channels out, but of the two commands just presented, only this captured both input channels:
deviceReader = audioDeviceReader('Device','Default','Driver','DirectSound','NumChannels',2,'SamplesPerFrame',1024,'SampleRate',48000);
The fundamental issue seems to have been one of conflict of settings between Win10 defaults and the audioDeviceReader.
To set the proper mike configuration go to Sound Settings and select Sound Control Panel. Go to Recording Tab. There select the USB microphone from your external sound card and click Properties. In Microphone Properties go to the advanced tab and click on the drop-down menu with various channel counts and sampling rates. I picked 2ch, 16bit, 48000Hz.
It appears that channel count is the only setting that can't be controlled from audioDeviceReader. I was able to set various sampling rates and frame lengths from audioDeviceReader.
Thanks for all the help,
-Joe
I was not aware of this limitiation with DirectSound, I will take good note of this and see if we can improve this in the future.
With a manufacturer ASIO driver (maybe not ASIO4ALL) and audioDeviceReader set to ASIO, I do not expect this to happen.
On your previous comment, I tried every auto-fill in putting together the command, but that did not solve the prolbem until I solved the Win10 settings issue. BTW, I have run REAPER for a long time and it was always able to supercede the windows settings to get input from both channels.
-Joe
Do you use WASAPI or Direct Sound with Reaper? I think reaper can do exclusive WASAPI, and we do shared WASAPI, so that might explain why the Windows settings matter.
I use ASIO4ALL with REAPER, but I tried DirectSound and WASAPI for your inquiry. I attached the REAPER control panel screenshots for each option. WASAPI did not work. The other two worked.
On a related note, I got back to the Win7 Lenovo X1 and tried the DesignAnAudioPluginExample to further check out the 2-channel situation. This put me back to one channel coming out twice. That is because I had not set Win7 for 2 channels in the settings as I had done for Win10. Although this was not necessary with DirectSound set by audioDeviceReader in Win7 above. Once I set the microphone to two channels, I got correct two channel input for the plugin experiment. See the Win7_2ch_control_panel.gif screenshot.
Would you mind verifying if you have the same issue with audiorecorder? That way I can make sure the right team looks more deeply into this.
The same issue comes up with audiorecorder in Win7 (lenovo x1) and Win10 (surface go). The windows settings always for the input audio channel count prevail.
I used this script:
Fs = 44100 ;
nBits = 16 ;
nChannels = 2 ;
ID = -1; % default audio input device
recObj = audiorecorder(Fs,nBits,nChannels,ID);
disp('Start speaking.')
recordblocking(recObj,5);
disp('End of Recording.');
play(recObj);

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Measurements and Spatial Audio에 대해 자세히 알아보기

제품

릴리스

R2022a

질문:

2022년 5월 3일

댓글:

2022년 5월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by