respeaker / seeed-voicecard

2 Mic Hat, 4 Mic Array, 6-Mic Circular Array Kit, and 4-Mic Linear Array Kit for Raspberry Pi
GNU General Public License v3.0
470 stars 284 forks source link

[Bug]: Can not use sounddeivce to simultaneously play a sound while record 6 Channel microphone data #341

Open ZitongLan opened 1 month ago

ZitongLan commented 1 month ago

Describe the bug

To Reproduce I am using the following code that is implemented in the raspberry pi 4 platform to use sounddeivce play a sound while record the sound in the same time. I am using kernel 6.6 and the sound card driver is from https://github.com/HinTak/seeed-voicecard/tree/v6.6.

If I comment sd.rec, the speaker will actually play the respected sound in playback_data. However, if I un-comment like below, the sound will not be played, but the microphone is recording well. What should I do?

sd.play(playback_data, samplerate=sample_rate, device=playback_device)
recorded_data = sd.rec(int(record_duration * sample_rate), samplerate=sample_rate, channels=8, device=recording_device)
sd.wait()

Expected behavior

As describe above

Platform

Relevant log output

No response