PS3 eye USB mic Setup on Raspberry Pi 4 + Docker

Hi, has anyone gotten a PS3 Eye to work with Pi4 + Docker? I cannot seem to manage to set it up. Should this just work out of the box or do I need to edit .asoundrc or something inside the Docker container? Thanks :slight_smile:

1 Like

Hi @Sam
Have the same setup but with 3b+
By default ps3eye mic is a bit low, so yes, I’ve changed asoundrc to increase its volume

But it works out of the box
Try to run arecord command to check it

Thanks, arecord helped:

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

I disabled the onboard audio in
/boot/config.txt

dtparam=audio=off

Now everything works fine.

Did you do anything special in mixing the four mics? This post talks about it:

1 Like

Yes, I’ve changed my asoud.conf
You can try the one from your post, but I’m using this one… found it a bit better. Maybe placebo effect though :grin:

pcm.jack {
  type hw
  card ALSA
}
pcm.array {
  type hw
  card CameraB409241
}
pcm.softvol {
  type softvol
  slave.pcm "jack"
  control {
    name Master
    card 0
  }
}
pcm.cap {
  type plug
  slave.pcm "array"
  slave.channels 4
  ttable {
    0.0 15.0
    1.1 15.0
  }
}
pcm.!default {
    type asym
    playback.pcm "plug:softvol"
    capture.pcm {
      type plug
      slave.pcm "cap"
    }
}

Also note that changing asound.con on a host system doesn’t affect docker. So you need to change it there too

In this article they compare it with respeaker and provide a configuration for RPI

Thanks for sharing your configs! :slight_smile:

Could you please explain how to do that? I’m absolutely new to docker :slight_smile:

I switched from HassOs -> Hassio to Raspbian -> Docker - Hassios - Rhasspy still installed as Hassio addon.

Now do i shell into the Rhasspy container and edit the asound.conf - or do i copy the host asound over there?

Thanks :slight_smile:

edit: I found your old Thread - testing now :slight_smile:

you found a way to automate this by now ? =)

Hi @Sikk
Yes, my post is what I have now… unfortunately, i haven’t yet work on it properly
So I’m editing Dockerfile in rhasspy addon folder adding COPY command there, and rebuild addon
So I can reboot it at least
If you are interested in it, I will provide detailed instructions :nerd_face:

Hey @frkos

I would really appreciate that :slight_smile:

Right now i’m really happy with my asound.conf - snowboy seems to detect every wakeword now - without me running through the room and screaming “jarvis” like a maniac :smiley:

To keep all things together I’ve added instructions here

Hope you will find it useful

1 Like

Hello!
I am trying to get PS3 Eye to get to work.
I am running x86-64 Open Media Vault and installed Rhasspy via docker.
The USB CAM is detected correctly, but when I click in test microphone, nothing happens.
It doesn’t say working! as in the tutorials.
No error and no working.

Is this hardware supported? Because I read that is supported by reading the documentation, but I read posts that it isn’t supported. Can someone help me out?

Should I use PyAudio as it is recommended, or because it is a PC should be arecord?

Thank you, I cannot pass this basic hurdle.

EDIT: I cannot access the console in portainer, that should help me out in basic troubleshooting.
I bought the PS3 eye used, so I also would like to test the microphone, it could not be working. The video is working because I tested it in VLC.
Ideas to test the audio? Like recording and playing the wav file also?

Thank you again.

Your running in a container that is contained and you have to declare what hardware your container should have.
Its prob not Rhasspy or Docker just how you have setup docker and rhasspy.

Sharing your snd hardware via --device /dev/snd:/dev/snd \ is usually needed but its going to be a struggle without access to the console though but give that a go, but sort of blind that way.

Hello,

Thank you for your feedback and thank you for the subject you highlighted.

I have some experience in this matter (docker/containers…)

In Openmediavault host, running lsusb:

hp_admin@hpg1miniomv:~$ lsusb
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 011: ID 1415:2000 Nam Tai E&E Products Ltd. or OmniVision Technologies, Inc. Sony Playstation Eye

So it is detected

Docker compose of rhasspy:

version: ‘2’
services:
rhasspy:
image: “rhasspy/rhasspy”
container_name: rhasspy
restart: unless-stopped
volumes:
- “/dev/…:/profiles” #hidden complete directory only
- “/etc/localtime:/etc/localtime:ro”
ports:
- “12101:12101”
devices:
- /dev/snd:/dev/snd
command: --user-profiles /profiles --profile en

