sbrodeur / ros-icreate-bbb

ROS (Robotic Operating System) packages for the iRobot Create with onboard BeagleBone Black
BSD 3-Clause "New" or "Revised" License
3 stars 2 forks source link

Audio is not necessarily mapped to the right camera microphone #30

Closed sbrodeur closed 7 years ago

sbrodeur commented 7 years ago

It seems that the audio capture node it not guaranteed to select the proper (left or right) microphone from the camera. We should make sure that the mapping is static, like for the video capture. See: http://www.alsa-project.org/main/index.php/Asoundrc

sbrodeur commented 7 years ago

Solve by creating a udev rule (/etc/udev/rules.d/85-usb-audio.rules):

SUBSYSTEM!="sound", GOTO="usb_audio_webcam"
ACTION!="add", GOTO="usb_audio_webcam"

DEVPATH=="/devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb1/1-1/1-1.1/1-1.1:1.2/sound/card?", ATTR{id}="webcam_right"
DEVPATH=="/devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb1/1-1/1-1.2/1-1.2:1.2/sound/card?", ATTR{id}="webcam_left"

LABEL="usb_audio_webcam"

This rule is based on the connection ports (on the attached USB hub) of the left and right cameras. They are remapped to device names "front:CARD=webcam_left,DEV=0" and "front:CARD=webcam_right,DEV=0", which can be used for audio capture. See commit ca1788c for changes in the roslaunch scripts.

For reference: http://alsa.opensrc.org/Udev