question

Bubblesoft avatar image
Bubblesoft asked

Multiple issues

While integrating the Fling SDK in an Android app (running on non Amazon devices) using the built-in receiver on a Fire TV Stick, I encountered several issues: 1. The Fire TV stick is detected randomly between app starts. Sometimes it is detected, sometimes it isn't (listener not called). Detecting is started with DiscoveryController.start(" amzn.thin.pl", listener). This issue is hugely annoying. There's the possibility it could be due to my router or an issue with JMDNS and my router. Rebooting the router does not fix it and it is updated to its latest firmware. And a Chromecast present on the network is always detected via mDNS. Moreover, my app detects DIAL devices via SSDP, and the Fire TV as a DIAL device is always detected that way even when JMDNS part of the SDK does not detect it. I wish I could create a RemoteMediaPlayer from the DIAL discovery to workaround this issue and eliminate JMDNS entirely. Generally, rebooting the stick makes it discoverable again but not for long (2 app launches max). 2. When playing music (and maybe video) to the built-in receiver, the screen saver starts after a while (a few minutes), with its zoomed images animation being very stuttery (due to CPU usage playing music I believe). The screen saver should not start at all when playing media. 3. A minor one. When playing media, there's repeated logcat spam as Whisper communicates with the device: 08-14 16:39:39.928: I/WhisperLink(14584): TThreadPoolServiceRouter: INET: - Forwarding connection to Service: wlink_cb_1_ from Device: D8267BA7FB5EBDE28B41975FF7403817 Connection Id: 2694 Channel: inet 08-14 16:39:39.929: I/WhisperLink(14584): TWhisperLinkTransport - Initiating connection to Service: wlink_cb_1_ Connection Id: 2694 Channel: inet 08-14 16:39:40.032: I/WhisperLink(14584): TWhisperLinkTransport - Incoming connection from Device: D8267BA7FB5EBDE28B41975FF7403817 to Service: wlink_cb_1_ Connection Id: 2694 Channel: inet 08-14 16:39:40.032: I/WhisperLink(14584): TWhisperLinkTransport - Connection accepted for: sid: wlink_cb_1_ UUID: D8267BA7FB5EBDE28B41975FF7403817 Device Type: 8 Connection Id: 2694 Channel: inet 08-14 16:39:40.033: I/WhisperLink(14584): WPServer - WorkerProcess: Starting UUID: D8267BA7FB5EBDE28B41975FF7403817 Service Id: wlink_cb_1_ , Connection Id: 2694 Channel: inet 08-14 16:39:40.045: I/WhisperLink(14584): TWhisperLinkTransport - Closing connection for Service: wlink_cb_1_ isClient: true Connection Id: 2694 Channel: inet Message was edited by: Michael P. Message was edited by: Michael P. Message was edited by: Michael P.
amazon fling
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

memo@amazon avatar image
memo@amazon answered
Hi Michael, Can you please give some additional information 1) What device you are using? 2) What is your ROM version? 3) Please attach adb logcat output
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Bubblesoft avatar image
Bubblesoft answered
1. A Nexus 5 but it also happened on my Nexus 4. Another beta tester with different hardware reported also erratic discovery but it was more reliable for him than for me. Anyway I think I found the cause. At the same time my app starts the Fling discovery, it start its own SSDP discovery to discover UPnP/DLNA devices. I found that if instead I start the Fling discovery a few seconds later, the FireTV is almost always detected. Basically I'm waiting for my SSDP discovery to find the FireTV as a DIAL device (which always work), then start the Fling discovery. I suppose that JMDNS probes may get lost in case of huge multicast SSDP trafic. And my network has a lot of UPnP/DLNA devices that are responding. Maybe this could be workarounded by making JMDNS more agressive. In the discovery department, it seems that the FireTV never notify its disappearance from the network resulting in the playerLost() callback never being called. For example, it doesn't when rebooting the FireTV via its Settings menu. 2. 54.1.2.1_user_121065320 I just saw there is an update, I will test it. 3. I already pasted the relevant bits. It simply spam these messages every second when playing a media to the default receiver
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Bubblesoft avatar image
Bubblesoft answered
Problem 2. still happens with the latest firmware, If the default receiver plays an audio track whose duration is greater than the screensaver kick-in duration (eg greater than 5 min by default), the screensaver starts while music is playing. For example, playing a 7 minute track, the screensaver starts after 5 minute into the track. Playing another media discards it.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

