sound_play not working with robot_upstart

asked 2016-11-22 13:46:00 -0600

updated 2016-11-22 13:46:15 -0600

I have been using sound_play happily for some time now and it has been working wonderfully. But recently I just switched to using robot_upstart to launch my code. I had to add udev rules for various hardware in order to make it work. However my speaker is the only thing still giving me trouble. I get the following error:

No handlers could be found for logger "roslaunch"FATAL: cannot locate cpu MHz in /proc/cpuinfo

No handlers could be found for logger "roslaunch" [soundplay_node-3] process has died [pid 1300, exit code 1, cmd /opt/ros/indigo/lib/sound_play/soundplay_node.py __name:=soundplay_node __log:=/tmp/6713e882-b0ea-11e6-af2b-1711043209a9/soundplay_node-3.log]. log file: /tmp/6713e882-b0ea-11e6-af2b-1711043209a9/soundplay_node-3*.log

[WARN] [WallTime: 1479843193.510036] Sound command issued, but no node is subscribed to the topic. Perhaps you forgot to run soundplay_node.py?

I found the hardware associated with my speaker by running this bash script:

#!/bin/bash

for sysdevpath in $(find /sys/bus/usb/devices/usb*/ -name dev); do
    (
        syspath="${sysdevpath%/dev}"
        devname="$(udevadm info -q name -p $syspath)"
        [[ "$devname" == "bus/"* ]] && continue
        eval "$(udevadm info -q property --export -p $syspath)"
        [[ -z "$ID_SERIAL" ]] && continue
        echo "/dev/$devname - $ID_SERIAL"
    )
done

Which told me the following files were associated with my speaker:

/dev/sda - JIE_LI_CD002-1_CD002-0:0
/dev/snd/controlC1 - CD002_CD002_CD002
/dev/snd/pcmC1D0p - CD002_CD002_CD002
/dev/input/event9 - CD002_CD002_CD002
/dev/hidraw5 - CD002_CD002_CD002

I added the to a udev/rules.d file like so:

KERNEL=="sda", MODE="0666"
KERNEL=="snd/controlC1", MODE="0666"
KERNEL=="snd/pcmC1D0p", MODE="0666"
KERNEL=="hidraw5", MODE="0666"

So that they would have access to the speaker, but I still am getting the same error.

edit retag flag offensive close merge delete