respeaker / respeaker_python_library

To build voice enabled objects/applications with Python and ReSpeaker
Apache License 2.0
149 stars 74 forks source link

ON MIC ARRAY, RECORD CLEAR ON WINDOWS10 AND VERY NOIZZY ON UBUNTU 16.04 #26

Closed elpimous closed 6 years ago

elpimous commented 7 years ago

Hi all, my micarray connected on windows10 produce a very clear record, I can say perfect !!!

But on ubuntu 16.04, each record is very noizzy !! tested on terminal sox command, or on audacity.

even without sound, the recording line is moving, producing too much noise !!

What could be the problem ? (it works perfectly on windows10)

Mic array tested on 2 differents computers (one ubuntu, and the other ubuntu/win)

installed : pip install pocketsphinx webrtcvad pip install pyaudio respeaker --upgrade

elpimous commented 7 years ago

Anyone ? I use pulse on ubuntu 16.04, connected to usb Need help, please !

xiongyihui commented 7 years ago

Which firmware do you use? The default one, or the raw 8 channels one? Do you be able to use audacity to record audio through the usb mic array on Ubuntu?

elpimous commented 7 years ago

Hello, some new tests.: on sox, the record is very bad on arecord it's better ! Why ? different drivers ?

elpimous commented 7 years ago

on audacity, sometimes record is clear, and sometimes a bit noizzy, and after nearly 2 seconds of silence, noize appears ! ??

xiongyihui commented 7 years ago

sox can do resampling, remixing and etc. The audio recorded by sox may not be the raw audio.

xiongyihui commented 7 years ago

Maybe it's a problem of IO mode. arecord uses epoll mode (event based), while sox (or audacity on ubuntu) uses block mode to read audio. The epoll mode is more efficient.

elpimous commented 7 years ago

Hello, Xiogyihui. here is a more example : arecord -v -D hw:1 -f S24_3LE -r 16000 -c2 s.wav http://dl.free.fr/t44UX0H2E

firmware : last 8 channels. Now, can't change firmware (linux/win10) System use the driver respeaker, but both dfu don't see usb product !

mic array leds light on even when there is no sound, anytimes. when recording, if Direction leds is on (3 leds), I will always have noise. When I pass a long time, speaking in every mics, I can have mic array direction leds off.

Boring !! This mic is unusable for me !!! (and I put a big hope in this product !) I bought it for nearly 6-8 months !

elpimous commented 7 years ago

another test : after a small time of direction leds off, I speak. Correct leds light on, but for 10s. I start again, it continue ! video : https://www.grosfichiers.com/XQHmZ6Dq8axpy?tk=3hxXVFVfNrv

elpimous commented 6 years ago

New test with your last 8ch dfu updated. :

vad_doa.py :

/home/nvidia/Documents/mic_array-master/gcc_phat.py:35: RuntimeWarning: invalid value encountered in divide
  cc = np.fft.irfft(R / np.abs(R), n=(interp * n))

77
1111000000000011111110000000111111111111
77

gcc_phat.py :

0.0
1.0
2.0
3.0
4.0
5.0
6.0
7.0
8.0
9.0

mic_array.py :

(0, 'HDA Intel PCH: Generic Analog (hw:0,0)', 2L, 2L)
(1, 'HDA Intel PCH: HDMI 0 (hw:0,3)', 0L, 8L)
(2, 'ReSpeaker Microphone Array: USB Audio (hw:1,0)', 8L, 2L)
(3, 'sysdefault', 128L, 128L)
(4, 'front', 0L, 2L)
(5, 'surround40', 0L, 2L)
(6, 'surround51', 0L, 2L)
(7, 'surround71', 0L, 2L)
(8, 'hdmi', 0L, 8L)
(9, 'pulse', 32L, 32L)
(10, 'dmix', 0L, 2L)
(11, 'default', 32L, 32L)
Traceback (most recent call last):
  File "mic_array.py", line 187, in <module>
    test_8mic()
  File "mic_array.py", line 173, in test_8mic
    with MicArray(16000, 4, 16000 / 4)  as mic:
  File "mic_array.py", line 42, in __init__
    raise Exception('can not find input device with {} channel(s)'.format(self.channels))
Exception: can not find input device with 4 channel(s)

So I modified your lign : with MicArray(16000, 4, 16000 / 4) as mic: to with MicArray(16000, 8, 16000 / 8) as mic:

(0, 'HDA Intel PCH: Generic Analog (hw:0,0)', 2L, 2L)
(1, 'HDA Intel PCH: HDMI 0 (hw:0,3)', 0L, 8L)
(2, 'ReSpeaker Microphone Array: USB Audio (hw:1,0)', 8L, 2L)
Use ReSpeaker Microphone Array: USB Audio (hw:1,0)
/home/nvidia/Documents/mic_array-master/gcc_phat.py:35: RuntimeWarning: invalid value encountered in divide
  cc = np.fft.irfft(R / np.abs(R), n=(interp * n))
77
77
77
77
77
77
77

A mic is defected ?? when I run audacity, and rec, i try to speak around the mic array. On audacity, at one moment, the line produce a visual noise (front mic, near screw hole)

Help, urgent

xiongyihui commented 6 years ago

You record an audio with arecord -v -f S16_LE -c 8 -r 16000 audio-8ch-16bit-16k.wav, and open the audio file with audacity to check if any mic is broken.

Using audacity to directly record audio may have issue on some computers.

elpimous commented 6 years ago

@xiongyihui hello, command done. see audio file. http://dl.free.fr/mDGpo9R3i

It seems that at least 1 mic doesn't work nice ! 3 mics produce sound ! What should I do ? (The mic array is fixed on top of my robot head, and never subject to static electricity ! ) bast. Vincent

elpimous commented 6 years ago

@xiongyihui, thanks for support. problem solved.