StevenHickson / PiAUISuite

Raspberry PI AUI Suite
Other
695 stars 210 forks source link

I couldn't find a hardware device. You don't have a valid microphone #28

Closed Dani3lSun closed 10 years ago

Dani3lSun commented 10 years ago

During the installation process, exactly when asking "Do you want to set up and check the speech recognition options?" I get the error message "I couldn't find a hardware device. You don't have a valid microphone" and the installer closes. I have an USB sound card plugged in (for headphone and microphone), and the hardware seems to work correctly. card number is 0.

List Devices: Command: aplay -l \ Liste der Hardware-Geräte (PLAYBACK) ** Karte 0: Device [USB PnP Sound Device], Gerät 0: USB Audio [USB Audio] Sub-Geräte: 1/1 Sub-Gerät #0: subdevice #0 Karte 1: ALSA [bcm2835 ALSA], Gerät 0: bcm2835 ALSA [bcm2835 ALSA] Sub-Geräte: 8/8 Sub-Gerät #0: subdevice #0 Sub-Gerät #1: subdevice #1 Sub-Gerät #2: subdevice #2 Sub-Gerät #3: subdevice #3 Sub-Gerät #4: subdevice #4 Sub-Gerät #5: subdevice #5 Sub-Gerät #6: subdevice #6 Sub-Gerät #7: subdevice #7 Karte 1: ALSA [bcm2835 ALSA], Gerät 1: bcm2835 ALSA [bcm2835 IEC958/HDMI] Sub-Geräte: 1/1 Sub-Gerät #0: subdevice #0

Command: arecord -l \ Liste der Hardware-Geräte (CAPTURE) ** Karte 0: Device [USB PnP Sound Device], Gerät 0: USB Audio [USB Audio] Sub-Geräte: 1/1 Sub-Gerät #0: subdevice #0

Take a record: Command: arecord -D plughw:0,0 -f cd test.wav Works perfectly.

Play the recorded wav-file: Command: aplay test.wav Works also.

Config Files: /etc/modprobe.d/alsa-base.conf I edited it to options snd-usb-audio index=0

/etc/asound.conf I added this: pcm.!default { type plug slave { pcm "hw:0,0" } } ctl.!default { type hw card 0 }

So I think that my audio input and output configured correctly...What else can be the mistake? Thanks for your help!

StevenHickson commented 10 years ago

In voicecommand.cpp I look for the word "card" and the word "device": fscanf(cmd, "%d:",&card); You don't have that because it's in a different language. So just edit the config file manually. You can do this by running voicecommand -e Then you can add your hardware information manually with a line like this one: !hardware==plughw:0,0

Dani3lSun commented 10 years ago

Thanks, that helped. All is working now.

ghost commented 9 years ago

Hi Steven , I have a little bit the same problem like highlite86. I have pluged in a soundcard too and it still not working.

aplay -l \ Liste der Hardware-Geräte (PLAYBACK) ** Karte 0: ALSA [bcm2835 ALSA], Gerät 0: bcm2835 ALSA [bcm2835 ALSA] Sub-Geräte: 8/8 Sub-Gerät #0: subdevice #0 Sub-Gerät #1: subdevice #1 Sub-Gerät #2: subdevice #2 Sub-Gerät #3: subdevice #3 Sub-Gerät #4: subdevice #4 Sub-Gerät #5: subdevice #5 Sub-Gerät #6: subdevice #6 Sub-Gerät #7: subdevice #7 Karte 0: ALSA [bcm2835 ALSA], Gerät 1: bcm2835 ALSA [bcm2835 IEC958/HDMI] Sub-Geräte: 1/1 Sub-Gerät #0: subdevice #0 Karte 1: Set [C-Media USB Headphone Set], Gerät 0: USB Audio [USB Audio] Sub-Geräte: 1/1 Sub-Gerät #0: subdevice #0 arecord -l \ Liste der Hardware-Geräte (CAPTURE) ** Karte 1: Set [C-Media USB Headphone Set], Gerät 0: USB Audio [USB Audio] Sub-Geräte: 1/1 Sub-Gerät #0: subdevice #0 Take and play a record works fine. I don't edit my config files to 0 because the card is card 1

/etc/modprobe.d/alsa-base.conf

Keep snd-usb-audio from beeing loaded as first soundcard

options snd-usb-audio index=1 /etc/asound.conf cm.!default { type plug slave { pcm "hw:1,0" } } ctl.!default { type hw card 1 } voicommand -e

This is the default config file

These are the special options you can set (remove the #)

!verify==1

!keyword==pi

!thresh==0.7

!continuous==1

!response==Yes Sir?

!quiet==0

!ignore==0

!filler==0

!duration==2

!com_dur==3

!hardware==plughw:1,0

Here are the commands

But it's still not working when i want to test the speech recognition. I hope you can help me.