Microphone Array Research 1 odas odas_web

Main reference:

Realize ODAS+Windows remote web presentation on Raspberry Pi_jimaofu0494's Blog-CSDN Blog ReSpeaker Mic Array v2.0 - Seeed Wiki

Years ago, I implemented a 16-channel microphone array, including direction finding and beamforming.

16-channel microphone array acoustic wave imaging sound source localization beamforming directional recording_哔哩哔哩_bilibili

Many people asked me to buy it, but that system is not convenient for mass production and delivery. So I started to think of a way to make a simplified version of the system, including the simplification of hardware and software.

Before using the 16-channel microphone array, I actually had two usb microphone arrays, one is respeaker mic array v1.0 (7 channels), and the other is respeaker mic array v2.0 (4 channels). In fact, they are the same as the 16 channels, and can be directly connected to odas to achieve the same function. So I plan to use these two boards as a simplified version of the hardware first.

I prefer to use the 4-channel v2.0, because there is a ready-made config file in the odas project. Although the other 7-channel also has a semi-finished product, there is no ip push setting, so it cannot be used directly.

First, you need to find the hardware name of your microphone array using the following python code

import pyaudio
 
p = pyaudio.PyAudio()
info = p.get_host_api_info_by_index(0)
numdevices = info.get('deviceCount')
 
for i in range(0, numdevices):
        if (p.get_device_info_by_host_api_device_index(0, i).get('maxInputChannels')) > 0:
            print "Input Device id ", i, " - ", p.get_device_info_by_host_api_device_index(0, i).get('name')

How to run:

sudo pip install pyaudio
cd ~
nano get_index.py

 Basically, it is either 1 or 2, depending on whether you plug in the microphone before powering on, or plug in the microphone after powering on.

Then it is to install the famous odas.

First install odas with the following code, where odas_live is the core algorithm.

sudo apt-get install libfftw3-dev libconfig-dev libasound2-dev libgconf-2-4
sudo apt-get install cmake
git clone https://github.com/introlab/odas.git
mkdir odas/build
cd odas/build
cmake ..
make

The odas core algorithm is actually very convenient to compile, but the following part is the hard mode.

Then install odas_web, which is the interface.

sudo apt install nodejs
sudo apt install npm
git clone https://github.com/introlab/odas_web
cd odas_web
npm install
npm start

But if you install it directly according to the above, there is a high probability that it will fail to install because of domestic network problems. You may want to follow the steps below: 

https://segmentfault.com/a/1190000019543613?utm_source=tag-newest

I have tried setting up npm proxy in this article, or installing cnpm. In fact, both methods report errors. But I don't know why it can be run directly after running npm start in Raspberry Pi 3. 

 The performance of the Raspberry Pi 3 is not enough, and it runs very slow. If you want to try it, you can directly use this image:

Link: https://pan.baidu.com/s/1PWj2_RKfL8o-zTgg8mJfWA Extraction code: dked

Then I thought of running it with a laptop or a Raspberry Pi 4.

But the same method doesn't work on my ubuntu 16.04 laptop (I actually succeeded a few years ago). In addition, I can't run this odas_web on the Raspberry Pi 4. I have tried various screen resolutions and hdmi ports, but the Raspberry Pi 4 is not supported.

As for the method of use, you can directly enter the location of the odaslive program and its corresponding config file on odas_web, and click launch. You can also run the following command after opening odas_web.

bin/odaslive -c config/odaslive/respeaker_usb_4_mic_array.cfg

 The respeaker_usb_4_mic_array.cfg used here is the hardware corresponding to v2.0. If you open the cfg file, you can see that there are 4 positions for microphones. Although it looks like there are 5 channels, one channel is not the original data of the microphone. You can also change the hardware serial number and the pushed server ip in it. .

If you must use 7-channel v1.0 hardware, you can use respeaker.cfg, but there is no ip in it, so you have to merge two files, which is a bit troublesome.

In short, although it can run in the end, this npm-based odas_web has brought me a lot of problems. It has poor compatibility (does not support Raspberry Pi 4), difficult installation (ubuntu is not installed), and not many functions ( It does not contain algorithms, and it is only direction finding), and it is a waste of performance, so I plan to use python+opencv to make an interface by myself.

Guess you like

Origin blog.csdn.net/shukebeta008/article/details/123303719