Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Adding a UPnP Server via URL (Read 25881 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Adding a UPnP Server via URL

Hi,

I've noticed that you removed the ability to add a UPnP server via URL.
The URL for my Gerbera server e.g. looks something like this: http://192.168.10.5:51253/description.xml
It was possible to add that server by entering the URL in the address field in the 'Add new' section. But that doesn't work anymore. Instead, foobar shows the error message 'Folder inaccessible: Object not found'.
Though it is still possible to add the server after being discovered via SSDP, the device now must be in the same subnet as the server to do that. I think removing this feature is a bad idea since SSDP discovery isn’t always available or working.
For example: The Wireguard VPN works on the network layer and doesn’t support any kind multicast packages that are needed for SSDP. The same is true for any kind of connected subnets.

I kindly ask you to reconsider your decision to remove that feature.


Device:             iPhone SE
OS:                     iOS 15.8.2
Software:         foobar2000 1.6.1
Media Server: Gerbera v1.11.0

Re: Adding a UPnP Server via URL

Reply #1
Noted, thanks for bringing this up.
The functionality was indeed lost, I worked under the assumptions that you'll join local network, auto discover servers and add them to user servers by long-tapping them.
Microsoft Windows: We can't script here, this is bat country.

Re: Adding a UPnP Server via URL

Reply #2
That works for local servers, but adding a server manually is necessary if you wish to set up a server accessible outside your home network (eg. external IP address or hostname, plus Internet server authentication using username and password). Hopefully the functionality can be re-enabled  :)

Re: Adding a UPnP Server via URL

Reply #3
Thanks for restoring this in the latest Beta release!

Re: Adding a UPnP Server via URL

Reply #4
That was fast, thank you very much. I tested the latest beta release and was able to manually add the UPnP server while connected to my network via cellular and Wireguard VPN.
I did some further testing and found that trying to add a ftp server manually now results in a crash of the app. That didn’t happen with the previous release 1.6.2 (3). You might want to take a closer look at this.

Device:              iPhone SE
OS:                      iOS 15.8.2
Software:         foobar2000 1.6.2 (4)
FTP Server:      vsftpd 3.0.5

Re: Adding a UPnP Server via URL

Reply #5
Thanks for testing, FTP regression has just been fixed.
Microsoft Windows: We can't script here, this is bat country.

Re: Adding a UPnP Server via URL

Reply #6
I am experiencing the same issue on a newer version of iOS, Gerbera and the last 1.6.1 and current 1.6.2 Foobar version. The iOS device is on the same subnet as the server.

  • I upgraded from Gerbera 2.2. to 2.3
  • iOS version is current and hasn't been upgraded prior to upgrading from Foobar 1.6.1 to 1.6.2