justin avatar image
justin answered
Thanks Michael for the details response and the valuable information. I am glad you were able to make progress. > it seems that the FireTV never notify its disappearance from the network resulting in the playerLost() callback never being called. For example, it doesn't when rebooting the FireTV via its Settings menu We have identified this issue as a limitation and work is ongoing to fix this. > I already pasted the relevant bits. I meant logcat related to the discovery issues (during the search). Regarding the spam, I agree it is a bit verbose. We are evaluating whether we can reduce the verbiage without compromising the diagnostic ability. > Problem 2. still happens with the latest firmware, We are not able to reproduce this with the media we were testing with. Is it possible for you to share the media URL? Not sure if the media rendering is handled differently for different formats?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Bubblesoft avatar image
Bubblesoft answered
> I meant logcat related to the discovery issues Here it is. To produce the log below, I reverted my old code launching discovery early, at the same time than launching SSDP discovery to handle UPnP/DLNA devices. Notice these suspicious lines: 08-29 16:20:10.366: E/WhisperLink(20092): PlatformCoreManager - Failed to start service router for udp, secure=true 08-29 16:20:10.367: E/WhisperLink(20092): PlatformCoreManager - Failed to start service router for udp, secure=false Could it be that JMDNS cannot create the multicast socket on port UDP 1900 (which the SSDP subsystem of my app also binds to ?). What is ever more suspicious is that discovery generally works the first time the app is started but fails with subsequent launches. As I mentionned earlier, I could somewhat workaround this issue by delaying the JMDNS discovery by a few seconds, starting it when the SSDP subsystem of my app detects the FireTV as a DIAL device. But I have the feeling it is just band aid, as although it improve discoverability by a lot, it still doesn't seem to be 100% reliable. //// 08-29 16:20:10.265: I/WhisperLink(20092): WPLOG - New log handler set is :com.amazon.whisperlink.platform.GenericAndroidLogHandler@ff6ae67 08-29 16:20:10.307: I/WhisperLink(20092): GenericAndroidPlatform - No Whisperplay XML, will not be hosting any services 08-29 16:20:10.309: I/WhisperLink(20092): PlatformOptionsImpl - Added memory channel as internal channel 08-29 16:20:10.312: I/WhisperLink(20092): PlatformCoreManager - Loading system services: 08-29 16:20:10.322: W/WhisperLink(20092): TExternalSocketFactory - Inet route refresh task cancelled or hasn't been scheduled 08-29 16:20:10.333: I/WhisperLink(20092): PlatformCoreManager - Registrar loaded. 08-29 16:20:10.333: I/WhisperLink(20092): PlatformCoreManager - ServiceDiscovery loaded. 08-29 16:20:10.335: I/WhisperLink(20092): DeviceManagerService - DeviceManagerService instanciating 08-29 16:20:10.336: I/WhisperLink(20092): PlatformCoreManager - DeviceManagerService loaded 08-29 16:20:10.341: W/WhisperLink(20092): EncryptionUtil - No random generator algorithm NativePRNG available, fall back to SHA1PRNG 08-29 16:20:10.343: I/WhisperLink(20092): PlatformCoreManager - AuthDaemonExternalService loaded. 08-29 16:20:10.344: I/WhisperLink(20092): PlatformCoreManager - AuthDaemonInternalService loaded. 08-29 16:20:10.366: I/WhisperLink(20092): PlatformCoreManager - loading routers 08-29 16:20:10.366: E/WhisperLink(20092): PlatformCoreManager - Failed to start service router for udp, secure=true 08-29 16:20:10.367: E/WhisperLink(20092): PlatformCoreManager - Failed to start service router for udp, secure=false 08-29 16:20:10.367: I/WhisperLink(20092): PlatformOptionsImpl - GenericAndroidPlatformInit for /data/user/0/ /files 08-29 16:20:10.642: I/WhisperLink(20092): SecurityManagerFactory - Finished initializing SecurityManagerFactory 08-29 16:20:10.642: I/WhisperLink(20092): PlatformOptionsImpl - GenericAndroidPlatformInit for /data/user/0/ /files 08-29 16:20:10.645: I/WhisperLink(20092): PlatformCoreManager - Loaded Service router for external transport=inet, secure=true 08-29 16:20:10.645: I/WhisperLink(20092): PlatformCoreManager - Loaded Service router for external transport=inet, secure=false 08-29 16:20:10.645: I/WhisperLink(20092): PlatformManager - Starting platform manager, counter=1 08-29 16:20:10.646: I/WhisperLink(20092): AccountHandler - Removed 0 authorizations with other devices. 08-29 16:20:10.650: I/WhisperLink(20092): GenericAndroidPlatform - Registering network state change listener, listener=com.amazon.whisperlink.platform.GenericAndroidNetworkStateChangeListener@1b1c02a 08-29 16:20:10.658: I/WhisperLink(20092): PlatformCoreManager - Starting WP System servers... 08-29 16:20:10.661: I/WhisperLink(20092): NetworkStateChangeListener - onReceive intent : android.net.conn.CONNECTIVITY_CHANGE 08-29 16:20:10.701: I/WhisperLink(20092): RegistrarService - Registering service amzn.auth.in from package 08-29 16:20:10.702: I/WhisperLink(20092): RegistrarService - Registering service amzn.auth.ex from package 08-29 16:20:10.711: I/WhisperLink(20092): WPServer - CONNECTION_POLICY_ONE_PER_REMOTE_DEVICE curr services=[] new services=[] 08-29 16:20:10.736: I/WhisperLink(20092): RegistrarService - Registering service amzn.endpoint from package 08-29 16:20:10.737: I/WhisperLink(20092): RegistrarService - Registering service amzn.dmgr from package 08-29 16:20:10.737: I/WhisperLink(20092): RegistrarService - Registering service amzn.reg from package 08-29 16:20:10.737: I/WhisperLink(20092): WPServer - CONNECTION_POLICY_ONE_PER_REMOTE_DEVICE curr services=[] new services=[] 08-29 16:20:10.772: I/WhisperLink(20092): PlatformCoreManager - Start listening on external connections 08-29 16:20:10.781: I/WhisperLink(20092): JmdnsManager - Starting JMDNS 08-29 16:20:10.803: I/WhisperplayControllerAdapter(20092): WhisperLinkPlatform connected 08-29 16:20:10.814: I/WhisperLink(20092): WhisperLinkUtil - Adding processor to WPServer :com.amazon.whisperplay.fling.media.controller.impl.RegistrarListener@1550265: is data provider :false 08-29 16:20:10.814: I/WhisperLink(20092): WhisperLinkUtil - Adding processor to WPServer :com.amazon.whisperplay.fling.media.controller.impl.ProxyStatusCallback@70afb3a: is data provider :false 08-29 16:20:10.814: I/WhisperplayControllerAdapter(20092): WhisperLinkPlatform connected - start callback handler 08-29 16:20:10.817: I/WhisperLink(20092): RegistrarService - Registering service wlink_cb_0_ from package 08-29 16:20:10.818: I/WhisperLink(20092): RegistrarService - Registering service wlink_cb_1_ from package 08-29 16:20:10.818: I/WhisperLink(20092): WPServer - CONNECTION_POLICY_ONE_PER_REMOTE_DEVICE curr services=[] new services=[] 08-29 16:20:10.820: I/WhisperplayControllerAdapter(20092): WhisperLinkPlatform connected - init registrarListener 08-29 16:20:10.823: I/WhisperLink(20092): DeviceCallbackRegistry - Adding callback, type=com.amazon.whisperlink.service.RegistrarCb, callback=[devicecb: device=[device: local=true, uuid=F36648C4859617CDA6B75282CE64C56F], cb=Description(sid:wlink_cb_0_ , friendlyName:null, accessLevel:0, security:0, flags:0, version:0), channel=memory, connInfo=null] 08-29 16:20:10.823: I/WhisperplayControllerAdapter(20092): initRegistrarListener - searchAll 08-29 16:20:10.823: I/WhisperplayControllerAdapter(20092): Number of initial devices supporting:0 08-29 16:20:10.823: I/WhisperplayControllerAdapter(20092): WhisperLinkPlatform connected - synchronized enter 08-29 16:20:10.823: I/WhisperplayControllerAdapter(20092): WhisperLinkPlatform connected - synchronized exit 08-29 16:20:10.870: I/WhisperLink(20092): JmdnsManager - Not searching, account hint null or empty > > Problem 2. still happens with the latest firmware, > > We are not able to reproduce this with the media we > were testing with. Is it possible for you to share > the media URL? Not sure if the media rendering is > handled differently for different formats? To reprod: - make sure the screensaver is enabled with a timeout of 5 minutes - play any mp3 [b]longer than 5 minutes[/b] to the default receiver => 5 minutes after playback started, the (jerky) screensaver kicks in
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

memo@amazon avatar image
memo@amazon answered
Hi Michael, We've done some digging, and can now confirm that, this is the correct behavior. Only Video playback will prevent Screensaver as Audio can be heard while the screen saver is on. Thanks,
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Bubblesoft avatar image
Bubblesoft answered
@memo Ok, thanks for looking. Still it seems a little weird to have the screensaver kick in in the middle of a music track, especially since the animated screen saver is not smooth due to CPU usage playing audio...
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.