GithubHelp home page GithubHelp logo

Comments (19)

eman8519 avatar eman8519 commented on July 28, 2024 11

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.

erikos avatar erikos commented on July 28, 2024 1

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.

andriydruk avatar andriydruk commented on July 28, 2024 1

@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.

hossain-khan avatar hossain-khan commented on July 28, 2024

Note: The app does work on Android 8.0.0 runnion on OnePlus 5.

from rxdnssd.

andriydruk avatar andriydruk commented on July 28, 2024

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.

hossain-khan avatar hossain-khan commented on July 28, 2024

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.

hossain-khan avatar hossain-khan commented on July 28, 2024

@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.

andriydruk avatar andriydruk commented on July 28, 2024

@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.

hossain-khan avatar hossain-khan commented on July 28, 2024

@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.

zarkooroz avatar zarkooroz commented on July 28, 2024

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:
img_20180406_103439 1

from rxdnssd.

andriydruk avatar andriydruk commented on July 28, 2024

@zarkooroz did you try DNSSDEmbedded?

from rxdnssd.

zarkooroz avatar zarkooroz commented on July 28, 2024

@andriydruk No, we are using DNSSDBindable. Current version is 0.9.5
Do you think that DNSSDEmbedded could solve the issue?

from rxdnssd.

andriydruk avatar andriydruk commented on July 28, 2024

@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.

zarkooroz avatar zarkooroz commented on July 28, 2024

@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.

eman8519 avatar eman8519 commented on July 28, 2024

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.

hossain-khan avatar hossain-khan commented on July 28, 2024

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.

screenshot_20180526-130654

from rxdnssd.

andriydruk avatar andriydruk commented on July 28, 2024

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.

andriydruk avatar andriydruk commented on July 28, 2024

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.

kostadin24 avatar kostadin24 commented on July 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.