Under Gerbera 2.2 running Foobar 1.6.1, Foobar was able to discover the Gerbera server and the URL bookmark (e.g.  http://192.168.10.5:51253/description.xml) worked as expected.
Under Gerbera 2.3 running first Foobar 1.6.1 and then 1.6.2 I get the same error as described above:
'Folder inaccessible: Object not found'.
Then when I try to navigate back using < Media Servers, Foobar crashes.

Device:             iPhone SE
OS:                     iOS 17.6.1
Software:         foobar2000 1.6.1 and 1.6.2
Media Server: Gerbera v2.3

Re: Adding a UPnP Server via URL

Reply #7
I just tested on an old iPad. Foobar can discover the Gerbera 2.3 server, and the URL bookmark works as well.

OS:                     iOS 12.5.7
Software:         foobar2000 1.5.2
Media Server: Gerbera v2.3

Re: Adding a UPnP Server via URL

Reply #8
I forgot to mention in my first reply (#6) Foobar 1.6.2 can't discover the Gerbera 2.3 server, but it automatically discovers SMB shares. I can't verify if that's also true under Foobar 1.6.1, because I don't have another device to test on.

Device:             iPhone SE
OS:                     iOS 17.6.1
Software:         foobar2000 1.6.2
Media Server: Gerbera v2.3

Re: Adding a UPnP Server via URL

Reply #9
Bug preventing new Gerbera from being accessed has been identified and will be fixed shortly, thanks for reporting.
Microsoft Windows: We can't script here, this is bat country.

Re: Adding a UPnP Server via URL

Reply #10
I am experiencing the same issues with Logitech (Lyrion) Music Server on piCorePlayer with UPnP/DLNA Plugin.

Foobar > 1.5.3 cannot discover or connect to the server anymore. The previously stored link does not work anymore. When trying to add it again manually via URL, e.g. http://192.168.1.111:9000/plugins/UPnP/MediaServer.xml, it is not possible to store the entry and go further.
There is an entry in the console instead: "Error processing user-specified UPnP server: invalid server response, retrying ..."
Reverting to version 1.5.3 the LMS is there instantly and accessible without any problems.

Will the fix you announced for Gerbera also fix the problem for other servers? Many thanks for your help.


Device:         Samsung Galaxy S24 Ultra
OS:            Android 14
Software:      foobar2000 >1.5.3
Media Server:   Logitech Music Server 8.5.2 - 1716215514 on piCorePlayer v9.2.0

Re: Adding a UPnP Server via URL

Reply #11
v1.6.3

Looks like it's still broken.

I didn't use this feature for a while, but some time ago it was working. When I was adding a URL like http://username:password@myhostname.example:8080/, the player immediately requested /DeviceDescription.xml on the specified server and it was working fine. Now it tries to request just / and it seems like the player closes connection before getting any response (nginx proxy logs have 499 Client Closed Request). I tried to manually add /DeviceDescription.xml, and it started to request this path, but it didn't help, and I still have 499 Client Closed Request errors in the logs (that means that the player closed connection before nginx could send a response). When I request this file in browser, it opens just fine.


Re: Adding a UPnP Server via URL

Reply #13
Fix for Logitech Media Server going up.
I'm not sure why so many HTTP servers mistake "client done writing" state for "closed socket", I'd argue it's their bug not mine.

PS. Please test beta versions and report results if you want the correct fix for your specific case included in the stable version. I can't preemptively test every media server software out there in person.
Microsoft Windows: We can't script here, this is bat country.

Re: Adding a UPnP Server via URL

Reply #14
Works with my foo_upnp server behind nginx now, thanks.
But it doesn't allow to edit entered url after the server was added. Is it intended to be like this?

If somebody who reads this wants to test it, just keep in mind that you need to enter username and password not into the separate user and password fields, but directly into the URL, e.g. http://username:password@hostname:port/

And a small suggestion. The server outputs all urls with full http://username:password@hostname:port/ prefix in every possible case. I tried to remove the prefix and keep URLs relative to the root (starting from /), but it seems like foobar2000 doesn't recognize such URLs and skips all of them. Is this intended?

Re: Adding a UPnP Server via URL

Reply #15
Tested it a bit while was on a walk. Seems like there is another new issue.

The player always plays the same track again and again until you manually switch it to the next track. I guess the player thinks that it's an internet radio and tries to restart the stream when it's over. This behavior is definitely useful for internet radio (I was really annoyed when foobar2000 was switching to the next radio in my playlist on every mobile network hiccup), but it should somehow detect the case when it's just playing a single file through HTTP. The question is "how" =)

The server is configured to transcode everything on the fly (to support all the rare formats I have). I guess it's the reason why it adds "transferMode.dlna.org: Streaming" header into HTTP response. Is this header triggering the stream restart behavior?

Re: Adding a UPnP Server via URL

Reply #16
Yes, v1.6.4-2024-10-24 works for my Logitech (Lyrion) Media Server again. Many thanks, this makes me happy!
I cannot edit the url either (only delete) but I do not mind. I have not experienced any problems with tracks repeating. They are being played one by one.

Re: Adding a UPnP Server via URL

Reply #17
Thanks for your feedback, more fixes added in today's build.

Password protected UPnP servers were more of "works by accident" than a legitimate feature, as in I never tested the concept until last week.
Separate username/password is now accepted for these.

Also enabled editing of manually added UPnP servers.
Microsoft Windows: We can't script here, this is bat country.

Re: Adding a UPnP Server via URL

Reply #18
Tested the latest build. Yeah, the added server is editable now.

Re: Adding a UPnP Server via URL

Reply #19
Is that the only improvement? I believe Peter thinks the repeating track is a foo_upnp problem. If you are forced to stick to foo_upnp I hope he isn't right, as that component is very abandoned.

Re: Adding a UPnP Server via URL

Reply #20
The repeated playing of the same track is still here unfortunately. It was working fine in foobar2000 mobile previous year at least. Currently, foobar2000 correctly shows track length, and current time resets to 0:00 when it starts to play the same track next time.

Relative to the root URLs in server replies are not accepted too (but it's a minor issue).

As far as I am aware, there is no other way to share media library of foobar2000 desktop with foobar2000 mobile. I run foo_upnp behind nginx and can alter its output. This way I add authentication on the nginx side so foo_upnp is not exposed to the internet directly (just in case if there are vulnerabilities that nobody is going to fix).

I think that the issue is related to the transcoding option enabled. I'll check how it works without transcoding this evening.

Re: Adding a UPnP Server via URL

Reply #21
Noted, will re-test foo_upnp + transcoding + remote access for the next build.

Relative to the root URLs in server replies are not accepted too (but it's a minor issue).
Please clarify.
Microsoft Windows: We can't script here, this is bat country.

Re: Adding a UPnP Server via URL

Reply #22
The repeated playing of the same track is still here unfortunately. It was working fine in foobar2000 mobile previous year at least. Currently, foobar2000 correctly shows track length, and current time resets to 0:00 when it starts to play the same track next time.
Cannot reproduce. Console logs from both ends please, desktop foobar2000 and mobile.

EDIT
Figured out, has to do with stream being mistakenly treated as radio, fix coming up
Microsoft Windows: We can't script here, this is bat country.

Re: Adding a UPnP Server via URL

Reply #23
Please clarify.

For example, foobar2000 sends a request to such URL:
Code: [Select]
http://username:password@127.0.0.1:50001/ContentDirectory/754748a7-4f6d-7071-1406-0a39d78b899b/control.xml

The response XML contains absolute URLs like:
Code: [Select]
upnp:albumArtURI&gt;http://username:password@127.0.0.1:50001/albumart/faca72d8a47e2d18479fa956079a2a6e&lt;
I tried to make all such urls relative to the root by replacing http://username:password@127.0.0.1:50001/ to /, but it stops working at all and foobar2000 can't browse this server after that. It is probable that the protocol itself requires absolute URLs though.
The UPnP protocol looks so disgusting that I don't want to touch internals of this protocol anymore, so I'm fine with keeping absolute URLs there.
Maybe one day in the future foobar2000 will have a better protocol for sharing media library from desktop to mobile 😊

Figured out, has to do with stream being mistakenly treated as radio, fix coming up

That's exactly what I thought when observed this issue =)

Re: Adding a UPnP Server via URL

Reply #24
Noted, thanks for the details.

Regarding sharing library over the internet, lots of these issues go away if you just run your own VPN server, such as Wireguard, have full connectivity to LAN IPs from your phone at all times, without actually exposing any of these on your public IP. At least that's what I do.
Microsoft Windows: We can't script here, this is bat country.