PS3 eye USB mic Setup on Raspberry Pi 4 + Docker

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.

So, what I have done, following your steps:

Downloaded the file you mentioned, directly, to avoid copy pasting problems.

Before doing any changes as you suggested, I entered the container, doing in the guest host:

docker exec -it rhasspy sh

and then

'# aplay test.wav
ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave
aplay: main:828: audio open error: No such file or directory

So two errors, the first recgarind the audio hardware problem, the send because I don’t have a test.wav file

OK, then exiting the container sh, returining to the guest host

$ pwd
/<…>/portainer/Files/AppData/Config/Rhasspy/files

Changed the owner to the user with docker permission, in my case it is docker_user

sudo chown docker_user asound.conf

Checked if the contents were OK

nano asound.conf

And it has the contents of the whole file as expected.

Create a new entry in my docker compose file, as you said:

– “/<…>/portainer/Files/AppData/Config/Rhasspy/files/asound.conf:/etc/asound.conf”

Launched the container, OK no errors.
Entering the sh of the container again

docker exec -it rhasspy sh
'# aplay text.wav
aplay: main:828: audio open error: No such file or directory

Now it only has the error regarding to no file found.
It doesn’t complaint about the hardware.

It seems I am getting somehere :smiley:

In the rhasspy UI, in PyAudio, I have more options now:
array, arraygain and cap

If I press test, still non gives me WORKING state

I was saying changing to arecord does the same, before writing this, but now it says WORKING

Default Audio Device (sysdefault:CARD=CameraB409241)

So it seems you helped me doing something right!!! Thank you!

As I am lost now, what would be the next steps to ensure this is working?
Using arecord?
What next?

Thank you very much for your help, your directions are straight to the point.
Hope my “documentation” also helps someone.

PS: I bought PS3 Eye for 1 euro at a used hardware store, hence using it :smiley:

Dunno process of elimination.
Start with a bare-metal image and test it is working, just to make sure.

Also on reboots its not guaranteed you always get the same order.
aplay -l aplay -D and specify device.

Things to check is if anything else can be accessing that device as unless you set-up the IPC and dmix/dsnoop pcms its single use blocking accross all your containers.

If you have a spare pi or sd-card just do a fresh install and check the ps3eye bare metal with the asound.conf you have.

The ladspa vlevel control is quite good for AGC if you get it going GitHub - radiocicletta/vlevel: Automatic Gain Control for JACK, LADSPA, Winamp, and many more— github port from sourceforge

Hello

Firstly, confirm that the PS3 Eye camera is compatible with the Raspberry Pi. Once verified, install the necessary driver (gspca_ov534) on your Raspberry Pi using the following commands:

sudo apt-get update

sudo apt-get install v4l-utils

sudo modprobe gspca_ov534

After installing the driver, test the camera’s functionality outside Docker using a tool like cheese:

sudo apt-get install cheese

cheese

Next, configure Docker to access the camera device. Use the --device flag when running your Docker container to grant access to /dev/video0, where the camera is typically located:

docker run -it --device=/dev/video0 your-image-name

If your application within Docker requires audio input from the PS3 Eye (some models include microphones), adjust the ALSA configuration (~/.asoundrc or /etc/asound.conf) to ensure the correct audio device is selected.

Consult community resources and forums specific to using PS3 Eye cameras with Raspberry Pi and Docker. https://forums.raspberrypi.com/viewtopic.php?t=127135

Thank you :slightly_smiling_face:
boblewis