respeaker / respeaker_python_library

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

Device has no langid ! #22

Closed elpimous closed 7 years ago

elpimous commented 7 years ago

Hello all, I have problems with mic array.

Connected on ubuntu 16 on usb, and interfaced with ros.

When i run a python example program, it says that The device has no langid..

When executed under root, no problem.

But I need to launch ros packages and can t sudo them.

Tested udev rules without success.

Help !

Could I use mic array under python, with an i2c connection ?

Best all. Vincent

xiongyihui commented 7 years ago

How about try the following commands:

echo 'SUBSYSTEM=="usb", MODE="0666"' | sudo tee -a /etc/udev/rules.d/60-usb.rules
sudo udevadm control -R  # then re-plug the usb device
elpimous commented 7 years ago

Hello Yihui Xiong

Thanks for answer.

I did both commands, but no changes !!

here is my terminal out :

python offline_voice_assistant.py

hello Traceback (most recent call last): File "/home/nvidia/catkin_ws/src/utils/src/offline_voice_assistant.py", line 24, in from respeaker import Microphone File "/usr/local/lib/python2.7/dist-packages/respeaker/init.py", line 18, in from microphone import Microphone File "/usr/local/lib/python2.7/dist-packages/respeaker/microphone.py", line 34, in from pixel_ring import pixel_ring File "/usr/local/lib/python2.7/dist-packages/respeaker/pixel_ring.py", line 18, in import usb_hid File "/usr/local/lib/python2.7/dist-packages/respeaker/usb_hid/init.py", line 60, in devices = INTERFACE[usb_backend].getAllConnectedInterface() File "/usr/local/lib/python2.7/dist-packages/respeaker/usb_hid/pyusb_backend.py", line 88, in getAllConnectedInterface product = board.product File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 841, in product self._product = util.get_string(self, self.iProduct) File "/usr/local/lib/python2.7/dist-packages/usb/util.py", line 314, in get_string raise ValueError("The device has no langid") ValueError: The device has no langid

I'm sure you have the solution, Xiogyihui.

Thanks. Vincent

xiongyihui commented 7 years ago

Hello Vincent

Which firmware of the mic array do you use? If it's the origin firmware, it should work. If you change it to 8 channel firmware, you should use https://github.com/respeaker/mic_array/blob/master/pixel_ring.py to the leds. By the way, which function do you want to impelement?

elpimous commented 7 years ago

hello xiongyihui I was on 0x032 version. I just tested factory version 031 Same problem.

*** tested only pixel_ring.py nvidia@tegra-ubuntu:~$ python /home/nvidia/Downloads/python_tests/pixel_ring.py hello Traceback (most recent call last): File "/home/nvidia/Downloads/python_tests/pixel_ring.py", line 18, in import usb_hid File "/home/nvidia/Downloads/python_tests/usb_hid/init.py", line 20, in from respeaker.usb_hid.hidapi_backend import HidApiUSB File "/usr/local/lib/python2.7/dist-packages/respeaker/init.py", line 18, in from microphone import Microphone File "/usr/local/lib/python2.7/dist-packages/respeaker/microphone.py", line 34, in from pixel_ring import pixel_ring File "/usr/local/lib/python2.7/dist-packages/respeaker/pixel_ring.py", line 18, in import usb_hid File "/usr/local/lib/python2.7/dist-packages/respeaker/usb_hid/init.py", line 60, in devices = INTERFACE[usb_backend].getAllConnectedInterface() File "/usr/local/lib/python2.7/dist-packages/respeaker/usb_hid/pyusb_backend.py", line 88, in getAllConnectedInterface product = board.product File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 841, in product self._product = util.get_string(self, self.iProduct) File "/usr/local/lib/python2.7/dist-packages/usb/util.py", line 314, in get_string raise ValueError("The device has no langid") ValueError: The device has no langid

hidapi cant find serial ID ?!

About implementation, I need to use your complete Microphone lib, and save the data to a wav file.

working on Jetson tx2, ubuntu 16.04

Thanks again xiongyihui

elpimous commented 7 years ago

serialnumber of mic array doesn't appear ...

nvidia@tegra-ubuntu:~$ lsusb

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 038: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC Bus 001 Device 037: ID 16d0:06a7 MCS Bus 001 Device 036: ID 2886:0007
Bus 001 Device 031: ID 1a40:0101 Terminus Technology Inc. Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

and on "dmesg" command :

[54348.533764] usb 1-2.2: new full-speed USB device number 8 using xhci-tegra [54348.626064] usb 1-2.2: not running at top speed; connect to a high speed hub [54348.634175] usb 1-2.2: config 1 interface 4 altsetting 0 has 2 endpoint descriptors, different from the interface descriptor's value: 1 [54348.647009] usb 1-2.2: config 1 interface 4 altsetting 0 has 2 endpoint descriptors, different from the interface descriptor's value: 1 [54348.659766] usb 1-2.2: New USB device found, idVendor=2886, idProduct=0007 [54348.666707] usb 1-2.2: New USB device strings: Mfr=1, Product=3, SerialNumber=0 [54348.674103] usb 1-2.2: Product: ReSpeaker Microphone Array [54348.679649] usb 1-2.2: Manufacturer: SeeedStudio [54350.627941] hid-generic 0003:2886:0007.0002: hidraw0: USB HID v1.10 Device [SeeedStudio ReSpeaker Microphone Array] on usb-3530000.xhci-2.2/input4

elpimous commented 7 years ago

Hi all, xiongyihui, Found solution !!! Happy

cd /etc/udev/rules.d/ sudo gedit 99-usbusers.rules

if doesn' exist, add : SUBSYSTEMS=="usb", ENV{DEVTYPE}=="usb_device, "GROUP="usbusers", MODE="0660"

sudo addgroup usbusers sudo usermod -a -G usbusers nvidia #nvidia is my login reboot.

Now, I can use your wonderfull product under python, without sudo !

Hope it will help each other... Vincent