Aeyesi
Posts: 8
Joined: Sun Jan 15, 2017 5:46 pm

RPi + PS3Eye getting Sound-microphone

Sun Jan 15, 2017 5:58 pm

Hello there,
First time on forums,
Having some extra time allowed me to dig more in this,
I have RPi1B with PS3 Eye making timelapse's behind a window,

...and I've realized that the camera was given with 4 microphone's i could make use of !
And I've ran into fight with complex linux audio battle...Goal is simple... to record any audio from it.

So I tried to record with "arecord" 5 secs... but.... it never ended and process was frozen or IDLE... CTRL + C...
After a check i noticed it made a unfilled dummy audio file... Obviously the microphone has to be configured somehow.
After selecting it in alsamixer i've seen this crash first time ever.

I know there are .asoundrc (?) and other bunch of config files hidden all over the linux's root/
Before any google suggestions, i gotta say i tried *all* of them without success :/, writing this as some sort of last chance...

So if anyone have at least tips or right suggestions of what should be done I've would be thankfull for sharing them ^.^ All i know is that the PS3 Eye's mic's are recognizes via "lsusb". I can print anything if needed.
- Sorry for ducky english, its not my native lang. :?

kaipederson
Posts: 1
Joined: Sun Jan 22, 2017 8:00 pm

Re: RPi + PS3Eye getting Sound-microphone

Sun Jan 22, 2017 8:02 pm

Would be very interested in hearing if this gets figured out. Been trying to get the PS Eye mic to work with my Alexa build on a RPi 1B.

gefangenimnetz
Posts: 4
Joined: Mon Mar 31, 2014 11:29 pm

Re: RPi + PS3Eye getting Sound-microphone

Thu Jan 26, 2017 4:02 pm

Same is true for me. I am also trying to use the PS3 Eye’s great microphone. Using the camera is ridiculously easy, as it just works without the need to configure anything.

The microphone part of the device is being recognized

Code: Select all

cat /proc/asound/cards
AND
arecord -l

both show
0 ***
1 [CameraB404271 ]: USB-Audio - USB Camera-B4.04.27.1

I’d really appreciate if anyone could help me to get this running, as the microphone is perfectly suited for Alexa like devices.
Thank you very much.
However alsamixer does not allow me to switch (F6) the device to the PS3 Eye. It quits with

Code: Select all

cannot load mixer controls. Invalid argument

Aeyesi
Posts: 8
Joined: Sun Jan 15, 2017 5:46 pm

Re: RPi + PS3Eye getting Sound-microphone

Fri Feb 17, 2017 4:31 pm

No, no progress so far. The only thing i figured out is that the PS3 Eyecam needs 500 mA

Hearmewhisper
Posts: 1
Joined: Fri Apr 07, 2017 9:01 pm

Re: RPi + PS3Eye getting Sound-microphone

Fri Apr 07, 2017 9:12 pm

I've been having this issue for awhile now. Tried following a lifehacker.com tutorial for making an Alexa pi. No luck

User avatar
jbeale
Posts: 3518
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: RPi + PS3Eye getting Sound-microphone

Fri Apr 07, 2017 9:52 pm

Seems odd. Haven't used it in a while, but at one time I was recording audio with PS3 Eye cam on a RPi and don't remember having to do much for it to just work, with either arecord or ffmpeg. I was just using those from the command line, not with any GUI controls.
That was about a year ago, as I wrote here: viewtopic.php?t=153520&p=1006200

Does arecord work by itself, is it just the alsamixer that won't work? Does this work (assuming 'lame' installed) ?

Code: Select all

arecord -f S16_LE -c2 -r8000 -t raw -D plughw:1,0 -d 10 | lame -r -s 8 -b 64 - ten_second_sound.mp3
Around that time I did compile ffmpeg from source on my own, I wonder if that installed something that isn't there by default.
Or maybe something has changed in the current Raspbian distribution that broke something?

User avatar
jbeale
Posts: 3518
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: RPi + PS3Eye getting Sound-microphone

Mon Apr 24, 2017 2:23 pm

I can confirm that simply plugging in a PS3 eye to my RPi works as expected for sound recording. The only thing I needed to do was make sure user 'pi' was added to the 'audio' group:

Code: Select all

sudo usermod -a -G audio pi

Code: Select all

