SamDel / ChromeCast-Desktop-Audio-Streamer

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

Connect Fail #54

Closed FA-Bubba closed 5 years ago

FA-Bubba commented 5 years ago

The DAS dropped all speaker connections, and repeatedly attempts to reconnect, but fails almost immediately. This has been happening for about two days...

I rebooted my router, and the PC, and tried again with same issue:

Log-2019-07-27-v2-4-1-ConnectFails.zip

FA-Bubba commented 5 years ago

I installed v2.4.3, and it has the same issues:

Log-2019-07-27-v2-4-3-ConnectFails.zip

FA-Bubba commented 5 years ago

More troubleshooting: The Speaker Groups are failing to connect; but individual Speakers will connect & stream...

SamDel commented 5 years ago

To remove the rogue device you can try 'Reset Settings' on the options tab.

It looks like 192.168.1.190 is failing. Can you look up the name of that device with this url, switch that device off and try again with the ALL Speakers group?

FA-Bubba commented 5 years ago

Thank you!...

FYI, I went to the "Client List" on my Mesh Controller (UniFi), and reset all of the Chromecast Audio connections, now all of the speakers seem to be playing from the "All Speakers" Group. I will watch and note any addition connection fails...

Before I do the reset to remove the 'rogue' Device Box, what are ALL of the settings that are changed? (I want to make a list of the settings I want to save and reapply).

Thanks!

SamDel commented 5 years ago

Reset is changing:

FA-Bubba commented 5 years ago

Have not done the reset yet, but getting a lot of disconnects & reconnects... Log attached:

Log-2019-07-27-v2-4-3-Connect-On-Off.zip

SamDel commented 5 years ago

It looks like network problems.

Basement Mini is leader of the ALL Speakers group in the log. The network connection with that device is lost every now and then, from 9:57 PM onwards.

FA-Bubba commented 5 years ago

Yes, I have been 'adjusting' my network over the past week; I think it is more stable now, but devices seem to drop off & reconnect for no apparent reason...

Basement Mini is first because the Devices are listed in alphabetic order. Are you saying that if ANY speaker in the Group drops off the network, the whole Group drops out? Is there a way to prevent that?

Also, what are some key words I can search the log with to help me identify the faults, so I don't bother you so much?

Thanks!

SamDel commented 5 years ago

Basement Mini is first because the Devices are listed in alphabetic order. Are you saying that if ANY speaker in the Group drops off the network, the whole Group drops out? Is there a way to prevent that?

The application connects & streams to the leader of the group, the devices in a group elect a leader and distribute the audio themselves. So only if the 'leader' device drops off the network the stream stops.

Also, what are some key words I can search the log with to help me identify the faults, so I don't bother you so much?

When a stream is '[Playing]', and the next line in the log (with the same IP address and port) is: An established connection was aborted by the software in your host machine or A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond then the connection with the device is lost:

in [9:57:32 PM] [192.168.1.156:42229] [Playing]: {"type":"MEDIA_STATUS","status":[{"mediaSessionId":1,"playbackRate":1,"playerState":"PLAYING","currentTime":18613.486731,"supportedMediaCommands":274447,"volume":{"level":1,"muted":false},"activeTrackIds":[],"media":{"contentId":"http://192.168.1.57:60456/","contentType":"audio/wav","streamType":"BUFFERED","metadata":{"type":0,"metadataType":0,"title":"Desktop Audio Streamer","images":[]},"mediaCategory":"AUDIO","duration":null,"tracks":[{"trackId":1,"type":"AUDIO"}],"breakClips":[],"breaks":[]},"currentItemId":1,"items":[{"itemId":1,"media":{"contentId":"http://192.168.1.57:60456/","contentType":"audio/wav","streamType":"BUFFERED","metadata":{"type":0,"metadataType":0,"title":"Desktop Audio Streamer","images":[]},"duration":null},"autoplay":true,"activeTrackIds":[],"orderId":0}],"repeatMode":"REPEAT_OFF"}],"requestId":2261}
ex : [[9:57:41 PM] [192.168.1.156:42229] Disconnected Send] An established connection was aborted by the software in your host machine
ex : [[9:57:41 PM] [192.168.1.156:42229] Disconnected Send] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
...
out [9:57:51 PM][192.168.1.156:42229] [LaunchingApplication]: {"appId":"CC1AD845","requestId":2263,"type":"LAUNCH"}
...
in [9:58:21 PM] [192.168.1.156:42229] [Playing]: {"requestId":0,"status":{"applications":[{"appId":"CC1AD845","displayName":"Default Media Receiver","iconUrl":"","isIdleScreen":false,"launchedFromCloud":false,"namespaces":[{"name":"urn:x-cast:com.google.cast.debugoverlay"},{"name":"urn:x-cast:com.google.cast.cac"},{"name":"urn:x-cast:com.google.cast.broadcast"},{"name":"urn:x-cast:com.google.cast.media"}],"sessionId":"333597b0-d37d-4adc-bd09-a987c016347e","statusText":"Casting: Desktop Audio Streamer","transportId":"333597b0-d37d-4adc-bd09-a987c016347e"}],"userEq":{"high_shelf":{"frequency":4500.0,"gain_db":0.0,"quality":0.707},"low_shelf":{"frequency":150.0,"gain_db":0.0,"quality":0.707},"max_peaking_eqs":0,"peaking_eqs":[]},"volume":{"controlType":"master","level":0.40548038482666016,"muted":false,"stepInterval":0.05000000074505806}},"type":"RECEIVER_STATUS"}
ex : [[9:58:22 PM] [192.168.1.156:42229] Disconnected Send] An established connection was aborted by the software in your host machine
ex : [[9:58:22 PM] [192.168.1.156:42229] Disconnected Send] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
FA-Bubba commented 5 years ago

