billw2 / pikrellcam

Raspberry Pi motion vector detection program with OSD web interface.
GNU General Public License v3.0
262 stars 70 forks source link

Sound on Pikrellcam #71

Open bristolavon opened 3 years ago

bristolavon commented 3 years ago

Having used Pikrellcam for a couple of years now, I decided that it was time to start adding sound. (I use it for photographing birds). I have a USB microphone which works fine on a Raspberry Pi 3 Model B v1.2, but when I try to use it with Pikrellcam I get this error:

Audio error - cannot open microphone. pcm open failed: No such file or directory

This happens when I press the microphone icon to turn on the microphone.

I'm using Raspbian Linux 10 (buster)

kajan001 commented 2 years ago

You have to change the device number in pikrellcam.conf ( /home/pi/.pikrellcam/pikrellcam.conf )

In short:

  1. use lsusb to check that you pi has recognized the microphone
  2. use arecord -l to give you the number for the card and device number
  3. open pikrellcam.conf and find audio_device plughw:1 around line 526. Make sure the device number above corresponds to the audio device number in pikrellcam ( or it maybe the card number, I never remember which and have to to a few trial and errors before getting it right).
  4. Stop and start Pikrellcam, or reboot, then click the mic button

Sometimes the Pi will change the card and device number on startup and so always check the mic function on startup.

This article gives some good guidance on attaching a usb card to the pi: https://iotbytes.wordpress.com/connect-configure-and-test-usb-microphone-and-speaker-with-raspberry-pi/