[  494.796893] usb 1-1.3.2: USB disconnect, device number 8
[  497.597702] usb 1-1.3.2: new high-speed USB device number 9 using dwc_otg
[  497.700862] usb 1-1.3.2: New USB device found, idVendor=1415, idProduct=2000
[  497.700903] usb 1-1.3.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  497.700924] usb 1-1.3.2: Product: USB Camera-B4.09.24.1
[  497.700945] usb 1-1.3.2: Manufacturer: OmniVision Technologies, Inc.
[  497.717936] gspca_main: ov534-2.14.0 probing 1415:2000
[  499.713549] usb 1-1.3.2: current rate 17380 is different from the runtime rate 16000
[  499.717152] usb 1-1.3.2: 3:1: cannot get min/max values for control 2 (id 3)

[email protected]:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: CameraB409241 [USB Camera-B4.09.24.1], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

[email protected]:~ $ arecord  -D plughw:1 -d 5  test.wav
Recording WAVE 'test.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono

[email protected]:~ $ ll test.wav
-rw-r--r-- 1 pi pi 40044 Apr 24 07:19 test.wav

[email protected]:~ $ uname -a
Linux rp4 4.4.13+ #894 Mon Jun 13 12:43:26 BST 2016 armv6l GNU/Linux

User avatar
jbeale
Posts: 3518
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: RPi + PS3Eye getting Sound-microphone

Wed Apr 26, 2017 2:40 am

Aha. I reinstalled the current version of Raspbian Lite, and tried this again. Now 'arecord' pretends to work but it simply hangs, only 44 bytes are written (a header, I assume) and no audio is recorded. This is the exact same hardware and board that worked with the older OS from a year ago. So something got broken- no idea what.

Code: Select all

[email protected]:~ $ date
Wed 26 Apr 02:37:52 UTC 2017
[email protected]:~ $ arecord  -D plughw:1 -d 5  test.wav
Recording WAVE 'test.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
^CAborted by signal Interrupt...
arecord: pcm_read:2031: read error: Interrupted system call
[email protected]:~ $ date
Wed 26 Apr 02:38:20 UTC 2017
[email protected]:~ $ ls -al
total 28
drwxr-xr-x 2 pi   pi   4096 Apr 26 02:37 .
drwxr-xr-x 3 root root 4096 Apr 10 09:17 ..
-rw------- 1 pi   pi     30 Apr 26 02:12 .bash_history
-rw-r--r-- 1 pi   pi    220 Apr 10 09:17 .bash_logout
-rw-r--r-- 1 pi   pi   3512 Apr 10 09:17 .bashrc
-rw-r--r-- 1 pi   pi    675 Apr 10 09:17 .profile
-rw-r--r-- 1 pi   pi     44 Apr 26 02:37 test.wav
[email protected]:~ $ uname -a
Linux raspberrypi 4.4.50+ #970 Mon Feb 20 19:12:50 GMT 2017 armv6l GNU/Linux

User avatar
jbeale
Posts: 3518
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: RPi + PS3Eye getting Sound-microphone

Wed Apr 26, 2017 5:34 am

Confirmed. I downloaded yet another image, this one from 2016:
http://downloads.raspberrypi.org/raspbi ... jessie.zip

and tried it again. Now arecord works once more, with no problem. uname -a reports 4.4.21+ #911 Thu Sep 15 14:17:52 St 2016
so some change in the kernel or in Raspbian after that seems to have killed this particular USB audio device.

User avatar
Gavinmc42
Posts: 4057
Joined: Wed Aug 28, 2013 3:31 am

Re: RPi + PS3Eye getting Sound-microphone

Wed Apr 26, 2017 6:50 am

Broken in Raspbian or Debian?.
Got a bunch of these cams, not that I was doing anything with sound yet.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
jbeale
Posts: 3518
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: RPi + PS3Eye getting Sound-microphone

Wed Apr 26, 2017 5:03 pm

Not experienced with USB debugging; I don't know how to troubleshoot when there's no error message. I have only tested under Raspbian on RPi. All I know is that it worked back in 2016, both on versions 4.4.13 and 4.4.21 but it fails now on 4.4.50. I guess I could try the device on a current Intel-based Ubuntu system and see if that works.