Thank you, this is very helpful...

Regarding a Group "Leader", is there a way I can reliably designate a specific device as the "Leader"? For example, if the first device in the alphabetical list is the Leader, I could rename a specific device to ensure it is always first in the list.... or is the Leader 'elected' by a different process?

Thanks!

SamDel commented 5 years ago

I don't know if there's a way to designate a leader. I don't see an option in the Home app for it so I don't think it's possible.

FA-Bubba commented 5 years ago

The more I look into this, I am getting the idea that the WiFi is OK, but the Chromecast devices are dropping-off for other reasons... perhaps they are flawed.

A network analyzer shows strong WiFi in every location where I have speakers (of course, WiFi could be dropping-out randomly...)

I'm not sure how to confirm if the issue is with teh devices or with my WiFi, and I will continue to monitor the WiFi signal.

Any suggestions are welcome.

Thank you!

FA-Bubba commented 5 years ago

I tried the "Reset Settings" to eliminate the 'rogue device', but it still shows up in the Device List. I tried casting to just that Device; it's box turned green, and said "Connected", then "Playing". Audio is coming from the speaker set that originally had this name. Choosing the renamed speaker set in the Device Box also plays to this speaker set. In other words, ONE speaker set is showing up in DAS twice with different names. The old name is not displaying in the Google Home App, which is what I expected, but it is populating into DAS.

Not a big deal, but an annoyance...

FA-Bubba commented 5 years ago

Something weird happened to ver 2.4.3: After a PC reboot, when I load DAS 2.4.3, it briefly displays on screen, then disappears. It is showing as running in the Task Bar, and in the System Tray, and I can even select devices by right-clicking the System Tray icon. Since I cannot get the App window to display, I cannot get to the Log...

I tried the "Repair" option, but that didn't help. I tried "Uninstall" & then reinstalled it, but the App window still disappears just after loading.

I uninstalled v 2.4.3 then installed v 2.4.1, which is working OK now (but still shows the old renamed Device).

SamDel commented 5 years ago

There's a bug in 2.4.3, the window's position is kept but sometimes it's restored off scrren. Should be fixed in Setup 2.4.7.

Can you post the log (for the renamed device)?

FA-Bubba commented 5 years ago

Thank you! I installed v 2.4.7, and it is working on screen.

I've attached a screen shot with annotations, and the Log. The original name was "Family Room Stereo Speakr", and I later changed it to "Family Room Speakers" in Google Home. I made similar changes to other speaker sets, and those changes completed OK. For this speaker set, Google Home only has the new name, and no references that I can find to the old name. I saw in the log that both names appear with the same IP address:

Discovered device: Family Room StereoSpeakr 192.168.1.114:8009 null Discovered device: Family Room Speakers 192.168.1.114:8009 null

Here is the log & ScreenShot: DevicesWithRogueSpeakerSet.zip

SamDel commented 5 years ago

I don't know why the old name is still discovered. Can you try 2.4.8?

FA-Bubba commented 5 years ago

Thank you.... I uninstalled 2.4.7 and installed 2.4.8.

In previous versions, ALL of my devices, even those not associated in a Group, would populate in to the Devices list; now devices not in any Group are not populating, so I cannot Cast to one of those if I wanted to. The 'rogue' Speaker Set is still populating, and one Group is listed twice. I clicked "Scan again..." a few times, but no change.