In recording section of Rhasspy web UI:

USB Camera-B4.09.24.1: Audio (hw:0,0) (0)

So the camera is detected.

I also have a USB sound card mapped to OTHER container, streaming sound with logitech media server without any problem

LMS docker compose:

devices:
  - /dev/snd:/dev/snd  

So I would say the question of docker and container shouldn’t be a problem.
Can someone provide a next step to debug this?

EDIT: Is there a way oh enabling the console in the rhasspy docker container? To help debugging?

Usually with a running container docker exec –it nginx-test /bin/bash as this example for nginx-test container and you sort of ‘ssh’ into the container usually as Root.
Likely there will be no /etc/asound.conf in the container also, but have no exp with portainer.

I tried your command without success
But thanks to your suggestion I got to know that it would be possible

so using google I found out this website

In the section Running an Interactive Shell in a Docker Container

I found this

docker exec -it container-name sh

which I adapted to

docker exec -it rhasspy sh

and now I have a “SSH like” access :slight_smile:
Thank you for your idea/guidance, that I didn’t now

I can confirm I don’t have that file:
'# pwd
/etc
'# ls asound*
ls: cannot access ‘asound*’: No such file or directory

Should I create one?

In the meantime, I plugged it diretly to USB port of the PC without hub (I read somewhere this could create problems) and booting into Ubunto and using cheese I can see image of the camera.

In rhasspy usuing the test micrphones I get either timeout or nothing, no error.

Any more ideas?

Now you have console access ‘aplay -l’ ‘arecord -l’ have a look at what the containers ALSA thinks it has and share an external file as /etc/asound.conf if you need to set defaults or share a sound card if used on host or other instances

As I told before, I have a USB dongle with micrphone input and headphones output and the PS3 Eye Toy plugged in.

Both are connected to OMV (the host OS).
Just to explain the output below.

'# pwd
/
'# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0

This is the dongle I mentioned before.

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

So it detects two microphones, the USB dongle aswell the camera.
Other thing worth mentioning, when I plug the PS3 toy it appears the following file

/dev/video0

That disappears as soon as I unplug the USB.
It is video related, unrelated with the audio problem I am trying to solve, but another proof that the host OS is detecting the hardware.

Returning to you, what do you mean by this

(…) and share an external file as /etc/asound.conf if you need to set defaults or share a sound card if used on host or other instances

I don’t have this file at this location atm

'# pwd
/etc
'# ls asound*
ls: cannot access ‘asound*’: No such file or directory

Can you please explain what you were saying for me to do?
Thank you!

I was expecting there wouldn’t be. With containers being ephemeral you can share a host file and mount in the container at /etc/asound.conf.
https://www.alsa-project.org/wiki/Asoundrc

You mean creating this file in the host and binding it to the container right?

You think this is the only thing the container misses to work???

I wouldn’t say it doesn’t work, but how you have your setup it is not working.
If you want to configure ALSA or your PS3eye then you will need a asound.conf.

Alsa is single use and blocking unless you setup dmix & dsnoop pcms via IPC.

One of your other containers could be blocking it, but now you have console access why not aplay test.wav of an example wav you can download into the container or share as a file to test.

The added complexity of multiple containers and that alsa is blocking and non shareable unless defined in a asound.conf, its your setup.
So dunno as the PS3eye was always a pet hate of mine as the device Dev openly admits its a bad hack at reverse engineering it, that in use apps often just use the 1st mic avail.
The driver and the beamforming are algs in the PS3 not the PS3eye.

What you can do is sum all the mics in a asound.conf similar to asound-config-ps3EyeCamera/asound.conf at master · straris/asound-config-ps3EyeCamera · GitHub as that is a basic delay-sum beamformer and it will just be, static look ahead.

PS slightly tangental but I have the Anker C300 webcam and the NS doesn’t seem to effect Whisper and its dual mic with the algs built in (dunno what is inside)
The PS3eye is bargain bin cheap nowadays and maybe should stay there, Anker do a PowerConf C200 which isn’t bargain bin cheap, but on Amazon and elsewhere for £59.99 which if the Mics work as good as the C300 (Much better than the orig Powerconf speakerphone) its actually good value.