UPDATE: I tried the PS3 Eye on a current Intel-based Ubuntu system. I'm not too familiar with linux audio in general. Using Audacity I was able to see audio from the built-in system soundcard but NOT from the PS3 eye, even though it does show up as a device there, and also in the arecord -l list:

Code: Select all

Linux john-desktop 4.8.0-49-generic #52~16.04.1-Ubuntu SMP Thu Apr 20 10:55:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

**** List of CAPTURE Hardware Devices ****
card 1: PCH [HDA Intel PCH], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: U0x46d0x825 [USB Device 0x46d:0x825], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: U0x14150x2000 [USB Device 0x1415:0x2000], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
Update: I tried with my Intel-based Ubuntu system using kernel 4.4.0 and Audacity worked OK, I could record all 4 channels from the PS3 Eye's quadrophonic mic. Using kernel 4.8.0 it was not able to record from the PS3 Eye at all (although the built-in soundcard still worked OK).

User avatar
jbeale
Posts: 3518
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: RPi + PS3Eye getting Sound-microphone

Thu Apr 27, 2017 9:36 pm

There are (at least) two levels of failure here. First, "alsamixer" apparently does not support the (unique?) 4-channel microphone in the Sony PS3 Eye device. That is why "alsamixer" returns "cannot load mixer controls: Invalid argument" when attempting to use this device. However pulseaudio and Audacity can work with it. If you do sudo apt install pavucontrol and then pavucontrol (using Kernel 4.4.21 or lower) in the "Configuration" tab you will see "Sony Playstation Eye" is set to "Multichannel Input".
See also: https://raspberrypi.stackexchange.com/q ... d-argument

The second failure is that some change between linux kernel 4.4.21 and 4.4.50 prevents the PS3 audio driver from tranferring any audio at all. The only workaround I know for this is to use an older Raspbian, for example 2016-09-23-raspbian-jessie.zip from
http://downloads.raspberrypi.org/raspbi ... 016-09-28/ which I have confirmed does work with PS3 Eye. That one is using kernel 4.4.21

I have separately confirmed on an Intel Ubuntu 16.04 system that kernel 4.4.0 works with PS3 Eye. My initial try at Intel-based Ubuntu with kernel 4.8.0 did not work, however after changing an alsa config file, Audacity did work with PS3 Eye. See also: viewtopic.php?f=28&t=181578#p1154216

4-channel microphones are unusual, so I wonder if this is a factor.

User avatar
jbeale
Posts: 3518
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

PS3 Eye works again!

Fri Apr 28, 2017 8:12 pm

Happy to report that if you do sudo apt-get update && sudo apt-get upgrade as of today on your RPi running Raspbian 8.0 (jessie), and then reboot you will get kernel 4.9.24-v7+ #993 SMP Wed Apr 26 18:01:23 BST 2017 and this DOES WORK with the PS3 Eye audio, both with Audacity and a simple command line like arecord -D plughw:1 -d 5 test.wav

alsamixer is unchanged and still fails when selecting the PS3 Eye device with "cannot load mixer controls: Invalid argument" presumably due to incapacity to deal with 4 input channels. However this doesn't stop you from recording with it.

Aeyesi
Posts: 8
Joined: Sun Jan 15, 2017 5:46 pm

Re: RPi + PS3Eye getting Sound-microphone

Fri May 05, 2017 10:01 pm

Hey there,
I don't know what you did but THANK YOU.
Just the quality is a bit of garbage, but that's what I gotta figure out.
It works! hell yeah!

User avatar
jbeale
Posts: 3518
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: RPi + PS3Eye getting Sound-microphone

Fri May 05, 2017 10:31 pm

I don't know what fix was done either, but apparently the new kernel has it. FWIW, I have a few PS3 Eye devices, and in my case I found the audio quality has been good, for my purposes of general ambient recording; I do not hear significant self-noise or distortion. As good as some much more expensive mics.

gtoal
Posts: 111
Joined: Sun Nov 18, 2012 12:02 am

Re: PS3 Eye works again!

Tue Jun 20, 2017 3:46 pm

jbeale wrote:Happy to report that if you do sudo apt-get update && sudo apt-get upgrade as of today on your RPi running Raspbian 8.0 (jessie), and then reboot you will get kernel 4.9.24-v7+ #993 SMP Wed Apr 26 18:01:23 BST 2017 and this DOES WORK with the PS3 Eye audio, both with Audacity and a simple command line like arecord -D plughw:1 -d 5 test.wav
I went down a bit of a rabbit hole following this advice last weekend. I'm sure that upgrading to that kernel version does fix the problem, but there is more to it that still hasn't been discovered yet.

