MediaBrowser / Emby

Emby Server is a personal media server with apps on just about every device.
https://emby.media
GNU General Public License v2.0
4.11k stars 803 forks source link

[bug] Emby 4.8.1.0 + Primare NP5 = no play due to access tokan being invalidated prematurely #3814

Closed dentedbread closed 7 months ago

dentedbread commented 7 months ago

Emby 4.8.1.0 running as an app on TrueNAS SCALE

Emby app on Android (v8 IIRC) phoneTrueNAS SCALE 22.12.3.2Primare NP5 network streamer`FireFox 122.0.1 (64-bit) (but this is not browser related)

The Primare NP5 network streamer is hardwired via an Ethernet cable to the TrueNAS box. The Primare Prisma Android app detects the NP5 on the network and connects (but the app is rubbish an crashes when any network media server is selected and I do not wish to use it). Emby detects the NP5 too. "Enable DLNA Play To" is enabled in Emby I can select the NP5 as the target, yet no music is played and the player control does not appear at the bottom of the screen as it would normally do. It's as if the "Play" contrrol had not been clicked.

Jellyfin works fine but I would rather use Emby.

I enabled debug logging and looked into this in more detail.

This always appears in the logs when trying to play a track on the NP5:

2024-02-12 13:04:15.587 Warn Server: AUTH-ERROR: 192.168.0.125 - Access token is invalid or expired. 2024-02-12 13:04:15.588 Error Server: Access token is invalid or expired.

It looks like Emby successfully establlishes a session with the NP5 and an API key is generated but later that same key is rejected. It's not clear to me from the logs whether the key is rejected by Emby or the NP5.

It's worth mentioning that although the log files suggest a successful session to the NP5 has been established, and I can select the NP5 as a target for playback, the NP5 is not shown in the "Devices" screen (other clients are such as the web browser and Android phone). This is the same with JellyFin.

I have attached the latest server debug log and the XML files retrieved from the NP5 when the session is established: np5-AVTransport.xml.txt np5-ConnectionManager.xml.txt np5-description.xml.txt embyserver.txt hardware_detection-63843186219.txt

Looks like there's a bug in Emby whereby the access token is invalidated soon after the session has been established.

LukePulverenti commented 7 months ago

We're working together here on it: https://emby.media/community/index.php?/topic/125973-emby-4810-truenas-scale-221232-primare-np5-dlna-no-play/ Thanks.