Comments (19)
For anyone interested in this I have found a workaround for this issue, though it may be something that Google has implemented on purpose for battery life, efficiency, or some other reason, I found that by explicitly requesting a Multicast lock begins allowing packets to be delivered again which allows RxDNSSD to work properly.
Be sure your AndroidManifest.xml
contains:
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Then when you start your discovery/browse function simple acquire a multicast lock like so:
WifiManager wifi = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
WifiManager.MulticastLock multicastLock = wifi.createMulticastLock("multicastLock");
multicastLock.setReferenceCounted(true);
multicastLock.acquire();
Then teardown the lock once you complete your browsing:
if (multicastLock != null) {
multicastLock.release();
multicastLock = null;
}
@andriydruk I don't know how you feel about this being a part of this library, but if you would like for me to take a stab at it please let me know. I'll be happy to add it in the appropriate places. Part of me feels this is a workaround/hack, but another part of me thinks this could be deliberate from Google on the Pixel 2.
from rxdnssd.
We likely seeing the same issue on a device, Pixel 2 with 8.1.0, where services can not be discovered. Was there any further find on the issue?
from rxdnssd.
@zarkooroz mostly unwillingness to support it because on most devices Bindable works fine
But then I assumed that Google might broke system's mDNSReposnder in future versions of Android and undeprecated it.
from rxdnssd.
Note: The app does work on Android 8.0.0 runnion on OnePlus 5.
from rxdnssd.
Hi, I've just checked Pixel with 8.1.0 and all works fine
I guess this isssue is not about Oreo. Are you sure that device was connected to wifi network with at least 1 service? Did you check other applications?
From logs it looks like there are no issue with dnssd and no devices in current network
from rxdnssd.
hey @andriydruk I have tested with with Pixel 8.1.0 too, and it works without any issue.
Looks like it's hardware specific issue for Pixel 2 and Pixel 2 XL. Do you have access to any Pixel 2 devices?
Not sure how to capture data so that I can file to Google. Let me know what I should be looking at to report it to Google.
from rxdnssd.
@andriydruk One thing I observed is, if I use zero config app https://play.google.com/store/apps/details?id=com.melloware.zeroconf and launch it, then the app immediately shows the devices in network.
After that if I switch back to Service Browser app, it also works immediately.
from rxdnssd.
@amardeshbd I'm investigating this issue. Sorry, but I still can't find Pixel 2 or OnePlus 5 or HTC U11
I tried one of last Samsung here, but their don't have any services in networks there(
If you know similar services with remote testing please let me know
As I understood there are no messages about errors in logs, right?
from rxdnssd.
@andriydruk Yes, that is correct. There is absolutely no indication of error/warning in the log that would say why the discovery is stuck. 😞
I can try to re-run the library and capture log again with Pixel 2 and 2 XL. If I have time, I will try to debug the library and provide feedback if I have any.
from rxdnssd.
Just to add, we had same report for Pixel 2. I managed to get Pixel 2XL and on that device service discovery was working just fine.
Here are the phone specs:
from rxdnssd.
@zarkooroz did you try DNSSDEmbedded?
from rxdnssd.
@andriydruk No, we are using DNSSDBindable. Current version is 0.9.5
Do you think that DNSSDEmbedded could solve the issue?
from rxdnssd.
@zarkooroz Yes, embedded should work on any device - but might starts search little bit slower because it starts own version of mDNSReposnder instead of binding to system mDNSReposnder
from rxdnssd.
@andriydruk I saw that that version was deprecated at some point, so we did not consider it.
What was the reason for its deprecation/un-deprecation if I may ask? :)
from rxdnssd.
Hey guys....joining the fold here as well. I have the same issue described here on a Pixel 2XL on 8.1.0, and have been troubleshooting for the past couple of days. I have attempted DNSSDBindable, and DNSSDEmbedded. I get the same results (or lack there of) with both. I even took it a step further and attempted to use the core Android NsdManager and still can't discover services.
Has anyone else here found a solution yet, I also am happy to help work on this issue as well, but don't want to step on top of any work already being done.
from rxdnssd.
That's an interesting find @eman8519 I will give it a try and provide feedback.
About putting it in the library, not sure if it feels right. If I remember correctly, it's not necessarily 8.1.0
specific issue. My OnePlus 5 got updated to 8.1.0
and it works on that phone.
from rxdnssd.
Hi, @eman8519
Thank you for your feedback.
As for me, I don't think it's a workaround or hack. It's logical that if mDnsResponder use multicasts for delivering packages, the library should ask system don't cut multicasts.
Actually, I thought about it at the moment of creating this library, but at that time there wasn't any issue connected to this, that's why I skipped lock to not overwhelm library.
Now I feel that we should add locks inside the library to prevent issues like this in future.
Correct places for lock onServiceStarting and onServiceStoping. These methods would be called at every operations, that's why we need counter for runned operations. Take a look at embedded version, its already contains mechanism for starting/stoping deamon
from rxdnssd.
Hi, everyone
I've just published a new version. It includes wifi locks for all operations.
https://github.com/andriydruk/RxDNSSD/releases/tag/0.9.10
from rxdnssd.
Well, I tried Service Browser on Samsung S8+ with android 8.1
Unfortunately problem with discovery still exist. Used last version 0.9.10
No errors in log.
Discovery works for 1-2 minutes after router reseting and stops. But other manifacturers still work.
from rxdnssd.
Related Issues (20)
- The return value of reconfirmRecord HOT 3
- ServiceLost() is not called when the service is closed without unregistration HOT 1
- Crash observed on DNSSDBindable.onServiceStarting HOT 1
- Crash on DNSSD$4.lambda$queryAnswered$0
- How to continuously TXT records by using 0.9.13? HOT 3
- multicastlock is bugged in that it creates multiple acquires HOT 6
- RxDNSSD do not work in some Wifi & subscription.unsubscribe() not calls when I turn OFF WIFI/HotSpot HOT 1
- Crash in register BonjourService Rx2Dnssd on Redmi3s with MIUI/Mashmallow HOT 4
- Migration away from JCenter HOT 5
- The Demo APP crash HOT 8
- service lost issue HOT 1
- txtRecord is getting null HOT 3
- @abdur999 Please try Rx2DnssdBindable HOT 2
- Android 12 HOT 24
- [Bug]: Android 12 on Pixel causes "DNS-SD Error -65563: SERVICENOTRUNNING" HOT 2
- [Bug]: JNI DETECTED ERROR IN APPLICATION: java_class == nul at com.github.druk.dnssd.DNSSD$1.serviceFound(com.github.druk.dnssd.DNSSDService, int, int, byte[], byte[], byte[]) HOT 2
- [Question]: How to resolve `.local` hostnames?
- 🚀 New Release? HOT 2
- [Bug]: NullPointerException: Null value passed for browser parameter to BrowseListener.serviceFound()
- [Bug]: NullPointerException: Null value passed for resolver parameter to ResolveListener.serviceResolved()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rxdnssd.