I have 21 pi's online at home and to investigate this, I attached PS3 Eye's to quite a few of them. Of the 11 machines with Eyes, 7 of them recorded successfully.

GOOD:

quartus Linux version 4.4.11+ ([email protected]) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #888 Mon May 23 20:02:58 BST 2016
hamish Linux version 4.4.13-v7+ ([email protected]) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #894 SMP Mon Jun 13 13:13:27 BST 2016
septimus Linux version 4.4.11+ ([email protected]) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #888 Mon May 23 20:02:58 BST 2016
zap Linux version 4.4.11-v7+ ([email protected]) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #888 SMP Mon May 23 20:10:33 BST 2016
touchscreen Linux version 4.4.21-v7+ ([email protected]) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #911 SMP Thu Sep 15 14:22:38 BST 2016
bedside Linux version 4.4.11+ ([email protected]) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #888 Mon May 23 20:02:58 BST 2016
dewey Linux version 4.9.24-v7+ ([email protected]) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #993 SMP Wed Apr 26 18:01:23 BST 2017


BAD:

secundus Linux version 4.1.13+ ([email protected]) (gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03) ) #826 PREEMPT Fri Nov 13 20:13:22 GMT 2015
tertius Linux version 4.4.11+ ([email protected]) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #888 Mon May 23 20:02:58 BST 2016
sextus Linux version 4.1.13+ ([email protected]) (gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03) ) #826 PREEMPT Fri Nov 13 20:13:22 GMT 2015
decimus Linux version 4.1.13+ ([email protected]) (gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03) ) #826 PREEMPT Fri Nov 13 20:13:22 GMT 2015


On first glance it would look like all 2016 or later versions work and all 2015 versions don't - but there's one exception...

machines 'tertius' and 'quartus' both have the same kernel, but quartus records OK and tertius does not. Interesting...

Here's the difference between the machines:

[email protected]:~ $ src/raspberry_pi_revision-master/test
memory: 256 MB
processor: Broadcom BCM2835
i2cDevice: /dev/i2c-0
model: Model B
manufacturer: unknown
pcb revision: 1
warranty void: no
revision: 0002
peripheral base: 0x20000000

checking peripheral base against bcm_host library
... peripheral base matches base from bcm_host


[email protected]:~ $ src/raspberry_pi_revision-master/test
memory: 256 MB
processor: Broadcom BCM2835
i2cDevice: /dev/i2c-1
model: Model A
manufacturer: Sony
pcb revision: 2
warranty void: no
revision: 0008
peripheral base: 0x20000000

checking peripheral base against bcm_host library
... peripheral base matches base from bcm_host


Graham

Sean_Creatif
Posts: 5
Joined: Mon Jul 01, 2019 7:26 pm

Re: RPi + PS3Eye getting Sound-microphone

Tue Jul 16, 2019 8:35 pm

jbeale wrote:
Wed Apr 26, 2017 5:34 am
Confirmed. I downloaded yet another image, this one from 2016:
http://downloads.raspberrypi.org/raspbi ... jessie.zip

and tried it again. Now arecord works once more, with no problem. uname -a reports 4.4.21+ #911 Thu Sep 15 14:17:52 St 2016
so some change in the kernel or in Raspbian after that seems to have killed this particular USB audio device.
Will using this version of Raspbian solve the issue? Also can you provide your asoundrc file so I properly set it up? I'm using this as a speaker and recording for snowboy.

User avatar
jbeale
Posts: 3518
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: RPi + PS3Eye getting Sound-microphone

Tue Dec 03, 2019 6:51 pm

Note to self: the below "arecord" command works with PS3 Eye device on a recent version of Raspbian, on Pi 3B.
This records 4 channel audio at 48kHz, 16 bits. I verified that all 4 channels work as expected, and the time of arrival of a sharp noise is delayed on the more distant mics by ( distance / speed of sound ) as expected. How many 4-channel USB mics cost less than $10, and can even record video as well?

Code: Select all

