Thanks
That was very useful information which helped me a lot.
So I went back to your example but still have the “underrun” issue.
I just realized that it starts when i use aplay (or play) to play the recording from another SSH session.
Here is the use case:
- On a first SSH session, I run your example as following:
$ sudo ./alsa_aloop_test -t CIRCULAR_6MIC_7BEAM -g 5
using snowboy kws
AGC = -5
(48ms)INFO – Sample rate is 48000 [alsa_collector_node.cc:337]
(48ms)DEBUG – Buffer time max is 341334 [alsa_collector_node.cc:355]
(196ms)DEBUG – Chunk size is 1920 [alsa_collector_node.cc:396]
(196ms)INFO – Finish setting Alsa hardware params. [alsa_collector_node.cc:399]
(206ms)DEBUG – VepAecBeamformingNode read microphone config file successfully. [vep_aec_beamforming_node.cc:181]
(207ms)DEBUG – VEP: I need 604248 bytes of memory in memory region 1 to work.
[vep_aec_beamforming_node.cc:207]
(207ms)DEBUG – VEP: I need 0 bytes of memory in memory region 2 to work.
[vep_aec_beamforming_node.cc:207]
(211ms)DEBUG – VepAecBeamformingNode input: channels 8 rate 16000, output: channels 3 rate 16000 [vep_aec_beamforming_node.cc:340]
(212ms)INFO – VepAecBeamformingNode thread started. [vep_aec_beamforming_node.cc:342]
(238ms)INFO – Snowboy1bDoaKwsNode enabled AGC. [snowboy_1b_doa_kws_node.cc:276]
(238ms)DEBUG – Snowboy1bDoaKwsNode input: channels 3 rate 16000, output: channels 1 rate 16000 [snowboy_1b_doa_kws_node.cc:291]
(238ms)INFO – Snowboy1bDoaKwsNode thread started. [snowboy_1b_doa_kws_node.cc:293]
(241ms)INFO – Finish setting Aloop [aloop_output_node.cc:225]
(242ms)INFO – MaxBlockDelayTime is actually set to: 6 * 40ms = 240ms. [aloop_output_node.cc:343]
num channels: 1, rate: 16000
collector: 1, vep_1beam: 0, snowboy_kws: 0, aloop: 0
collector: 2, vep_1beam: 0, snowboy_kws: 0, aloop: 0
…
- On a second SSH session, I record as following:
$ sox -t alsa hw:Loopback,1,0 -t wavpcm -c 1 -b 16 -r 16000 -e signed-integer --endian little - silence 1 0.1 1% 1 1.0 3% > aloop_test.wav
Everything works fine so I play it to listen to it:
$ aplay aloop_test.wav
- Then on the screen of the first session, it starts displaying the following underrun message non-stop and I can not record any more:
(17988ms)DEBUG – Try to recovery from underrun [aloop_output_node.cc:277]
(18473ms)DEBUG – Try to recovery from underrun [aloop_output_node.cc:277]
collector: 3, vep_1beam: 0, snowboy_kws: 0, aloop: 0
(18960ms)DEBUG – Try to recovery from underrun [aloop_output_node.cc:277]
collector: 0, vep_1beam: 0, snowboy_kws: 0, aloop: 0
(19432ms)DEBUG – Try to recovery from underrun [aloop_output_node.cc:277]
collector: 1, vep_1beam: 0, snowboy_kws: 0, aloop: 0
(19907ms)DEBUG – Try to recovery from underrun [aloop_output_node.cc:277]
collector: 0, vep_1beam: 0, snowboy_kws: 0, aloop: 0
(20391ms)DEBUG – Try to recovery from underrun [aloop_output_node.cc:277]
(20867ms)DEBUG – Try to recovery from underrun [aloop_output_node.cc:277]
collector: 1, vep_1beam: 1, snowboy_kws: 0, aloop: 0
(21341ms)DEBUG – Try to recovery from underrun [aloop_output_node.cc:277]
collector: 0, vep_1beam: 0, snowboy_kws: 0, aloop: 0
(21821ms)DEBUG – Try to recovery from underrun [aloop_output_node.cc:277]
collector: 1, vep_1beam: 0, snowboy_kws: 0, aloop: 0
(22296ms)DEBUG – Try to recovery from underrun [aloop_output_node.cc:277]
collector: 0, vep_1beam: 0, snowboy_kws: 0, aloop: 0
Am I doing anything wrong?
Thanks,
Fred