Send audio FROM rpi to dnla speaker

This forum is for discussion about general software issues.

Send audio FROM rpi to dnla speaker

Postby jibe » Sat Aug 12, 2017 10:31 pm

Hi everyone !

For a personal project, I need to send an audio file (.flac) to my JBL speaker, from my RPI terminal. I saw there is a lot of programs (serviio, plex or allconnect on android...) that allow to do it, but I found nothing that I could use to do it myself. And I don't want to retrieve the file from the speaker app, but to send it to the the speaker using terminal.

I was dreaming of something like " $ dnla-app play-file ~/tune.flac 192.168.1.15 ", where 192.168.1.15 is my speaker's IP, but it seems to be way more complicated...

I tried to with PulseAudio, but didn't find any option allowing it.

Anyone has any idea of how I shall proceed ? I know it's quite a vague question, but I spent the whole day looking for it, and nothing...

Thanks !

EDIT 1 : Following http://wiki.jackslab.org/Upnp and other similar posts, I'm trying to use upnp protocols to detect my speaker (and maybe control it), but with no success as for now.

First terminal :
Code: Select all
$ cat test.txt
M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
MAN: ssdp:discover
MX: 10
ST: ssdp:all


Second terminal :
Code: Select all
$ nc -buvv 239.255.255.250 1900 < test.txt
Connection to 239.255.255.250 1900 port [udp/ssdp] succeeded!


Third terminal :
Code: Select all
$ sudo tcpdump -vv -A -s 0 -i wlan0 udp port 1900 and host 239.255.255.250
15:56:10.949878 IP (tos 0x0, ttl 1, id 41655, offset 0, flags [DF], proto UDP (17), length 29)
    alarmpi.55492 > 239.255.255.250.ssdp: [udp sum ok] UDP, length 1
E.....@...$....~.......l.   ..X
15:56:10.950707 IP (tos 0x0, ttl 1, id 41656, offset 0, flags [DF], proto UDP (17), length 29)
    alarmpi.55492 > 239.255.255.250.ssdp: [udp sum ok] UDP, length 1
E.....@...$....~.......l.   ..X
15:56:11.951350 IP (tos 0x0, ttl 1, id 41732, offset 0, flags [DF], proto UDP (17), length 29)
    alarmpi.55492 > 239.255.255.250.ssdp: [udp sum ok] UDP, length 1
E.....@...$....~.......l.   ..X
15:56:12.951929 IP (tos 0x0, ttl 1, id 41748, offset 0, flags [DF], proto UDP (17), length 29)
    alarmpi.55492 > 239.255.255.250.ssdp: [udp sum ok] UDP, length 1
E.....@...$....~.......l.   ..X
15:56:13.952504 IP (tos 0x0, ttl 1, id 41788, offset 0, flags [DF], proto UDP (17), length 29)
    alarmpi.55492 > 239.255.255.250.ssdp: [udp sum ok] UDP, length 1
E....<@...$s...~.......l.   ..X
15:56:13.960469 IP (tos 0x0, ttl 1, id 41789, offset 0, flags [DF], proto UDP (17), length 114)
    alarmpi.55492 > 239.255.255.250.ssdp: [udp sum ok] UDP, length 86
E..r.=@...$....~.......l.^..M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
MAN: ssdp:discover
MX: 10
ST: ssdp:all


It looks like it's working, but nothing is detected. For the record, my android app detects the speaker and connects it as dlna.

Anyone has an idea of what I'm doing wrong (or an advice about another way to achieve my initial goal?)

Thanks
jibe
 
Posts: 2
Joined: Sat Aug 12, 2017 10:19 pm

Re: Send audio FROM rpi to dnla speaker

Postby jibe » Tue Aug 15, 2017 7:25 pm

In order to detect my dlna device :
Code: Select all
gssdp-discover -i wlan0 --timeout=3


Then I adapted the content of that post : http://djoepnpoep.blogspot.co.za/2015/0 ... -curl.html. I'm sorry I can't post my solution due to reputation/link restrictions... But being careful with " and end of lines, it is quite easy.

After looking in that direction, I found some .js libraries that seem to do the job (ex : : https://github.com/rexboy7/plug.play.js) and even if it's not exactly what I was looking for at the beginning, it serves me right.
jibe
 
Posts: 2
Joined: Sat Aug 12, 2017 10:19 pm


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest