Jellyfin Forum
Cast To DLNA (Sonos) device name - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: Cast To DLNA (Sonos) device name (/t-cast-to-dlna-sonos-device-name)



Cast To DLNA (Sonos) device name - PeteyMW - 2024-05-29

Hello,

I'm trying to determine how to rename / shorten Sonos speaker names that appear under the 'Cast to device' button. For example, my 2 Sonos speakers appear as:

'192.168.1.30 - Sonos Play:1 - RINCON_#MAC# @Kitchen'
'192.168.1.31 - Sonos Play:1 - RINCON_#MAC# @Office'

I wish to display these as simply the Sonos speaker name - the last word above: @Kitchen; @Office

I've started to investigate whether this can be done via DLNA, CSS or webhooks plugin options, with no success.

BTW, I attempted to enable DLNA debugging as per https://jellyfin.org/docs/general/networking/dlna/ ("Emby.Dlna": "Debug", "Emby.Dlna.Eventing": "Debug"; also tried 'Jellyfin...' in place of 'Emby...') but don't see any [DBG] info. I do see entries like:

[INF] DLNA Session created for "192.168.1.30 - Sonos Play:1 - RINCON_#MAC# @Kitchen" - "Sonos Play:1"
[INF] No matching device profile found. The default will need to be used.
DeviceIdentification { FriendlyName: "192.168.1.31 - Sonos Play:1 - RINCON_#MAC' @Kitchen" ...


I hope someone can advise - thank you.

Cheers,
Pete

Dietpi system running Jellyfin v10.9.3


RE: Cast To DLNA (Sonos) device name - TheDreadPirate - 2024-05-29

Pretty sure the device is providing a name to Jellyfin. So I'm assuming you'd have to change the name with the Sonos app.


RE: Cast To DLNA (Sonos) device name - PeteyMW - 2024-06-02

Hello,

Thanks for your reply.

Unfortunately, although the speaker name can be changed via the Sonos app, it's JF's 'Cast to Devce / Play On' name [e.g. '192.168.1.30 - Sonos Play:1 - RINCON_#MAC' @Kitchen - DLNA'] I wish to change / shorten.
Unable to do so via Sonos (https://en.community.sonos.com/controllers-and-music-services-228995/sonos-friendly-name-can-it-be-changed-6789689), I was hoping to change how Jellyfin displays it.
NB I see that Emby's DLNA plugin behaves similarly; their Sonos-specifc one does display speakers as required (e.g. '@Kitchen').

I've tried several avenues but have just about given up!


Aside: not related to this issue but to avoid 'No matching device profile found...' output in JF's log file for Sonos (S1) speakers, I created a ...jellyfin\plugins\configurations\dlna\user\sonos.xml:
Starting with jellyfin\plugins\DLNA_2.0.0.0\profiles\default.xml,  added / amended the following:

Code:
  <Name>Sonos</Name>
  <Identification>
  <deviceType>urn:schemas-upnp-org:device:ZonePlayer:1</deviceType>
  <manufacturer>Sonos, Inc.</manufacturer>
  <manufacturerURL>http://www.sonos.com</manufacturerURL>
  <modelNumber>S1</modelNumber>
  <modelDescription>Sonos Play:1</modelDescription>
  <modelName>Sonos Play:1</modelName>
  <modelURL>http://www.sonos.com/products/zoneplayers/S1</modelURL>
    <Headers>
    <HttpHeaderInfo name="User-Agent" value="Linux UPnP/1.0 Sonos/" match="Substring" />
    </Headers>
  </Identification>
  <SupportedMediaTypes>Audio</SupportedMediaTypes>
  <DirectPlayProfile container="mp3,wav,m4a,mp4,aac,flac,ogg,asf,wma" videoCodec="" type="Audio" />

Notes:
Identification info from http://<SonosSpeakerIP>:1400/xml/device_description.xml, with speaker-specific info rmoeved; 'HttpHeaderInfo' info from 'wget --server-response -qO /dev/null http://<SonosSpeakerIP>:1400/status'
DirectPlayProfile containers taken from: https://docs.sonos.com/docs/supported-audio-formats#file-formats

Cheers,
Pete


RE: Cast To DLNA (Sonos) device name - PeteyMW - 2024-06-09

For info,

I resolved this by building Jellyfin.Plugin.Dlna.dll with a small tweak. In source code jellyfin-plugin-dlna\src\Jellyfin.Plugin.Dlna\PlayTo\PlayToManager.cs:

Replaced:
string deviceName = device.Properties.Name;

With:
string deviceName = device.Properties.Name.Substring(device.Properties.Name.LastIndexOf('@'));

- my Sonos speakers now appear as their speaker name (e.g. previously presented as '192.168.1.30 - Sonos Play:1 - RINCON_#MAC# @Kitchen - DLNA', now simply '@Kitchen - DLNA').
- other devices, without @ in their uPnP name, are unaffected.

Cheers,
Pete