Skip to content

dlna: migrate to huin/goupnp library#842

Open
M0Rf30 wants to merge 1 commit intodweymouth:mainfrom
M0Rf30:dlna-migration
Open

dlna: migrate to huin/goupnp library#842
M0Rf30 wants to merge 1 commit intodweymouth:mainfrom
M0Rf30:dlna-migration

Conversation

@M0Rf30
Copy link
Copy Markdown
Contributor

@M0Rf30 M0Rf30 commented Feb 2, 2026

Replace go-upnpcast with huin/goupnp for DLNA device discovery.

Changes:

  • Support AVTransport v1/v2 and RenderingControl v1/v2
  • Add exponential backoff for seek operations
  • Add timing constants for playback synchronization
  • Add formatTime() and buildDIDLMetadata() helpers
  • Fix closure variable capture in playbackmanager.go
  • Add unit tests for timing and retry logic

Tested with Rygel, Kodi, and gmediarender.

Reasons for migration:

  • go-upnpcast only supports active M-SEARCH queries
  • huin/goupnp handles passive SSDP NOTIFY announcements
  • huin/goupnp is industry standard (458 stars, 19.4k dependents)

@M0Rf30 M0Rf30 force-pushed the dlna-migration branch 3 times, most recently from bf94330 to f37ae2c Compare February 2, 2026 21:21
Replace go-upnpcast with huin/goupnp for DLNA device discovery.

Reasons for migration:
- go-upnpcast is unmaintained (last commit 2019)
- go-upnpcast only supports active M-SEARCH queries
- huin/goupnp handles passive SSDP NOTIFY announcements
- huin/goupnp is industry standard (458 stars, 19.4k dependents)

Changes:
- Support AVTransport v1/v2 and RenderingControl v1/v2
- Add exponential backoff for seek operations
- Add timing constants for playback synchronization
- Add formatTime() and buildDIDLMetadata() helpers
- Fix closure variable capture in playbackmanager.go
- Add unit tests for timing and retry logic

Tested with Rygel, Kodi, and gmediarender.
@dweymouth
Copy link
Copy Markdown
Owner

dweymouth commented Feb 4, 2026

I tested this with my WiiM Mini DLNA streamer and it seems to have some issues compared to the current implementation. Switching from local playback to casting in the middle of a track starts playback from the beginning of the track on the device, while Supersonic still thinks the playback position is unchanged. (Current behavior is to start from the current position when beginning streaming to the DLNA device). Also, seeking forward in a currently playing track while DLNA casting ends up syncing an incorrect playback time with the device near the end of the track and starts showing the current playback time being beyond the end of the track.

Not sure how many (if any) of these issues are due to the huin/goupnp library or to the code in the Supersonic dlna player. Also, FWIW, the go-upnpcast library isn't unmaintained; I maintain it, and it originated as a refactoring of the code in the also active https://github.com/alexballas/go2tv project.

Edit: I realize you removed the mention of it being unmaintained

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants