minshikshin / google-cast-sdk

Automatically exported from code.google.com/p/google-cast-sdk
0 stars 0 forks source link

Chromecast is sending disconnect command due to heartbeat timeout, preventing graceful reconnect #640

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Note this is only happening on certain devices:

What steps will reproduce the problem?
1. Open Haystack TV 
2. Cast a video and put the app aside, waiting for the screen to turn off on 
the device.
3. Wait a few minutes while a video or two plays.
4. Open the device , when Haystack TV resumes you will notice that the 
Chromecast disconnects, Haystack TV can not use Chromecast reconnect because it 
got a disconnect command :

D/CastDeviceController( 1101): [controller-0020 API] disconnecting due to 
heartbeat timeout

What is the expected output? What do you see instead?

Ideally the disconnect command is not sent. This way when the app resumes it 
can gracefully reconnect to the Chromecast session (Haystack TV enables 
Chromecast reconnect provided we did not receive a disconnect command).

What version of the product are you using? On what operating system?

This is happening with a Nexus 7 1st gen tablet running version 4.2.2 of 
Android.

Please provide any additional information below.

I'm attaching a log file captured when this issue happened.

Original issue reported on code.google.com by ish...@gmail.com on 29 Aug 2015 at 12:52

Attachments:

GoogleCodeExporter commented 9 years ago
Are you using the Cast Companion Library in your app? We highly recommend that 
you use CCL instead of trying to implement your own reconnection logic.

Original comment by jonathan...@google.com on 31 Aug 2015 at 11:46

GoogleCodeExporter commented 9 years ago
Yes we are using the Cast Companion Library right now and are following it for 
our reconnection logic.

Original comment by i...@haystack.tv on 3 Sep 2015 at 7:05

GoogleCodeExporter commented 9 years ago
When did you first start seeing this issue?
Do you see it on any other devices (Android/iOS)?
Is more than one video playing on the device before it goes to sleep?
Just to double check, you're using the latest version of CCL, correct?

Original comment by jonathan...@google.com on 3 Sep 2015 at 10:31

GoogleCodeExporter commented 9 years ago
We are on CCL version 2.1.1. 

We observe the issue also when only one video is playing, it seems to have less 
to do with multiple videos and just how long the screen is off.

In house we are only seeing this on this Android Device running 4.2.2. (we have 
an iOS version but have not seen this problem there). We can't reproduce on 
newer versions of Android. 

Original comment by ish...@gmail.com on 3 Sep 2015 at 11:26

GoogleCodeExporter commented 9 years ago
Are you seeing this issue with the CastVideos app (from GitHub) as well?

Original comment by jonathan...@google.com on 4 Sep 2015 at 3:22

GoogleCodeExporter commented 9 years ago
We just tested with the latest version of CastVideos / CCL on GitHub and the 
issue is happening there as well. We cast the video and then the screen goes 
off. After about a minute we turn the screen on and the Chromecast has 
disconnected from the tablet, though the video keeps playing on the television.

Original comment by ish...@gmail.com on 4 Sep 2015 at 6:28

GoogleCodeExporter commented 9 years ago
So when the device wakes up and your wifi reconnects to the access point it was 
previously connected to, is the app still unable to reconnect to the Chromecast?
Also, what version of Google Play Services are you using?

Original comment by jonathan...@google.com on 4 Sep 2015 at 11:32

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
After the screen turns off the wifi never drops on the device. After the user 
turns on the screen the device is no longer casting (i.e. although the TV still 
shows the session the device appears to have lost the connection). 

If the user taps on the chromecast icon then it successfully reconnects to the 
existing chromecast session.

The google play services version on the device is 7.8.99(2134222-030)

Original comment by ish...@gmail.com on 11 Sep 2015 at 12:18

GoogleCodeExporter commented 9 years ago
Can you run the CastVideos app, try to reproduce the issue there, capture the 
logs, and send them to us?

Original comment by jonathan...@google.com on 11 Sep 2015 at 5:38

GoogleCodeExporter commented 9 years ago
Hi there, attached here is the log we captured from running CastVideos and 
reproducing the issue.

Original comment by ish...@gmail.com on 15 Sep 2015 at 5:29

Attachments:

GoogleCodeExporter commented 9 years ago
When you reproduced the error in #11, was that with CCL version 2.4?

Original comment by jonathan...@google.com on 15 Sep 2015 at 5:43

GoogleCodeExporter commented 9 years ago
Its CCL version 2.1. We can try it on 2.4 and let you know.

Original comment by ish...@gmail.com on 15 Sep 2015 at 5:57

GoogleCodeExporter commented 9 years ago
Yes, please do.

Original comment by jonathan...@google.com on 15 Sep 2015 at 5:58

GoogleCodeExporter commented 9 years ago
We re-checked and the CCL version was in fact 2.4 for the log report we sent 
out. The use case is working fine on all other devices except for the Nexus 7 
1st gen tablet. 

Original comment by ish...@gmail.com on 18 Sep 2015 at 5:29

GoogleCodeExporter commented 9 years ago
Please reproduce the issue again and make sure you're capturing the CCL logs. 
You can do  this by setting DEBUG=true in CCL in "LogUtils.java" class.

Original comment by jonathan...@google.com on 18 Sep 2015 at 6:35

GoogleCodeExporter commented 9 years ago
Were you able to reproduce the issue and get the CCL logs? If so, please 
provide them here.

Original comment by jonathan...@google.com on 25 Sep 2015 at 4:11