SamDel / ChromeCast-Desktop-Audio-Streamer

Stream the sound of your desktop to your Chromecast Audio device
MIT License
412 stars 30 forks source link

Two clicks to start casting #76

Closed GrahamDLL closed 4 years ago

GrahamDLL commented 4 years ago

2.8

I reported this earlier and I have now started a new thread ...

This is intermittant ... sometimes I need to click twice to start casting ... sometimes only once ... An example of two clicks is a few minutes before I copied the attached log. Thanks for looking at this.

two-click-2.zip

SamDel commented 4 years ago

Thanks for the nice long log file. I've seen that behaviour before, the application sends a 'LAUNCH' message to the device. The device immediately replies with 'CLOSE':

out [2:34:52 PM][192.168.1.63:42237] [LaunchingApplication]: {"appId":"CC1AD845","requestId":6716,"type":"LAUNCH"} in [2:34:52 PM] [192.168.1.63:42237] [LaunchingApplication]: {"type":"CLOSE"}

I don't know why the device sends a close message immediately. The application sends the messages in the same order every time. I will look at it again later!

The option 'Automatically restart when the stream is closed' is a workaround for this behaviour. When the device sends a close message, the application just tries to launch again. (maybe it should be checked by default?)

I'll close the other issue!

GrahamDLL commented 4 years ago

For completeness ... the automatic restart appears to work in the attached.

I can intermittantly recreate the problem ... Start casting ... close app (while casting is still in progress) ... wait 20 seconds ... start app ... start casting ... In a trivial number of tests ... this caused the problem about three times out four.

two-clicks-auto-restart.zip

SamDel commented 4 years ago

Thanks, good research.

You're streaming to a group. The application didn't get the status of groups after a group was added to the devices box.

Fixed it in Setup 2.8.1.zip. The application gets the status of a group after it's added. And I added a check when you start streaming to make sure the status of the device is received before launching.

Can you try?

GrahamDLL commented 4 years ago

2.8.1 Repeated the stop-start described above. Casting began nicely about six times out of eight. One time there seemed to be a delay before casting began that was longer than usual. One time the first click failed to cast and a second click was required.

I am content to describe this as fixed. The test that I am doing is not realistic use and depends upon the Chromecast devices coping nicely with unrealistic stops and starts.

I'll post again if the problem happens in more realistic use. Thanks for all your good work.

DAS.zip

SamDel commented 4 years ago

Nice! Some changes in Setup 2.8.2.zip:

GrahamDLL commented 4 years ago

2.8.2

Multiple clicks failed to start casting ... this is after leaving everything idle overnight

multiple-clicks-no start-cast.zip

SamDel commented 4 years ago

Thanks, 2.8.2 was waiting for 2 seconds for a status was received. If nothing was received the application didn't try to launch the stream.

In Setup 2.8.3.zip:

GrahamDLL commented 4 years ago

2.8.3 casts first time every time ... thank you.

SamDel commented 4 years ago

Nice, thanks. I'll make a version 2.9 of it.

SamDel commented 4 years ago

Version 2.9