upnp unable to browse a "folder" (causing a loop) if NumberReturned is not equal to TotalMatches

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
Theliel
New Cone
New Cone
Posts: 3
Joined: 04 Jan 2024 15:25

upnp unable to browse a "folder" (causing a loop) if NumberReturned is not equal to TotalMatches

Postby Theliel » 11 Oct 2024 05:10

Let me see if I can explain what is happening.

First of all, the problem occurs on both Windows and Android. At some point in the past it simply stopped working, I couldn't tell you which was the last version in which it worked correctly. Although I had not had time to debug it until now. (Any other upnp player work fine)

My NAS is configured to publish the following content via upnp, this is the structure it publishes, (stripped some folders)

-Root
--Music
--Photos
--Videos
---Video Collection
---Folders
---Classification

All published content ("folders") works fine, except one, "Classification". when you try to open it, keeps searching for an indefinite amount of time.

Steps to reproduce and messages attached

1º. Open VLC, go to player list
2º. Enable Message -> 2 for debug
3º. Click on Local Network -> upnp
4º- Right Side, I open my upnp server
5º. I can see Music, Vídeos and Photos now. Expand Vídeos.
6º. I have now Collections, Folders and Classification.
7º. Try with Video Collection and work fine. Try with Folders and work fine, all folders are listed...
8º. Try with Classification, and... nothing, It seems to be searching, and it stays that way until I select a different folder/section.


Attached log generated by reproducing exactly these same steps:
(useless anyway)

https://pastebin.com/3eJAQ5yV

-------------------

Using a packet analyzer, the problem seems to be that VLC tries to retrieve an item that doesn't exist (or restricted) over and over again (indefinitely), as you can see below.

The server responds correctly (formating xml and removing the junk, only pasting interested parts of XML)

Browsing "videos", all POST and responses are from VLC

Code: Select all

POST: <ObjectID>2</ObjectID><BrowseFlag>BrowseDirectChildren</BrowseFlag><Filter>*</Filter><StartingIndex>0</StartingIndex><RequestedCount>5000</RequestedCount><SortCriteria></SortCriteria> Response: <container id="A0$160$171" parentID="2" restricted="1" childCount="1"><dc:title>Colección de vídeo</dc:title></container> <container id="A0$160$170" parentID="2" restricted="1" childCount="3"><dc:title>Carpetas</dc:title></container> <container id="A0$160$173" parentID="2" restricted="1" childCount="7"><dc:title>Clasificación</dc:title></container> <NumberReturned>3</NumberReturned><TotalMatches>3</TotalMatches> POST <ObjectID>A0$160$171</ObjectID><BrowseFlag>BrowseDirectChildren</BrowseFlag><Filter>*</Filter><StartingIndex>0</StartingIndex><RequestedCount>5000</RequestedCount><SortCriteria></SortCriteria> Response: All OK <NumberReturned>1</NumberReturned><TotalMatches>1</TotalMatches> POST <ObjectID>A0$160$170</ObjectID><BrowseFlag>BrowseDirectChildren</BrowseFlag><Filter>*</Filter><StartingIndex>0</StartingIndex><RequestedCount>5000</RequestedCount><SortCriteria></SortCriteria> Response: All OK <NumberReturned>3</NumberReturned><TotalMatches>3</TotalMatches> POST: <ObjectID>A0$160$173</ObjectID><BrowseFlag>BrowseDirectChildren</BrowseFlag><Filter>*</Filter><StartingIndex>0</StartingIndex><RequestedCount>5000</RequestedCount><SortCriteria></SortCriteria> Response: All OK <NumberReturned>6</NumberReturned><TotalMatches>7</TotalMatches> After the last one POST, VLC tries again and again the next POST, and the server responding that there is no media POST <ObjectID>A0$160$173</ObjectID><BrowseFlag>BrowseDirectChildren</BrowseFlag><Filter>*</Filter><StartingIndex>6</StartingIndex><RequestedCount>1</RequestedCount><SortCriteria></SortCriteria> Response: <DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" xmlns:pv="http://www.pv.com/pvns/"> </DIDL-Lite>

It is true that the server is responding 6 items out of 7 for that "folder" (access restriction element). What seems to be happening is that VLC wants to retrieve the 7th item (starting 6, requested 1), but does not exist!!, the server responds that there is no item, and VLC requests it again... and so on indefinitely. Regardless of whether the upnp server responds with 6 items and says that there are 7, VLC should have a coherent logic and a stop condition. For example, it might try to retrieve the missing one, but if it gets a response from the server that the item does not exist, it should simply ignore it.

This also always happens if a restricted user tries to browse any folder with restricted elements. The server will respond that the returned items are (sometimes) less than the total, so, the bug its trigger again.

Im unable to report the bug because VLC gitlab restrinction so...

Thank for your work.

Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 51 guests