Closed MX10-AC2N closed 4 years ago
Hi, You certainly seem to attract problems! First un (unrelated) note: I see that you stille use a 48000 (DVD audio) samplerate, where Deezer uses 44100. I would advise you to change this in the Windows audio settings panel, to avoid the resampling from 44100 (Deezer) to 48000 (your audio config):
Now for your real problem: there is no information in the audio stream that announces the start or end of a song, so I assume that the Harman Kardon somehow "sees" the end of the song when a certain amount of absolute silence is present, and decides to close the streaming connection. It is possible that the "silence" between two songs is "more silent" with VB Audio HiFi cable (pure digital) than it is with a real sound card (analog). Can you use gapless playback with Deezer? Perhaps that could prevent this silence detection. In any case, from the log I see that it is the Harman Kardon that decides to close the connection without any action from the part of swyh-rs.
This is what it seemed to me indeed .. I made the modification to switch to 44100, thank you for the remark. As for the stream I don't have to worry when I use LocalAudioBroadcast so I think there may be a few things to do in software level anyway ... Otherwise I will also have the cut for each song With LocalAudioBroadcast also it seems to me .. I will continue to use your releases and give you my feedback if I heard correctly ... Nothing personal, don't worry.. ;-)
Do you mean that when usingVB Audio HiFi cable with Local Audio Broadcast you don't have this disconnection problem?
Yes that's it, and that's why I wrote about this problem ..
So it should be possible to fix this.
I published a new pre-release that attempts to fix this problem by adding a "duration" to the DIDL-Lite metadata telling the device that the song will last for 72 hours 59 minutes and 59 seconds.
It may be a long 72h59m59s, in any case error ...
AV Start playing on Harman Kardon AVR265 host=192.168.1.26 port=80 from 192.168.1.27 using AvTransport Play av_play: error KeyError(Invalid key: duration) formatting didl_data
Yes, I forgot to test it with avtransport, only tested with openhome and forgot to add the key for avtransport too....
Should be fixed now for AVTransport too (tested on a Sony renderer).
I replaced the 0.7.8 release with a new build https://github.com/dheijl/swyh-rs/releases/tag/0.7.8
If you can confirm that this fixes the "silence" problem I will start on
What do you think? Could take some time to complete.
I'm sorry but I still have the same disconnection problem at the end of each song ... Maybe it just requires restarting the stream when silence is detected. Good luck anyway in this beautiful project that is swyh-rs ==> you should really think about finding a nicer name for it ..
It is easy to automatically restart streaming, but thej it becomes impossible to stop streaming from the device itself as long as the button in swyh-rs is active...
It is easy to automatically restart streaming, but thej it becomes impossible to stop streaming from the device itself as long as the button in swyh-rs is active...
Either way, we manage the streaming from our pc and not from the renderer ... But it is true that some would prefer to be able to cut from the renderer so it is enough to be able to activate / deactivate this function from the GUI.
OK I'll add a checkbox for automatic resume streaming.
Before I add code that is very specific to one device, yet another version:
https://github.com/dheijl/swyh-rs/releases/tag/0.7.9
Could you please try this version first?
Hello, it's curious but this version 0.7.9 was detected as a rare file by Avast antivirus and sent the two .EXE files to their antivirus test lab I must have results within 71 minutes, in short while waiting for the Files are blocked. I am therefore waiting to be able to launch this new version ...
V0.7.9 tested but still the same disconnection problem at the end of the songs .. Sorry ...
Thanks for testing again. It will be a couple of days before you hear from me again now.
Out of curiosity I just installed Local Audio Broadcast.
I can't get it to play anything, it sees the devices but can't control them. Every time I press "play" the sound on the device is interrupted for a second but then resumes what it was playing locally before, ignoring Local Audio Broadcast, and the play button in L.A.B. reverts to "stopped" automatically. Everything looks OK when I look with a network sniffer but it sends an invalid IP address to the device (a HYPER-V local IP address in the 172.24.240 subnet range) instead of the actual IP address of the PC.
The only difference in the commands sent to the player I can see is that it sends a duration of "0" in the didl-lite metadata, I'll change it to "0" on my side too but I doubt that this will change anything...
Also, it seems that AVTransport can not automatically continue to keep playing tracks unless the control point is in constant conversation with it (UPNP SUBSCRIBE/NOTIFY). And this is why the OpenHome protocol was invented by Linn, to enable the device to continue playing without intervention by the control point. (see https://www.lesbonscomptes.com/upmpdcli/upmpdcli-manual.html). Implementing SUBSCRIBE/NOTIFY is far too much work for me to implement (SWYH and L.A.B. use the Intel UPNP library to handle all that). I'm sorry for that. But thank you very much for all the testing and the feedback, and I will definitely add an audio source selection possibility, and an "automatically resume play" checkbox, hopefully in the next week or two.
Thank you for the info, I'm surprised LAB doesn't work for you, maybe a pc reboot and renderer reboot would be useful .. or the network firewall is blocking ... For me it works fine with VB-Audio (via the windows settings) while my pc keeps the native sound output by default so I always have the system sounds or whatever I want on my pc and at the same time deezer and youtube via VB-Audio and LAB on my renderer, which is Really not bad at all... ;-) I will monitor the evolution of your swyh-rs, I wish you good luck in all this work ... And thank you again ..
Hi Dheijl, I tried the new V0.8.0 and i have error when I want stream with VB-Audio or real sound card:
log: Default audio output device: Hi-Fi Cable Input (VB-Audio Hi-Fi Cable)
log: Default config SupportedStreamConfig { channels: 2, sample_rate: SampleRate(44100), buffer_size: Unknown, sample_format: F32 }
thread 'main' panicked at 'Could not capture f32 stream format: BackendSpecific { err: BackendSpecificError { description: "Descripteur non valide (os error -2147024890)" } }', src\main.rs:473:14
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
It works OK here. The message says you can't capture the sound source, perhaps the sound source has been put in "exclusive" mode?
I had this error when I tried to launch swyh-rs when I had no sound played on my pc hence the error, it closed the gui completely, I had to launch the application with console to have the debug .. That said now with deezer I was able to launch v0.8.0 and it unfortunately still works well this disconnection problem, I can not wait that you were able to integrate this automatic restream parameter in the event of a cut ... Have a good day..
Feedback on releaese 0.8.1, The automatic stream restart function is functional but it runs in a loop without stopping, and ultimately never restarts the stream it's weird ... here is a copy of the debug
Autoresume: AV Stop playing on Harman Kardon AVR265 host=192.168.1.26 port=80
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#Stop,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
Autoresume: AV Start playing on Harman Kardon AVR265 host=192.168.1.26 port=80 from 192.168.1.27 using AvTransport Play
AvTransport server URL: http://192.168.1.27:5901/stream/swyh.wav
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#Play,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
Autoresume: AV Stop playing on Harman Kardon AVR265 host=192.168.1.26 port=80
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#Stop,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
Autoresume: AV Start playing on Harman Kardon AVR265 host=192.168.1.26 port=80 from 192.168.1.27 using AvTransport Play
AvTransport server URL: http://192.168.1.27:5901/stream/swyh.wav
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
If I uncheck autoresume play while it is in action it will restart the stream ...
The autoresume function should be a minimum time between 2 automatic stream restart, maybe 30 seconds, or less ...
It's a bug. When corrected it should no longer happen.
updated release: https://github.com/dheijl/swyh-rs/releases/tag/0.8.1
Well sorry but the result is the same I have a stream that starts in a loop but never a connection ...
I noticed that when I start the stream I always have 2 connections that are made .. maybe that's what is blocking .. The first connection is systematically closed then on the second begins the stream. So during the first disconnection it relaunches the autoresume playback and finally it's a loop of restart playback... What do you think about ?
log: Received request /stream/swyh.wav from 192.168.1.26:50304 log: Streaming to 192.168.1.26:50304 has ended log: Received request /stream/swyh.wav from 192.168.1.26:50305 ==> then I have the sound
Could you send me the complete debug log? As I don't have a HK to test with it's difficult to predict how it will react.
The standard sequence of commands is: => Stop Play (unlock transport) => set AV Transport URI (URI and metadata of the PCM stream) => Play
With autoresume I send all 3 commands, but perhaps a Play command alone is enough (as it has already stopped).
I can make some experimental builds for you if you want to help me with testing this.
About the 2 connections: it looks like it is trying a "test" request just to know what to expect before it starts the real stream, no idea really... Only a sniffer network trace might give a clue.
According to the latest standard (http://www.upnp.org/specs/av/UPnP-av-AVTransport-v3-Service.pdf), a Play command alone might be enough:
_5.4.11.2 Dependency on State This action is allowed in the “STOPPED”, “PLAYING”, and “PAUSEDPLAYBACK” transport states. In other states the action may also succeed or it may fail with error code 701
I'll try to make a build that only uses a "Play" command on autoresume.
another experiment: https://github.com/dheijl/swyh-rs/releases/tag/0.8.2
Play alone is not enough, SetAVTransportURI is needed here with Volumio in AV mode.
Test of the release 0.8.2 Sorry but I still have the same loop issue when launching the stream and never have a real connection ... Here is a piece of the debug which is much too long with all the stream restarts.
log: SSDP discovery started UDP response at 1203 from 192.168.1.26:56697: HTTP/1.1 200 OK CACHE-CONTROL: max-age=1800 EXT: LOCATION: http://192.168.1.26:80/dd.xml SERVER: POSIX, UPnP/1.0, Intel MicroStack/1.0.2777 ST: urn:schemas-upnp-org:service:RenderingControl:1 USN: uuid:3dcc7100-f76c-11dd-87af-002261a59896::urn:schemas-upnp-org:service:RenderingControl:1
log: Renderer at : http://192.168.1.26:80/dd.xml log: Getting renderer descriptions Get service description for http://192.168.1.26:80/dd.xml Service description: <?xml version="1.0" encoding="utf-8"?>
log: Renderer Harman Kardon AVR265 None ip 192.168.1.26 at urlbase http://192.168.1.26:80/ has 3 services
log: => OpenHome Playlist control url: '', AvTransport url: '/AVTransport/control'
.. urn:schemas-upnp-org:service:AVTransport:1 urn:upnp-org:serviceId:AVTransport /AVTransport/control
.. urn:schemas-upnp-org:service:ConnectionManager:1 urn:upnp-org:serviceId:ConnectionManager /ConnectionManager/control
.. urn:schemas-upnp-org:service:RenderingControl:1 urn:upnp-org:serviceId:RenderingControl /RenderingControl/control
log: SSDP discovery complete
Got 1 renderers
Try capturing system audio
log: Default audio output device: Hi-Fi Cable Input (VB-Audio Hi-Fi Cable)
log: Default config SupportedStreamConfig { channels: 2, sample_rate: SampleRate(44100), buffer_size: Unknown, sample_format: F32 }
log: The streaming server is listening on http://192.168.1.27:5901/stream/swyh.wav
log: The wave_reader is receiving samples
Pushed renderer #0 None Harman Kardon AVR265, state = ON
log: AV Stop playing on Harman Kardon AVR265 host=192.168.1.26 port=80
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#Stop,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
log: AV Start playing on Harman Kardon AVR265 host=192.168.1.26 port=80 from 192.168.1.27 using AvTransport Play
AvTransport server URL: http://192.168.1.27:5901/stream/swyh.wav
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#Play,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
log: Received request /stream/swyh.wav from 192.168.1.26:50001
log: Streaming to 192.168.1.26:50001 has ended
Autoresume: AV resume playing on Harman Kardon AVR265 host=192.168.1.26 port=80 from 192.168.1.27 using AvTransport Play
AvTransport server URL: http://192.168.1.27:5901/stream/swyh.wav
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#Play,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
Autoresume: AV resume playing on Harman Kardon AVR265 host=192.168.1.26 port=80 from 192.168.1.27 using AvTransport Play
AvTransport server URL: http://192.168.1.27:5901/stream/swyh.wav
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#Play,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
Autoresume: AV resume playing on Harman Kardon AVR265 host=192.168.1.26 port=80 from 192.168.1.27 using AvTransport Play
AvTransport server URL: http://192.168.1.27:5901/stream/swyh.wav
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#Play,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
Autoresume: AV resume playing on Harman Kardon AVR265 host=192.168.1.26 port=80 from 192.168.1.27 using AvTransport Play
AvTransport server URL: http://192.168.1.27:5901/stream/swyh.wav
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#Play,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
Autoresume: AV resume playing on Harman Kardon AVR265 host=192.168.1.26 port=80 from 192.168.1.27 using AvTransport Play
AvTransport server URL: http://192.168.1.27:5901/stream/swyh.wav
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#Play,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
Autoresume: AV resume playing on Harman Kardon AVR265 host=192.168.1.26 port=80 from 192.168.1.27 using AvTransport Play
AvTransport server URL: http://192.168.1.27:5901/stream/swyh.wav
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#Play,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
Autoresume: AV resume playing on Harman Kardon AVR265 host=192.168.1.26 port=80 from 192.168.1.27 using AvTransport Play
AvTransport server URL: http://192.168.1.27:5901/stream/swyh.wav
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#Play,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
Autoresume: AV resume playing on Harman Kardon AVR265 host=192.168.1.26 port=80 from 192.168.1.27 using AvTransport Play
AvTransport server URL: http://192.168.1.27:5901/stream/swyh.wav
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
url: http://192.168.1.26:80/AVTransport/control,
=>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#Play,
=>SOAP xml:
<?xml version="1.0" encoding="utf-8"?>
log: Received request /stream/swyh.wav from 192.168.1.26:50017 log: Streaming to 192.168.1.26:50017 has ended log: Received request /stream/swyh.wav from 192.168.1.26:50018 log: Received request /stream/swyh.wav from 192.168.1.26:50019 log: Streaming to 192.168.1.26:50019 has ended Autoresume: AV resume playing on Harman Kardon AVR265 host=192.168.1.26 port=80 from 192.168.1.27 using AvTransport Play AvTransport server URL: http:/
OK I begin to see the light. By taking a network sniffer trace while streaming to a Sony TV (which works without interruptions using AVTransport by the way) I now know where these extra streaming requests come from. They are indeed a "probe" to see what the device can expect, using a "HEAD" request. I will try to handle this before I do anything else.
I now handle these HEAD requests. If I stop playing on the Sony TV with autoresume active it automatically restarts without fail. The Sony does not stop between songs though like your HK.
This time it's the right one .. Congratulations, the autoresume play function works perfectly .. CONGRATULATIONS I noticed when switching from L.A.B to SWYH-RS that the sound level of 2 streams was not the same, SWYH-RS broadcasts a little less loudly than L.A.B. Nothing serious, but it is true that a possible adjustment of the sound level of the stream would be more interesting for the swyh-rs ... Congratulations again for all the work already accomplished and good luck for all that you still have .. Thank you again and again ...
I will close this issue now, but feel free to open new issues for other problems. I will now add the possibility to choose the audio source first. As for the volume adjustment: I can not touch the volume without introducing distortion (clipping), any volume increase has to be done at the audio source or in the amplifier.
And a big thanks to you for all the testing and your patience with me...
Hi @dheijl and all, I try to use VB-Audio cable Hifi to no longer have the sound coming out simultaneously (well almost ..!) On my pc and in my amplifier via the stream .. In short when I use VB-Audio it works very well but just the time of a song, then I have a message
log: Received request /stream/swyh.wav from 192.168.1.26:50016 log: =>Http connection with 192.168.1.26:50016 terminated [Une connexion établie a été abandonnée par un logiciel de votre ordinateur hôte. (os error 10053)] log: Streaming to 192.168.1.26:50016 has ended
And I am therefore forced to restart the stream to my amp.
Pushed renderer #0 None Harman Kardon AVR265, state = ON log: AV Stop playing on Harman Kardon AVR265 host=192.168.1.26 port=80 url: http://192.168.1.26:80/AVTransport/control, =>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#Stop, =>SOAP xml: <?xml version="1.0" encoding="utf-8"?>0 </u:Stop></s:Body></s:Envelope>
<=SOAP response: <?xml version="1.0" encoding="utf-8"?>
</u:StopResponse></s:Body></s:Envelope>
log: AV Start playing on Harman Kardon AVR265 host=192.168.1.26 port=80 from 192.168.1.27 using AvTransport Play AvTransport server URL: http://192.168.1.27:5901/stream/swyh.wav url: http://192.168.1.26:80/AVTransport/control, =>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI, =>SOAP xml: <?xml version="1.0" encoding="utf-8"?>0 http://192.168.1.27:5901/stream/swyh.wav <DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/"><item id="1" parentID="0" restricted="0"><dc:title>swyh-rs</dc:title><res bitsPerSample="16" nrAudioChannels="2" protocolInfo="http-get:*:audio/l16;rate=48000;channels=2:DLNA.ORG_PN=LPCM" sampleFrequency="48000">http://192.168.1.27:5901/stream/swyh.wav</res><upnp:class>object.item.audioItem.musicTrack</upnp:class></item></DIDL-Lite> </u:SetAVTransportURI></s:Body></s:Envelope>
<=SOAP response: <?xml version="1.0" encoding="utf-8"?>
</u:SetAVTransportURIResponse></s:Body></s:Envelope>
url: http://192.168.1.26:80/AVTransport/control, =>SOAP Action: urn:schemas-upnp-org:service:AVTransport:1#Play, =>SOAP xml: <?xml version="1.0" encoding="utf-8"?>0 1 </u:Play></s:Body></s:Envelope>
<=SOAP response: <?xml version="1.0" encoding="utf-8"?>
</u:PlayResponse></s:Body></s:Envelope>
log: Received request /stream/swyh.wav from 192.168.1.26:50017 log: Streaming to 192.168.1.26:50017 has ended log: Received request /stream/swyh.wav from 192.168.1.26:50018 log: =>Http connection with 192.168.1.26:50018 terminated [Une connexion établie a été abandonnée par un logiciel de votre ordinateur hôte. (os error 10053)] log: Streaming to 192.168.1.26:50018 has ended
By cons no problem when I use my real sound card ..?