Streaming audio from NAO to computer

1,336 views
Skip to first unread message

Maciej Żurad

unread,
Mar 19, 2015, 12:06:15 PM3/19/15
to ros-sig-...@googlegroups.com
Hi there,

I am working on one project and I would like to stream audio from NAO to the computer.
Has anyone tried that already ? I was thinking about using snd-aloop (ALSA Loop back device) and then streaming the audio with arecord to aplay over SSH.
However opennao doesn't have snd-loop kernel module, I wanted to compile that on opennao-vm, but I cannot find sources of kernel on opennao-vm.

Has anyone tried installing additional kernel modules on NAO ?

If you think about better solution than using snd-aloop for streaming audio, I'd love to hear it.

Thanks in advance.

Maciej

Vincent Rabaud

unread,
Mar 20, 2015, 7:08:27 AM3/20/15
to ros-sig-...@googlegroups.com
Hi Maciej,

to stream audio you can use the NaoqiMic in naoqi_microphone.py (or the microphone.py node) : this streams from the NAO microphones to ROS using NAOqi.

Depending on what you want to do, you could also use the pulseaudio on the robot straight up.

--
You received this message because you are subscribed to the Google Groups "ROS Sig Aldebaran" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ros-sig-aldeba...@googlegroups.com.
To post to this group, send email to ros-sig-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ros-sig-aldebaran.
To view this discussion on the web visit https://groups.google.com/d/msgid/ros-sig-aldebaran/cf0b2dec-ead3-4b79-be0a-66475d4f249a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Maciej Żurad

unread,
Mar 20, 2015, 10:12:47 AM3/20/15
to ros-sig-...@googlegroups.com
Hey Vincent,

Thanks for your answer.
The thing is that I want to stream audio output to play it on speakers.
I need it for the demonstration that I am doing, since we are going to have some cooperation with UAVs,
therefore it would be difficult for people to hear NAO.

I tried using pulseaudio and I tried using normal tcp streaming, but it seems that NAO lacks this module

E: [pulseaudio] ltdl-bind-now.c: Failed to open module module-esound-protocol-tcp.so: module-esound-protocol-tcp.so: cannot open shared object file: No such file or directory
E: [pulseaudio] module.c: Failed to open module "module-esound-protocol-tcp".
E: [pulseaudio] main.c: Module load failed.
E: [pulseaudio] main.c: Failed to initialize daemon.

If you know how to solve it, I would greatly appreciate your insight.

Best,
Maciej 

Vincent Rabaud

unread,
Mar 20, 2015, 11:04:04 AM3/20/15
to ros-sig-...@googlegroups.com
Can you please detail which commands you ran ? Thx. Also, did you try the ROS / NAOqi module microphone.py ? It does streaming too.

Maciej Żurad

unread,
Mar 20, 2015, 11:36:03 AM3/20/15
to ros-sig-...@googlegroups.com
I am sorry I didnt explained well.
I am more concerned with the actual audio output of NAO.

I want to use AnimatedSpeech and stream the NAO's audio on some larger speakers connected to the computer running ROS,
First I was thinking about using ALTextToSpeech::sayToFile, prerecording and then playing both on NAO and the speakers connected to the computer.
However, it would be only feasible for normal TTS without animations.

That's why I want to stream audio output.
ALToRosMics allows only for streaming microphone's output.

For streaming with pulseaudio, I checked this StackExchange post.

Then I uncommented two lines from /etc/pulse/default.pa

> load-module module-esound-protocol-tcp
> load-module module-native-protocol-tcp

Which resulted in the error I described before.

Surya Ambrose

unread,
Mar 20, 2015, 1:02:19 PM3/20/15
to ros-sig-...@googlegroups.com
Hi,

Yes what you try to do is possible, but AFAIK you need pulseaudio on your computer. This solution does not use ROS, it is pure pulseaudio.

# On the robot (if you want to have sound on both your computer and the robot)
pactl load-module module-rtp-send source=alsa_output.0.output-speakers.monitor

# On the robot (if you want only sound on your computer)
pactl load-module module-null-sink sink_name=nao
qicli call ALAudioDevice._setDefaultOutput 1
pactl load-module module-rtp-send source=nao.monitor


# On your computer
pactl load-module module-rtp-recv

NB:
1) If both your computer and the robot play the sounds, there might be a very sensible delay between the two of them (for me, the delay is about a half second). Be sure to test that in advance ;)
2) I tried only with my computer and my robot on the same LAN network, I don't know if it works otherwise.
3) Anyone on the same LAN network that run the ...rtp-recv command will play the sounds. BUT:
4) when loading the rtp-send module, I think you can specify a unique IP to stream the sound to. The following URL might help you with this


Hope this will help you :).

Surya


For more options, visit https://groups.google.com/d/optout.


This email and any attachment thereto are confidential and intended solely for the use of the individual or entity to whom they are addressed.
If you are not the intended recipient, please be advised that disclosing, copying, distributing or taking any action in reliance on the contents of this email is strictly prohibited. In such case, please immediately advise the sender, and delete all copies and attachment from your system.
This email shall not be construed and is not tantamount to an offer, an acceptance of offer, or an agreement by Aldebaran Robotics on any discussion or contractual document whatsoever. No employee or agent is authorized to represent or bind Aldebaran Robotics to third parties by email, or act on behalf of Aldebaran Robotics by email, without express written confirmation by Aldebaran Robotics’ duly authorized representatives.


Ce message électronique et éventuelles pièces jointes sont confidentiels, et exclusivement destinés à la personne ou l'entité à qui ils sont adressés.

Si vous n'êtes pas le destinataire visé, vous êtes prié de ne pas divulguer, copier, distribuer ou prendre toute décision sur la foi de ce message électronique. Merci d'en aviser immédiatement l'expéditeur et de supprimer toutes les copies et éventuelles pièces jointes de votre système.

Ce message électronique n'équivaut pas à une offre, à une acceptation d’offre, ou à un accord d'Aldebaran Robotics sur toute discussion ou document contractuel quel qu’il soit, et ne peut être interprété comme tel. Aucun employé ou agent d’Aldebaran Robotics n'est autorisé à représenter ou à engager la société par email, ou à agir au nom et pour le compte de la société par email, sans qu’une confirmation écrite soit donnée par le représentant légal d’Aldebaran Robotics ou par toute autre personne ayant reçu délégation de pouvoir appropriée.

Reply all
Reply to author
Forward
0 new messages