Git Product home page Git Product logo

Comments (9)

garbled1 avatar garbled1 commented on September 23, 2024

OK, so, in firefox, when I pull up the list of remote devices, even though plexdlnaplayer has 3 devices, I only see one of the three. If I watch the network, your code responds with GDM responses for all 3 devices that I have, in order.

What I've discovered, is that the web player only "sees" the last one to respond.. meaning, if plexdlnaplayer replies with "Device A", "Device B", "Device C" in order, only C is seen. If I restart it, and the order changes, say to B,C,A it only sees "A".

My phone however, is totally random. It will see 2-3 devices sometimes, and most of the time none. Plexamp never sees them.

Interestingly, plexamp sees my mobile devices all the time, pretty much religiously, so, there is a difference there, I'm not sure what..

tcpdump from a mobile device running the plex app.

06:45:41.896439 IP Galaxy-S9.garbled.net.32412 > musica.58487: UDP, length 361
E.....@.@..=......
M~..w.q!.HTTP/1.0 200 OK
Content-Type: plex/media-player
Resource-Identifier: 5adf45b5d3f68ae7-com-plexapp-android
Updated-At: 1639229598
Version: 8.26.2.29389
Protocol-Version: 1
Port: 32500
Product: Plex for Android (Mobile)
Protocol: plex
Device-Class: mobile
Protocol-Capabilities: timeline,playback,mirror,playqueues,provider-playback
Name: Galaxy S9

Tcpdump from the DLNA player (I added Updated-At:, which seems to help a little bit..)

07:12:12.077234 IP mirzam.garbled.net.32412 > musica.58487: UDP, length 298
E..F.+@.@.....
N..
M~..w.2./HTTP/1.0 200 OK
Name: Spa Room
Port: 32488
Content-Type: plex/media-player
Product: Plex DLNA Player
Protocol: plex
Protocol-Version: 1
Protocol-Capabilities: timeline,playback,playqueues
Version: 1
Resource-Identifier: 2fbeb30e-e21a-1290-0080-0005cda8ccee
Updated-At: 1639231932
Device-Class: stb

07:12:12.077321 IP mirzam.garbled.net.32412 > musica.58487: UDP, length 297
E..E.,@.@.....
N..
M~..w.1..HTTP/1.0 200 OK
Name: Kitchen
Port: 32488
Content-Type: plex/media-player
Product: Plex DLNA Player
Protocol: plex
Protocol-Version: 1
Protocol-Capabilities: timeline,playback,playqueues
Version: 1
Resource-Identifier: a34cc3a1-6c34-1b9a-0080-0005cda88522
Updated-At: 1639231932
Device-Class: stb

07:12:12.077375 IP mirzam.garbled.net.32412 > musica.58487: UDP, length 298
E..F.-@.@.....
N..
M~..w.2./HTTP/1.0 200 OK
Name: Bathroom
Port: 32488
Content-Type: plex/media-player
Product: Plex DLNA Player
Protocol: plex
Protocol-Version: 1
Protocol-Capabilities: timeline,playback,playqueues
Version: 1
Resource-Identifier: a2d20f63-f7e0-1b18-0080-0005cdacce92
Updated-At: 1639231932
Device-Class: stb

from plexdlnaplayer.

garbled1 avatar garbled1 commented on September 23, 2024

OK, I now understand the bind to devices page better. You have to go to plex.tv, input the code, then immediately go back to the devices page, and click check linked. Unless you do this, it does not save the pin state to data.json. after doing that, suddenly plexamp can see them.

from plexdlnaplayer.

garbled1 avatar garbled1 commented on September 23, 2024

The other problem I'm having, also has to do with multi-devices. When you pick a remote player in android, it sends the following to plexdlnaplayer:

GET /resources?X-Plex-Language=en-us HTTP/1.1

Which it 404's because it doesn't include a specific device. I think, the client here is expecting a list of devices, as seen:
https://github.com/plexinc/plex-media-player/wiki/Remote-control-API
Under the mediacontainer docs, where it says you can return a list of devices if you support multiple devices.

What I'm unsure about, is what the proper uuid to return in the header would be. We are getting the uuid from each of the devices, so.. hrmm.

Part of me thinks the whole thing should fire up a separate web UI for each device, and just report the singular uuid and device in that one UI, so you have multiple ports, not just the 32448 one, like a range of ports. Maybe I'll try to implement that instead.

from plexdlnaplayer.

garbled1 avatar garbled1 commented on September 23, 2024

Also, just writing this one down for notes: The android client sends over when it starts/wakes up:

M-SEARCH * HTTP/1.1
HOST: "239.255.255.250:1900"
MAN: "ssdp:discover"
MX: 1
ST: urn:schemas-upnp-org:device:ZonePlayer:1

from plexdlnaplayer.

garbled1 avatar garbled1 commented on September 23, 2024

an Ipad sends the following, just for notes again:
GET /resources?X-Plex-Language=en&X-Plex-Device-Name=Lucy%20F.%20Lucy%E2%80%99s%20iPad HTTP/1.1

from plexdlnaplayer.

garbled1 avatar garbled1 commented on September 23, 2024

I think I have this all working now in my res_fixes branch, need a bit more testing, then will PR a fix.

from plexdlnaplayer.

songchenwen avatar songchenwen commented on September 23, 2024

Wow, you've done a lot work here. I'm sorry for the late response. I'm giving all my spare time to snowboarding lately.

I didn't test any android devices and am surprised that they behave differently from the iOS devices.

I don't think firing up a separate web server for every DLNA device will be a good idea, unless necessary. A separated web server will need its separated resource, firing too many web servers up will slow down the entire server. Is there a way to return a list of devices? Since you already have some ideas, I'll just wait for your PR and do some tests.

from plexdlnaplayer.

garbled1 avatar garbled1 commented on September 23, 2024

No problem, thanks for taking a look.
The problem I have is fiddly...and there are 2 sides to it:

  1. When the program sends GDM's to plex, plex basically takes only the last one, because they all use the same port.
  2. The android client, then turns around and connects to plexdlnaplayer, and just issues /resources, with no identifiers to see what is there. I could probably make that part work, but the headers are a bit of an issue there, and it still doesn't solve issue 1, which messes up the web client.

My solution was to fire up multiple tasks of the fastapi server, but have them all share the same DLNA data and backend, so each device is tied to a unique port. It doesn't really seem to use that much more resources than the single one. Maybe I can get some final testing in today, and PR something for you to look at.

Thanks for your work on this though, it's given me hope for having all these speakers work. I'm inches away from my ideal setup here. :)

from plexdlnaplayer.

ptyork avatar ptyork commented on September 23, 2024

Sorry for surfacing an old issue, but @garbled1, any luck with getting things to work? I'm basically in the same boat. I can't play to any of the DLNA renderers and I suspect it is because there are multiple. As you noted in Plex Web, I see only one random one, and it even sometimes works. Once I navigate to the bind page (took me forever to figure this part out...anyone reading this, navigate to http://: with port PROBABLY being 34288, link to the device, AND come back and click Verify), I can SEE the two devices in PlexAmp. But I can't switch to either of them. Same behavior on Windows, iOS and Android.

from plexdlnaplayer.

Related Issues (19)

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.