audio don't play in pi

asked 2020-04-30 01:51:23 -0500

dinesh gravatar image

updated 2020-04-30 01:52:45 -0500

I am running the ros audio capture and play nodes in raspberry pi 4B. I ran the audio capture node in pi with command:

roslaunch audio_capture capture.launch device:="hw:1,0" sample_rate:=44100 ns:="cap1"

when i check the audio published with echo command i can cleary see that the audio data is being generated/produced. But now when i trey to play the audio in same or another pi with command:

 roslaunch audio_play play.launch ns:="cap1"

it don't product any sound. When i checked the error using roswtf, i see no error or warnings also. neithe it is showing when launching the nodes. when i run the audio_play node in my laptop running melodic in ubuntu 18 the audio is comming.

I checked the speaker of pi with command:

speaker-test -c2 -twav -l7

and the audio is clearly comming. here is the list of play device in my pi:

**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 7/7
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 IEC958/HDMI [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: ALSA [bcm2835 ALSA], device 2: bcm2835 IEC958/HDMI1 [bcm2835 IEC958/HDMI1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

so how should i make this work.

edit retag flag offensive close merge delete