Log-2019-08-04-v2-4-8-RogueSpeakerSet.zip

GrahamDLL commented 5 years ago

A few weeks ago, the only way that I was able to fix a similar issue was to delete the DAS config file ... whose name I cannot now remember.

SamDel commented 5 years ago

It's a different situation for @FA-Bubba I think. Can you try 2.4.9?

FA-Bubba commented 5 years ago

I'm still getting connection errors and drop-outs when casting to a Speaker Group on v2.4.8.

Casting to individual speakers still works OK, but (as we know) the audio is not in sync -- sync is only an issue for me with 4 Speaker Sets that are in a large open area...

I'm not sure this is a network issue as much as it may be the 'rogue' Speaker Set that continues to be loaded into the Device List, even though that set was renamed several weeks ago, and no longer appears in Google Home.

Can you suggest a Config file I can delete that may purge this Speaker Set from DAS's latent history?

Thanks!

SamDel commented 5 years ago

The config file is in (take the latest version): C:\Users\<username>\AppData\Local\ChromeCast\ChromeCast.Desktop.AudioS<random>\<version>\user.config

You can also try to reboot the 'rogue' device.

FA-Bubba commented 5 years ago

Not sure what you mean by "reboot the 'rogue' device" (it does not physically exist). The old name "Family Room StereoSpeakr" persists in the Device List when the App loads.

I found the config file and removed these lines:

                    <DiscoveredDevice>
                        <Name>Family Room StereoSpeakr</Name>
                        <IPAddress>192.168.1.114</IPAddress>
                        <Port>8009</Port>
                        <Protocol />
                        <Usn>83240795-3321-77d7-9157-24f030eb8721</Usn>
                        <Headers>"md=Google Cast Group"</Headers>
                        <AddedByDeviceInfo>false</AddedByDeviceInfo>
                        <DeviceState>Connected</DeviceState>
                        <IsGroup>true</IsGroup>
                    </DiscoveredDevice>

Now it no longer populates into the Device List, so I am guessing this fixed the issue...

Since my router is set up to use DHCP, are the IP addresses in the config file updates when/if a speaker's IP address changes? Would there be any advantage if I were to assign static IPs to each speaker?


By the way, I noted that EVERY DAS version I have previously installed continues to have it's folder & config files, even though I have been uninstalling the old version when moving to a new version. Is there any reason to keep those old folders/files?

Thank you!

SamDel commented 5 years ago

Sorry, my mistake. I have to review:

GrahamDLL commented 5 years ago

Now MAC address / IP address is used to uniquely identify a device. Is there an 'ID' I can use for that? If so, is the IP address updated in the config file when it changes?

The MAC address for a device is unique and never changes ... You might not need the IP address if you are able to retrieve the MAC address.

FA-Bubba commented 5 years ago

I know the MAC address for all of my devices. How does can DAS be set to use MAC address instead of IP Address?

SamDel commented 5 years ago

@GrahamDLL : You're right, checking the MAC address is enough. The MAC address is returned by the device when you ask for it. The check for groups is on the group name. I think you can have two groups with the same name, so maybe I can add an 'ID' there later.

@FA-Bubba : Now I know what went wrong: Family Room StereoSpeakr was in the config as a group, <IsGroup>true</IsGroup>, that's why the check for an existing device failed (and why it was stiil in the application's device list, as a group).

I think it was in the config as a group because of a bug in saving the known devices. In 2.4.11 the MAC address is also saved so it can be used when merging the list of devices from the application with the list of known devices in the user.config file.

GrahamDLL commented 5 years ago

2.4.11

I had devices K, L, O and B plus groups D and A.

I changed D to Down using Google Home on Android device ... DAS showed Down and continued to show D

I changed A to All and DAS continued to show D and A. Scan for Devices and REset Settings did not remove A and D.

Logs and config before and after the change of A to All ...

log-and-config-01.zip

SamDel commented 5 years ago

