ugjka / blast

blast your linux audio to DLNA receivers
Other
34 stars 1 forks source link

Stream to Sonos - Errorcode 714 #1

Closed marc4s closed 9 months ago

marc4s commented 12 months ago

` blast git:(main) ./blast

DLNA receivers 0: 192.168.158.24 - SYMFONISK Bookshelf

Select the DLNA device: [0]

Audio sources 0: alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFihw_sofhdadsp_5sink.monitor 1: alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFihw_sofhdadsp_4sink.monitor 2: alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFihw_sofhdadsp_3sink.monitor 3: alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFihw_sofhdadspsink.monitor 4: alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFihw_sofhdadspsource 5: alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFihw_sofhdadsp_6source 6: combined.monitor 7: bluez_sink.2C_FD_B4_86_0C_10.a2dp_sink.monitor 8: blast.monitor

Select the audio source: [7]

Your LAN ip addresses 0: 192.168.158.48

Select the lan IP address for the stream: [0]

2023/11/10 07:20:12 starting the stream on port 9000 (configure your firewall if necessary) 2023/11/10 07:20:12 stream URI: http://192.168.158.48:9000/stream 2023/11/10 07:20:12 setting av1transport URI and playing SOAP fault. Code: s:Client | Explanation: UPnPError | Detail: 714

blast git:(main) sudo ufw status Status: Inactive `

is this a bug ? Error on play_media with UPnP Error 714 received: Illegal MIME-Type

if this is correct I found here you may add .mp3/mime-type:

https://github.com/home-assistant/core/issues/37444

ugjka commented 12 months ago

It sends audio/mpeg but i also added audio/mp3 now, you can try it on latest master and report back

ugjka commented 10 months ago

no response, closing

ugjka commented 10 months ago

for what it is worth i switched the program to use ffmpeg for mp3 encoding because i found Lame to be problematic when working on some other project

vitaleg commented 9 months ago

The same problem on latest version - https://i.imgur.com/ectCBgU.png

marc4s commented 9 months ago

Yes, same here. still the same error. (sorry for late response, I did not got the mails from github regarding this)

marc4s commented 9 months ago

I tried both, the prebuild 0.2.0 amd64 and the repo and build it with go both the same issue

ffmpeg -version ffmpeg version 4.4.4-0ubuntu1~22.04.sav1.1 Copyright (c) 2000-2023 the FFmpeg developers

ugjka commented 9 months ago

can you post the output of blast -debug

ugjka commented 9 months ago

Do Sonos actually support DLNA?

image

ugjka commented 9 months ago

https://en.community.sonos.com/components-and-architectural-228999/still-no-dlna-support-in-sonos-using-jellyfin-6868659

https://en.community.sonos.com/controllers-and-music-services-228995/do-the-sonos-smart-speakers-support-dlna-6850228

vitaleg commented 9 months ago

debug.log

ugjka commented 9 months ago

blast.zip

Can you try this version that sends flac instead of mp3

vitaleg commented 9 months ago

No changes, unfortunately.

blast.log

ugjka commented 9 months ago

Ok, the more I read it seems Sonos simply doesn't support DLNA properly even though its devices advertise themselves as such on the LAN

FWIW, here is a version that dumps raw WAV blast.zip

vitaleg commented 9 months ago

This version behaves exactly the same way.

I just checked DLNA casting from Jellyfin, everything works there.

ugjka commented 9 months ago

Does jellyfin support casting live streams? If you can run blast and make jellyfin cast http://192.168.158.48:9000/stream then that would be great

vitaleg commented 9 months ago

blast is undetectable on my network.

It's probably caused by this:

# curl -v http://192.168.250.105:9000/steam
*   Trying 192.168.250.105:9000...
* Connected to 192.168.250.105 (192.168.250.105) port 9000 (#0)
> GET /steam HTTP/1.1
> Host: 192.168.250.105:9000
> User-Agent: curl/7.88.1
> Accept: */*
> 
< HTTP/1.1 404 Not Found
< Content-Type: text/plain; charset=utf-8
< X-Content-Type-Options: nosniff
< Date: Thu, 11 Jan 2024 13:21:40 GMT
< Content-Length: 19
< 
404 page not found
* Connection #0 to host 192.168.250.105 left intact

I don't think it's supposed to be like this.

UPD: Pardon me, I'm dumb.... :D Now I see how it works.

ugjka commented 9 months ago

you have a typo in there steam => stream

ugjka commented 9 months ago

Here is a little utility I made some time ago to send URLs to DLNA devices dlna-send.zip

Can you guys send any internet radio link to your devices like: dlna-send https://stream.rekt.network/chillsynth.mp3

vitaleg commented 9 months ago

It worked

# ./dlna-send https://stream.rekt.network/chillsynth.mp3
----------
DLNA receivers
0: VNet-MediaCenter
1: 192.168.250.24 - Sonos One SL
----------
Select the DLNA device:
[1]
ugjka commented 9 months ago

Hmmm... can you send it https://ugjka.net/ircradio (my irc chat tts radio)

vitaleg commented 9 months ago
# ./dlna-send https://ugjka.net/ircradio
----------
DLNA receivers
0: VNet-MediaCenter
1: 192.168.250.24 - Sonos One SL
----------
Select the DLNA device:
[1]
SOAP fault. Code: s:Client | Explanation: UPnPError | Detail: <UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>714</errorCode></UPnPError>
ugjka commented 9 months ago

Here is blast that sends all http headers all in lowercase (go capitalizes by defaulth) blast.zip

vitaleg commented 9 months ago

No changes :-(

vitaleg commented 9 months ago

I google this solution - https://www.reddit.com/r/homeassistant/comments/101bj1b/home_assistant_sonos_s1s2_streaming_radio_why_do/

And it worked:

# ./dlna-send x-rincon-mp3radio://ugjka.net/ircradio
----------
DLNA receivers
0: VNet-MediaCenter
1: 192.168.250.24 - Sonos One SL
----------
Select the DLNA device:
[1]
vitaleg commented 9 months ago

But it doesn't work without x-rincon-mp3

# ./dlna-send radio://ugjka.net/ircradio
----------
DLNA receivers
0: VNet-MediaCenter
1: 192.168.250.24 - Sonos One SL
----------
Select the DLNA device:
[1]
SOAP fault. Code: s:Client | Explanation: UPnPError | Detail: <UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>714</errorCode></UPnPError>
vitaleg commented 9 months ago

I changed the streamURL, recompiled, now it works.

        if streamAddress.To4() != nil {
                streamURL = fmt.Sprintf("x-rincon-mp3radio://%s:%d/stream", streamAddress, STREAMPORT)
        } else {

https://i.imgur.com/YjkQsv2.png

ugjka commented 9 months ago

Yeah, I'm working on sonos detector function because this will break most non sonos dlna devices i think

ugjka commented 9 months ago

can you check if this works https://github.com/ugjka/blast/files/13907070/blast.zip

vitaleg commented 9 months ago

It works now - https://i.imgur.com/hA2GLj8.png

Thanks for fix.

ugjka commented 9 months ago

@marc4s can you confirm too?

marc4s commented 9 months ago

just made a git pull. still same

2024/01/12 13:21:42 starting the stream on port 9000 (configure your firewall if necessary) 2024/01/12 13:21:42 stream URI: http://192.168.158.29:9000/stream 2024/01/12 13:21:42 setting av1transport URI and playing SOAP fault. Code: s:Client | Explanation: UPnPError | Detail: 714

marc4s commented 9 months ago

ah I see the zip now. this works! GREAT!! Thank You