$ uname -a
Linux rp49 4.19.57-v7+ #1244 SMP Thu Jul 4 18:45:25 BST 2019 armv7l GNU/Linux
$ lsusb
Bus 001 Device 004: ID 1415:2000 Nam Tai E&E Products Ltd. or OmniVision Technologies, Inc. Sony Playstation Eye
$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: CameraB409241 [USB Camera-B4.09.24.1], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

$ arecord  -D plughw:1 -d 5 -c 4 -r 48000 -f S16_LE t4.wav
Recording WAVE 't4.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Channels 4

$ ls -l
-rw-r--r-- 1 pi pi 1920044 Dec  3 10:37 t4.wav

$ sox t4.wav -n stats
             Overall     Ch1       Ch2       Ch3       Ch4  
DC offset  -0.000086 -0.000051 -0.000075 -0.000017 -0.000086
Min level  -1.000000 -1.000000 -1.000000 -1.000000 -1.000000
Max level   0.999969  0.999969  0.999969  0.999969  0.999969
Pk lev dB       0.00      0.00      0.00      0.00      0.00
RMS lev dB    -18.78    -19.27    -18.78    -19.15    -18.04
RMS Pk dB      -2.65     -3.86     -3.33     -3.74     -2.65
RMS Tr dB     -62.80    -62.12    -61.83    -62.80    -61.75
Crest factor       -      9.20      8.69      9.07      7.98
Flat factor    10.63      9.09     11.11     11.67     10.41
Pk count         664       591       672       612       783
Bit-depth      16/16     16/16     16/16     16/16     16/16
Num samples     240k
Length s       5.000
Scale max   1.000000
Window s       0.050

User avatar
Gavinmc42
Posts: 4057
Joined: Wed Aug 28, 2013 3:31 am

Re: RPi + PS3Eye getting Sound-microphone

Wed Dec 04, 2019 1:00 am

Thanks John,
I had to use a different USB microphone for audio on Pi1B+'s.
Had not tested Pi3's and above with Eyecams.
You tried Pi4 with an Eyecam yet?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
jbeale
Posts: 3518
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: RPi + PS3Eye getting Sound-microphone

Fri Dec 06, 2019 9:36 pm

I just got a Pi4. I can confirm the same commands as in my last post work the same way with the PS3-Eye camera sound input on the Pi4, as they did on the Pi3B.

Code: Select all

[email protected]:~ $ uname -a
Linux rp40 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/Linux

[email protected]:~ $ cat /sys/firmware/devicetree/base/model;echo
Raspberry Pi 4 Model B Rev 1.1

[email protected]:~ $ arecord  -D plughw:1 -d 5 -c 4 -r 48000 -f S16_LE t4.wav
Recording WAVE 't4.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Channels 4

[email protected]:~ $ ls -al *.wav
-rw-r--r-- 1 pi pi 1920044 Dec  6 13:34 t4.wav

[email protected]:~ $ sox t4.wav -n stats
             Overall     Ch1       Ch2       Ch3       Ch4  
DC offset   0.000023  0.000020  0.000009  0.000023  0.000004
Min level  -1.000000 -1.000000 -1.000000 -1.000000 -1.000000
Max level   0.999969  0.999969  0.999969  0.999969  0.999969
Pk lev dB       0.00      0.00      0.00      0.00      0.00
RMS lev dB    -26.84    -26.44    -26.08    -27.22    -27.82
RMS Pk dB      -9.68     -9.99     -9.68    -10.67    -11.16
RMS Tr dB     -60.64    -58.48    -57.76    -60.64    -59.32
Crest factor       -     20.99     20.14     22.97     24.61
Flat factor     8.62      9.71      7.69      7.65      9.12
Pk count        54.8        67        59        51        42
Bit-depth      16/16     16/16     16/16     16/16     16/16
Num samples     240k
Length s       5.000
Scale max   1.000000
Window s       0.050

User avatar
Gavinmc42
Posts: 4057
Joined: Wed Aug 28, 2013 3:31 am

Re: RPi + PS3Eye getting Sound-microphone

Sat Dec 07, 2019 10:46 am

Thanks John,
Time to find my box of spare Eyecams ;)
Been installing python opencv stuff, the PI4 should be fast enough to be useful.
Have not tried any sound level detection with the Eyecam since Pi2 days.
Pyaudio?

Ubuntu server + Desktop is working now on Pi4, for those that want to try and test on that.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Return to “HATs and other add-ons”