Good testing, it doesn't work because the check is on group name. In 2.4.12 it's checking on an 'id'. (I'm not 100% sure that 'id' is unique for everyone.)

I had to click 'Scan again ...' to get the new group name in DAS.

FA-Bubba commented 5 years ago

@GrahamDLL: That is similar to what I was experiencing when a Speaker set I renamed continued to populate into the Device List (along with the new name). I edited the config file to remove old name entry. It was in a section like this:

                    <DiscoveredDevice>
                        <Name>Family Room StereoSpeakr</Name>
                        <IPAddress>192.168.1.114</IPAddress>
                        <Port>8009</Port>
                        <Protocol />
                        <Usn>83240795-3321-77d7-9157-24f030eb8721</Usn>
                        <Headers>"md=Google Cast Group"</Headers>
                        <AddedByDeviceInfo>false</AddedByDeviceInfo>
                        <DeviceState>Connected</DeviceState>
                        <IsGroup>true</IsGroup>
                    </DiscoveredDevice>

After I removed that section, the old Device name no longer populated into the Device List.

FA-Bubba commented 5 years ago

@SamDel: I am still selecting individual Devices for casting, instead of using a Speaker Group.

This seems to be working OK (except for the previously mentioned lack of sync issue). I have noted that when some Devices are not found, the associated Groups display a 'Connect Error' (screen shot attached), and I am assuming that 'missing devices' from the Group may be causing that...

I have also included a screen shot where ALL of my Devices are found, and I am individually Casting to every Device that is also in one or more Groups, but the "All Speakers" Group is displaying a 'Connect Error' (Log also attached).

All the selected Devices are streaming audio, so none of the Groups has any 'missing Devices'... What could be causing the 'Connect Error' for the All Speakers Group?

AllSpeakersConnectError.zip

Thank you!

SamDel commented 5 years ago

The application connects to the leader of a group (only). In the log I see the leader changes a couple of times. The application tries to connect to the new leader when it's discovered. In your log the new leader doesn't respond, i'm not sure why.

Maybe we should try a different strategy later: If a 'leader' doesn't respond then scan the other devices to see if they respond. Or reconnect when a leader doesn't respond. I'm not sure what to do in this scenario.

GrahamDLL commented 5 years ago

2.4.12

Changing group names now works as expected. DAS finds the new group name and drops the old group name when DAS is restarted and when clicking the "Scan for Devices" button. Thanks.

GrahamDLL commented 5 years ago

2.4.12

Changes to IP address handled well ... Started playing to group with three devices ... Unplugged device with IP ending 99 ... the two other devices stopped playing ... the two devices restarted playing without any action by me after about 10 seconds ... restarted missing device with a new IP ending 63 ... the 63 device started playing automatically after a few seconds.

ipchange.zip

FA-Bubba commented 5 years ago

I moved to Ver 2.4.12, and resumed casting to Speaker Groups instead of individual Devices. At first DAS did not find all devices (I think the Anti-Virus shut it down -- after the AV gave the App an OK, I loaded it again). All Devices & Groups populated the Device List, but one Group (All Speakers) populated twice, with the second instance showing a "Connect Error"**. I am currently Casting to two other Speaker Groups that do not overlap, and Audio is streaming OK. Will monitor this for the next few days.

** The Log shows this Group as being "Discovered" many times, with different IP Addresses.

Log-2019-08-18-v2-4-12-DupeSpkrGrp.zip

SamDel commented 5 years ago

Thanks @GrahamDLL : 99 was the leader, that's why the application had to reconnect, and why the playing stopped for 10 seconds.

@FA-Bubba : I also had a double group today with 2.4.12, Setup 2.4.13.zip fixed it for me.

FA-Bubba commented 5 years ago

In Ver 2.4.13... Still getting multiple instances of Speaker Groups. Log attached

Log-2019-08-26-v2-4-13-DupeSpkrGrps.zip

SamDel commented 5 years ago

In 2.4.14 devices that are in 'Connect Error' state are removed from the known devices list when you close the application. I think it can be improved later on...

FA-Bubba commented 5 years ago

Regarding "...devices that are in 'Connect Error' state are removed from the known devices list when you close the application." When the application is reopened, will it then search and find removed devices if they have reconnected?

FA-Bubba commented 5 years ago

Ver 2.4.14 -- Still seeing multiple instances of Speaker Groups. I am not Casting to Groups in this session (Log attached).

Log-2019-08-29-v2-4-14-DupeSpkrGrps.zip

SamDel commented 5 years ago

Regarding "...devices that are in 'Connect Error' state are removed from the known devices list when you close the application." When the application is reopened, will it then search and find removed devices if they have reconnected?

Yes!

Ver 2.4.14 -- Still seeing multiple instances of Speaker Groups. I am not Casting to Groups in this session (Log attached).

Also after you closed the application, and started the application again?

FA-Bubba commented 5 years ago

When I closed & restarted the App, the duplicate groups no longer populated into the Device Window.... Now I can resume using Speaker Groups!

Thank you!