Closed bousqi closed 3 weeks ago
I'm wondering if the following isn't the one that broke it https://github.com/jellyfin/jellyfin-plugin-dlna/commit/539b9704a9da2a91abd8ff0495b3a22c29e76043
This line here where the path is constructed https://github.com/jellyfin/jellyfin-plugin-dlna/blob/f7a4beaa5e12cfa40c38df49b97a23556a285773/src/Jellyfin.Plugin.Dlna/Main/DlnaHost.cs#L242. I just don't know what to do to add the baseurl :)
This is a known issue and is in our documentation. BaseURLs will break DLNA.
This line here where the path is constructed
. I just don't know what to do to add the baseurl :)
As the v2 plugin was working fine with baseUrl, is there any chance to try to revert changes related to this line to eventualy insert again the baseUrl as expected ? (I'll have a look, but if it was obvious, you would have already fixed it)
May I add another side effect ? But I'm not sure about this one. My DLNA plugin works fine only if I configure the Jellyfin binding address to 192.168.XXX.YYY only. If i let the field empty, server listens on all interfaces including loopback (127.0.0.1).
The DLNA client get the broadcast from server, and tries to fetch description.xml from 127.0.0.1 🤦🏻♂️ which is client node, not server ! Maybe loopback interface should be removed to avoid advertising it, don't you think ?
Thanks
@OoberMick
Previously, the URI was built differently : https://github.com/jellyfin/jellyfin-plugin-dlna/commit/539b9704a9da2a91abd8ff0495b3a22c29e76043#diff-a5763f20531db618e1015248df46c6c4d64fc2c66c05eb3d9d3b933ef77e29bdL262
Thus I recommend to revert the following line :
GetApiUrlForLocalAccess
can be found on the link bleow, and it seems to add the baseUrl.
https://github.com/jellyfin/jellyfin/blob/75bbd3029613829a9b55ac01e27093583fc8cf52/Emby.Server.Implementations/ApplicationHost.cs#L909
@disgustipated can you please elaborate on your commit https://github.com/jellyfin/jellyfin-plugin-dlna/commit/539b9704a9da2a91abd8ff0495b3a22c29e76043 and why you had to remove this API call ?
From what I found that api call was introduced when dlna was converted to a plugin and broke dlna completely if you were using a published uri. more details here https://github.com/jellyfin/jellyfin-plugin-dlna/issues/55
Interesting. I found two issues that I've been able to solve to make v2 plugin working on my network using a docker. As I said, v3 broke the baseURL so I had to revert to v2. On top of that I had three binding addresses on DLNA. 192.x.x.x 172.x.x.x 127.0.0.1. The DLNA plugin was advertising on the wrong interface, mainly localhost. So I had no other choices than to restrict Jellyfin to my only relevant 192.x.x.x interface and update my NGINX to redirect to 192 instead of localhost.
So long story short, v2 works correctly with baseURL (we should keep the mentionned lines as they were). However I would suggest to exlcude 127.0.0.1 from advertised interfaces. I think that one breaks plugin (on my setup it was randomly working).
I would like to help on that, at least I can test for you or eventually I can try to build plugin but I'm missing the procedure.
EDIT : when trying to debug v2 plugins, I realized that the client only kept the 127.0.0.1 advertisement, that's why I had the idea to force jellyfin binding only on the expected interface.
From what I found there had been a lot that was changed with converting dlna to a plug-in. I'm not convinced that just changing to GetApiUrlForLocalAccess call will resolve your issue. with your example url you posted, was this pulled from your known working version in your logs which includes the baseurl setting? http://192.168.26.251:8096/**vod/jellyfin/**dlna/3466f6be-a3c9-467e-8011-0db496551223/description.xml
In the UriBuilder on my test box I reverted the intf.Address to use _appHost.GetApiUrlForLocalAccess(intf.Address, false) again and it did not include the baseurl setting from the main config in the publishing log message, it did begin using my published uri value though so using that call did change what it was publishing. This is from my log when i added the GetApiUrlForLocalAccess back in *and included a baseurl in my config:
[13:12:16] [INF] [1] Jellyfin.Plugin.Dlna.Main.DlnaHost: Registering publisher for urn:schemas-upnp-org:device:MediaServer:1 on myipaddress with uri http://mypublisheduriFQDN:8096/dlna/c8b0ef14-a211-4026-9ade-5e9136a28ab4/description.xml
Also note, as mentioned previously in this thread, baseurl breaks dlna.
Another thought thread - if youre using nginx, why are you specifying a base url in jellyfin and not setting up a subdirectory directive in nginx and pointing nginx to your container ip and port?
In the API, we can see that BaseURL must be added:
/// <inheritdoc/>
public string GetApiUrlForLocalAccess(IPAddress ipAddress = null, bool allowHttps = true)
{
// With an empty source, the port will be null
var smart = NetManager.GetBindAddress(ipAddress, out _, false);
var scheme = !allowHttps ? Uri.UriSchemeHttp : null;
int? port = !allowHttps ? HttpPort : null;
return GetLocalApiUrl(smart, scheme, port);
}
/// <inheritdoc/>
public string GetLocalApiUrl(string hostname, string scheme = null, int? port = null)
{
// If the smartAPI doesn't start with http then treat it as a host or ip.
if (hostname.StartsWith("http", StringComparison.OrdinalIgnoreCase))
{
return hostname.TrimEnd('/');
}
// NOTE: If no BaseUrl is set then UriBuilder appends a trailing slash, but if there is no BaseUrl it does
// not. For consistency, always trim the trailing slash.
scheme ??= ListenWithHttps ? Uri.UriSchemeHttps : Uri.UriSchemeHttp;
var isHttps = string.Equals(scheme, Uri.UriSchemeHttps, StringComparison.OrdinalIgnoreCase);
return new UriBuilder
{
Scheme = scheme,
Host = hostname,
Port = port ?? (isHttps ? HttpsPort : HttpPort),
Path = ConfigurationManager.GetNetworkConfiguration().BaseUrl
}.ToString().TrimEnd('/');
}
Call to GetApiUrlForLocalAccess
and call to GetLocalApiUrl
, and
Path = ConfigurationManager.GetNetworkConfiguration().BaseUrl
.
That should do the job, if not that my means that execution flow goes somewhere else ?
And if it might help, running 10.9.8 with v2 plugin works with BaseURL on my setup. It is only when moving to 10.9.11 with v3 that it breaks the DLNA support.
Please post your log on startup where the full uri that is being used to publish dlna is shown, you'll see a log entry similar to mine above. As I said, I just switched it back to GetApiUrlForLocalAccess and it did not show the base url on startup.
I recalled that the v2 logging did not post the full uri used in the logging which i had added. On my test box I pulled the v2 code which used the line youre pointing to and added the log line to post the full uri used. That still did not show the baseurl added, but i was still using the publishedurl config. once I removed the published url value the baseurl did begin to show. I also found some further peculiarity where the publishedURL setting in the UI will post "Unable to parse bind override" in the logging, however when using the setting in the docker config it binds properly, using this though GetApiUrlForLocalAccess does not seem to send the baseurl value along with it. To fix this for both situations where publishedurl is used and where it is not it might be better to use a method that can use ip addresses rather than the url which would fix both situations where publishedurl is being used and still adds the baseurl to the ip addresses. I wasnt able to see how to access the baseurl setting this morning but will check later.
I think the root of the problem here is that GetApiUrlForLocalAccess is not returning the baseurl when the published uri setting is in use. That functionality does make sense based on what the setting is for, completely overrides the url, however that could pose a problem with how the list of valid interfaces is currently built in this plugin as you would not want to use the published url (which could be a fqdn) for dlna, however if someone is using a local dns name in there for some reason it could break that as well. I feel the solution would be that the interface list should still be built based on the ips/interfaces rather than dns but would need to pull the baseurl into it.
Give this a shot to see if it resolves what youre seeing, I found how to pull in the BaseUrl and mocked this up and seems to work when published url is set or not Jellyfin.Plugin.Dlna.zip
Give this a shot to see if it resolves what youre seeing, I found how to pull in the BaseUrl and mocked this up and seems to work when published url is set or not Jellyfin.Plugin.Dlna.zip
I guess I should update first to 10.9.11 and v3 plugin and simply replace the plugin manually ? I'll have a look to test this tonight
I guess I should update first to 10.9.11 and v3 plugin and simply replace the plugin manually ? I'll have a look to test this tonight
Yeah, update, then in your docker container where you have the volume mounted drop the dll into the plugins folder. in my docker server its located here /mnt/containers/jellyfin/config/plugins/DLNA_3.0.0.0/ but yours might be different depending on how you have the volumes set up. You might have to manually set permissions on the dll youre overwriting to allow you to drop it in. Then restart the server/container and you should see the log message indicating its using your baseurl
I took me few minutes, I was willing to duplicate my container to have a beta and a working... By the way I mixed both and crashed both at the end 🤣 Anyway long story short, your updated plugin works on 10.9.11
I won't paste the previous v3 log that fails, but this one advertise correctly. Maybe there is still the localhost advertisement to fix.
EDIT : I had the feeling that 'play to' my Samsung Tv was not working and it finally appeared.
Starting jellyfin_beta ... done
Attaching to jellyfin_beta
jellyfin_beta | [19:26:31] [INF] [1] Main: Jellyfin version: 10.9.11
jellyfin_beta | [19:26:31] [INF] [1] Main: Environment Variables: ["[JELLYFIN_CONFIG_DIR, /config/config]", "[JELLYFIN_FFMPEG, /usr/lib/jellyfin-ffmpeg/ffmpeg]", "[JELLYFIN_WEB_DIR, /jellyfin/jellyfin-web]", "[JELLYFIN_DATA_DIR, /config]", "[JELLYFIN_LOG_DIR, /config/log]", "[JELLYFIN_CACHE_DIR, /cache]"]
jellyfin_beta | [19:26:31] [INF] [1] Main: Arguments: ["/jellyfin/jellyfin.dll"]
jellyfin_beta | [19:26:31] [INF] [1] Main: Operating system: Debian GNU/Linux 12 (bookworm)
jellyfin_beta | [19:26:31] [INF] [1] Main: Architecture: Arm64
jellyfin_beta | [19:26:31] [INF] [1] Main: 64-Bit Process: True
jellyfin_beta | [19:26:31] [INF] [1] Main: User Interactive: True
jellyfin_beta | [19:26:31] [INF] [1] Main: Processor count: 4
jellyfin_beta | [19:26:31] [INF] [1] Main: Program data path: /config
jellyfin_beta | [19:26:31] [INF] [1] Main: Log directory path: /config/log
jellyfin_beta | [19:26:31] [INF] [1] Main: Config directory path: /config/config
jellyfin_beta | [19:26:31] [INF] [1] Main: Cache path: /cache
jellyfin_beta | [19:26:31] [INF] [1] Main: Web resources path: /jellyfin/jellyfin-web
jellyfin_beta | [19:26:31] [INF] [1] Main: Application directory: /jellyfin/
jellyfin_beta | [19:26:32] [INF] [1] Emby.Server.Implementations.AppBase.BaseConfigurationManager: Setting cache path: /cache
jellyfin_beta | [19:26:32] [INF] [1] Emby.Server.Implementations.ApplicationHost: Loading assemblies
jellyfin_beta | [19:26:32] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded assembly Rssdp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null from /config/plugins/DLNA_3.0.0.0/Rssdp.dll
jellyfin_beta | [19:26:32] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded assembly Jellyfin.Plugin.Dlna.Playback, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null from /config/plugins/DLNA_3.0.0.0/Jellyfin.Plugin.Dlna.Playback.dll
jellyfin_beta | [19:26:32] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded assembly Jellyfin.Plugin.Dlna.Model, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null from /config/plugins/DLNA_3.0.0.0/Jellyfin.Plugin.Dlna.Model.dll
jellyfin_beta | [19:26:32] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded assembly Jellyfin.Plugin.Dlna, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null from /config/plugins/DLNA_3.0.0.0/Jellyfin.Plugin.Dlna.dll
jellyfin_beta | [19:26:32] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded assembly Jellyfin.Plugin.OpenSubtitles, Version=20.0.0.0, Culture=neutral, PublicKeyToken=null from /config/plugins/Open Subtitles_20.0.0.0/Jellyfin.Plugin.OpenSubtitles.dll
jellyfin_beta | [19:26:32] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded assembly Trakt, Version=25.0.0.0, Culture=neutral, PublicKeyToken=null from /config/plugins/Trakt_25.0.0.0/Trakt.dll
jellyfin_beta | [19:26:33] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Defined LAN subnets: ["192.168.26.0/23"]
jellyfin_beta | [19:26:33] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Defined LAN exclusions: []
jellyfin_beta | [19:26:33] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Used LAN subnets: ["192.168.26.0/23"]
jellyfin_beta | [19:26:33] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Filtered interface addresses: ["192.168.26.251"]
jellyfin_beta | [19:26:33] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Bind Addresses ["192.168.26.251"]
jellyfin_beta | [19:26:33] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Remote IP filter is Allowlist
jellyfin_beta | [19:26:33] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Filtered subnets: []
jellyfin_beta | [19:26:49] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: DLNA 3.0.0.0
jellyfin_beta | [19:26:49] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: Open Subtitles 20.0.0.0
jellyfin_beta | [19:26:49] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: Trakt 25.0.0.0
jellyfin_beta | [19:26:49] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: TMDb 10.9.11.0
jellyfin_beta | [19:26:49] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: Studio Images 10.9.11.0
jellyfin_beta | [19:26:49] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: OMDb 10.9.11.0
jellyfin_beta | [19:26:49] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: MusicBrainz 10.9.11.0
jellyfin_beta | [19:26:49] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: AudioDB 10.9.11.0
jellyfin_beta | [19:26:49] [WRN] [1] Microsoft.AspNetCore.DataProtection.Repositories.EphemeralXmlRepository: Using an in-memory repository. Keys will not be persisted to storage.
jellyfin_beta | [19:26:49] [WRN] [1] Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager: Neither user profile nor HKLM registry available. Using an ephemeral key repository. Protected data will be unavailable when application exits.
jellyfin_beta | [19:26:49] [INF] [1] Main: Kestrel is listening on 192.168.26.251
jellyfin_beta | [19:26:50] [INF] [1] Jellyfin.Plugin.Dlna.Main.DlnaHost: Descriptor uri was /vod/jellyfin/dlna/3466f6be-a3c9-467e-8011-0db496551223/description.xml
jellyfin_beta | [19:26:50] [INF] [1] Jellyfin.Plugin.Dlna.Main.DlnaHost: Registering publisher for urn:schemas-upnp-org:device:MediaServer:1 on 192.168.26.251 with uri http://192.168.26.251:8096/vod/jellyfin/dlna/3466f6be-a3c9-467e-8011-0db496551223/description.xml
jellyfin_beta | [19:26:50] [WRN] [1] Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager: No XML encryptor configured. Key {da7914da-aea5-4008-bac6-dc950899ac2a} may be persisted to storage in unencrypted form.
jellyfin_beta | [19:26:53] [WRN] [1] Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware: The WebRootPath was not found: /wwwroot. Static files may be unavailable.
jellyfin_beta | [19:26:53] [INF] [11] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /media/usb/Video/Animé
jellyfin_beta | [19:26:53] [INF] [1] Emby.Server.Implementations.ApplicationHost: Running startup tasks
jellyfin_beta | [19:26:53] [INF] [11] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /media/usb/Video/Collection
jellyfin_beta | [19:26:53] [INF] [11] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /media/usb/Video/DA
jellyfin_beta | [19:26:53] [INF] [11] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /media/usb/Video/Films
jellyfin_beta | [19:26:53] [INF] [11] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /media/usb/Video/Films_Sorted
jellyfin_beta | [19:26:53] [INF] [10] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /media/smb/Series
jellyfin_beta | [19:26:53] [INF] [11] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /media/usb/Video/Series
jellyfin_beta | [19:26:53] [INF] [1] Emby.Server.Implementations.ScheduledTasks.TaskManager: Daily trigger for Générer des images Trickplay set to fire at 2024-10-01 03:00:00.000 +00:00, which is 07:33:06.1194913 from now.
jellyfin_beta | [19:26:53] [INF] [1] Emby.Server.Implementations.ScheduledTasks.TaskManager: Daily trigger for Extraire les images de chapitre set to fire at 2024-10-01 02:00:00.000 +00:00, which is 06:33:06.0941759 from now.
jellyfin_beta | [19:26:54] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Found ffmpeg version 6.0.1
jellyfin_beta | [19:26:54] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available decoders: ["libdav1d", "av1", "av1_rkmpp", "h264", "h264_rkmpp", "hevc", "hevc_rkmpp", "mpeg1_rkmpp", "mpeg2video", "mpeg2_rkmpp", "mpeg4", "mpeg4_rkmpp", "msmpeg4", "vp8", "vp8_rkmpp", "libvpx", "vp9", "vp9_rkmpp", "libvpx-vp9", "aac", "ac3", "dca", "flac", "mp3", "truehd"]
jellyfin_beta | [19:26:54] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available encoders: ["libsvtav1", "libx264", "h264_v4l2m2m", "h264_rkmpp", "libx265", "hevc_rkmpp", "mpeg4", "msmpeg4", "libvpx", "libvpx-vp9", "aac", "libfdk_aac", "ac3", "alac", "dca", "flac", "libmp3lame", "libopus", "truehd", "libvorbis", "srt"]
jellyfin_beta | [19:26:54] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available filters: ["overlay_opencl", "overlay_rkrga", "scale_opencl", "scale_rkrga", "tonemap_opencl", "vpp_rkrga", "zscale", "alphasrc"]
jellyfin_beta | [19:26:54] [WRN] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Filter: scale_cuda with option Output format (default "same") is not available
jellyfin_beta | [19:26:54] [WRN] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Filter: tonemap_cuda with option GPU accelerated HDR to SDR tonemapping is not available
jellyfin_beta | [19:26:55] [WRN] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Filter: overlay_vaapi with option Action to take when encountering EOF from secondary input is not available
jellyfin_beta | [19:26:55] [WRN] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Filter: overlay_vulkan with option Action to take when encountering EOF from secondary input is not available
jellyfin_beta | [19:26:55] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available hwaccel types: ["drm", "opencl", "rkmpp"]
jellyfin_beta | [19:26:57] [INF] [14] Emby.Server.Implementations.ScheduledTasks.TaskManager: Nettoyer les collections et les listes de lecture Completed after 0 minute(s) and 0 seconds
jellyfin_beta | [19:26:57] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: FFmpeg: /usr/lib/jellyfin-ffmpeg/ffmpeg
jellyfin_beta | [19:26:57] [INF] [1] Emby.Server.Implementations.ApplicationHost: ServerId: 3466f6bea3c9467e80110db496551223
jellyfin_beta | [19:26:57] [INF] [1] Emby.Server.Implementations.ApplicationHost: Core startup complete
jellyfin_beta | [19:26:57] [INF] [1] Main: Startup complete 0:00:26.1768469
jellyfin_beta | [19:26:57] [INF] [8] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /media/smb/Music
jellyfin_beta | [19:26:59] [INF] [14] Emby.Server.Implementations.ScheduledTasks.TaskManager: Mettre à jour les extensions Completed after 0 minute(s) and 2 seconds
Ok cool, I already made the PR. That should get you going until/if that is merged. The "play to" i think was broken with the move to the plugin from the core server and i feel is separate from this and there are other issues logged about it. I started poking through and Im not sure how to fix that one, out of my expertise without a lot of digging and ive never really used that feature. You might want to open another issue on the 127.0.0.1 binding with whatever youre having a problem with that.
I'll have a second look to the localhost binding interface once the pull request will be merged. Just being sure that I'm not mixing problems. One step at a time.
Thanks @disgustipated for your support.
Please describe your bug
My Jellyfin server v10.9.11 is configured to be placed in a specific URL using this base url : /vod/jellyfin
I suspect that DLNA clients can't get the feed from dlna server because they are pooling for : http://192.168.26.251:8096/dlna/3466f6be-a3c9-467e-8011-0db496551223/description.xml
instead of : http://192.168.26.251:8096/vod/jellyfin/dlna/3466f6be-a3c9-467e-8011-0db496551223/description.xml
All clients won't be able to understand the description as html is returned in place of the expected desc. I hope it could be fixed soon. I'll revert to v2 for the moment.
Jellyfin Version
10.9.11
if other:
No response
Environment
Jellyfin logs
No response
FFmpeg logs
No response
Please attach any browser or client logs here
No response
Please attach any screenshots here
No response