Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jellyfin Duplicate Chromecast Media Players #108276

Open
crazystick opened this issue Jan 18, 2024 · 7 comments
Open

Jellyfin Duplicate Chromecast Media Players #108276

crazystick opened this issue Jan 18, 2024 · 7 comments
Assignees

Comments

@crazystick
Copy link

The problem

Jellyfin creates a new Chromecast device/entity every time you play something using the native Jellyfin app on Android.

This seems to be the same as issue #105000 but since I don't use AppleTV I don't know what Swiftfin is so not sure what the resolution might be.

What version of Home Assistant Core has the issue?

core-2023.11.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Jellyfin

Link to integration documentation on our website

No response

Diagnostics information

config_entry-jellyfin-787b9eb6dd7dfe73d109348717be4c1b.json.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

Hey there @j-stienstra, @ctalkington, mind taking a look at this issue as it has been labeled with an integration (jellyfin) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of jellyfin can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign jellyfin Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


jellyfin documentation
jellyfin source
(message by IssueLinks)

@tim-hitchins-ekkosense
Copy link

tim-hitchins-ekkosense commented Feb 21, 2024

@crazystick On your Jellyfin server do you have DLNA "Play To" enabled?

  1. Login as an admin user
  2. Open the hamburger menu
  3. Under Administration click Dashboard
  4. Under Devices click DLNA

It's the top checkbox under "Settings". I have a misbehaving Toshiba TV which was showing up as 200 separate DLNA cast targets. Turning that off has stopped it from happening, with the downside I can't use the DLNA Cast feature.

@crazystick
Copy link
Author

@tim-hitchins-ekkosense I tried your suggestion but it doesn't seem to have improved matters. I removed and readded the integration which got rid of most of the entities, but they are still going up.

@ctalkington
Copy link
Contributor

the common issue is that devices are created based on the reporting that the session device supports persistent identifier. The client applications report this to the server but they usually use some method on the client device as the identifier and its expected to be persistent.

However, client devices can regenerate identifier to improve privacy that can cause the identifier to be less persistent than thought. Think of it like resetting Google advertising IDs on Android devices.

@ctalkington
Copy link
Contributor

ctalkington commented Mar 30, 2024

for chromecast, it's deriving deviceId by base64 the name of receiver or first sender ID or time. This likely leads to the growing list of devices.

https://github.com/jellyfin/jellyfin-chromecast/blob/66a21d2df36ed7d3d69cfec44ec8e8180d858f34/src/components/jellyfinApi.ts#L33-L49

https://github.com/jellyfin/jellyfin-chromecast/blob/66a21d2df36ed7d3d69cfec44ec8e8180d858f34/src/components/maincontroller.ts#L310

so it's actually not creating persistent identifier and properly reports SupportsPersistentIdentifier: false so you see the media players still because its generating new playback session ids

However, in your diagnostics, most your chromecast seem to report SupportsPersistentIdentifier: true which is intriguing

@ctalkington
Copy link
Contributor

I'm wondering if we should just ignore sessions where the device_id starts with "chromecast_" as it seems like these are transient sessions and keeping them around as entities wouldn't have any benefit

@golles
Copy link
Contributor

golles commented May 20, 2024

I don't think this issue is only related to Chromecast devices. also to iPhone apps (Finamp and the regular app) and the LG Smart TV app.

For the record, there is only one actual iPhone and LG Smart TV device.

Entities (x watching sensor I kept out of the screenshot):
Scherm­afbeelding 2024-05-20 om 15 32 32
Devices:
Scherm­afbeelding 2024-05-20 om 15 33 32

In the past, I've deleted these duplicate media_player entities several times but they are coming back

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants