Server Version#: 1.18.4.2171
TLDR: After an MP3 has been “analysed” then the additional loudness information held in Plex library is breaking the Direct Play http file transfer that occurs in response to a GET request issued by Alexa running on a Sonos device
I have been battling since Christmas with trying to integrate my Sonos One Gen2 with Plex and have read many posts with similar problems. - but nothing helped.
My usual Plex server is running on Xpenology and I couldn’t upgrade until I update Xpenology
So I downloaded the latest Windows 10 Plex Media server and installed on my desktop PC
I created a small test library and at first I had the following behaviour
“Alexa ask Plex to play xyz” worked on an Amazon Echo
The Sonos App could play from Plex
“Alexa ask Plex to play xyz” failed on the Sonos One
I then added some more music to the library and was surprised when it started playing OK
I then wasted some time trying to work out whether it was CDs ripped that worked or LPs recorded via Audacity etc but couldn’t find any pattern
I did see that 96K FLac files that needed to be transcoded worked OK
I started collecting Plex server logs where I started Plex, waited 1 minute and then tried a working or non working file (as discussed in my reply to another post)
I then installed Wireshark (which can capture all type of packet on the network) and then saw a clear difference
What I see if that for a working file this is a typical exchange:
GET /library/parts/8000/1571488467/file.mp3?protocol=http&hasMDE=1&session=82604d4d-114e-4e9e-aca9-55fcb529e15c&directPlay=1&mediaIndex=0&partIndex=0&offset=0&includeLoudnessTag=1&X-Plex-Token=XXXXXXXX&X-Plex-Client-Profile-Name=Generic&X-Plex-Client-Profile-Extra=add-direct-play-profile%28type%3DmusicProfile%26container%3Dmp3%2Cmp4%2Caac%2Cwav%2Cogg%26audioCodec%3Dmp3%2Caac%2Cpcm%2Cvorbis%29%2Badd-limitation%28scope%3DmusicCodec%26scopeName%3Daac%26type%3DupperBound%26name%3Daudio.bitrate%26value%3D350%29%2Badd-limitation%28scope%3DmusicCodec%26scopeName%3Dmp3%26type%3DupperBound%26name%3Daudio.bitrate%26value%3D350%29%2Badd-limitation%28scope%3DmusicCodec%26scopeName%3Dwav%26type%3DupperBound%26name%3Daudio.samplingRate%26value%3D48000%29%2Badd-transcode-target%28type%3DmusicProfile%26context%3Dstreaming%26protocol%3Dhttp%26container%3Dmp3%26audioCodec%3Dmp3%29&X-Plex-Session-Identifier=3f0ad5dfa2a7b02e9249ba99e5c092719173034a&X-Plex-Chunked=1&X-Plex-Product=Plex%20for%20Alexa&X-Plex-Version=3.0.0&X-Plex-Device=Alexa&X-Plex-Device-Name=Alexa&X-Plex-Client-Identifier=3f0ad5dfa2a7b02e9249ba99e5c092719173034a&X-Plex-Features=external-media&Accept=application%2Fjson HTTP/1.1
CONNECTION: close
Host: 192.168.0.1:32400
ACCEPT: /
USER-AGENT: Linux UPnP/1.0 Sonos/54.2-72031 (ZPS18)
HTTP/1.1 200 OK
ETag: “65f50293a7d1ec5035613630a995b7b3b3a6991d”
Last-Modified: Thu, 02 Jan 2020 12:31:18 GMT
Accept-Ranges: bytes
Connection: close
Content-Length: 7326567
Content-Type: audio/mpeg
X-Plex-Protocol: 1.0
Date: Thu, 02 Jan 2020 12:31:38 GMT
…d…Xing…!>.o…
(rest of MP3 file )
(The 7.5MB file is transferred as a series of TCP packets with regular ACKs by the Sonos)
For a failed file then
GET /library/parts/7901/1572734809/file.mp3?protocol=http&hasMDE=1&session=11e15f53-7666-4cd1-a11f-1de3721746a2&directPlay=1&mediaIndex=0&partIndex=0&offset=0&includeLoudnessTag=1&X-Plex-Token=XXXXXXXXXXX&X-Plex-Client-Profile-Name=Generic&X-Plex-Client-Profile-Extra=add-direct-play-profile%28type%3DmusicProfile%26container%3Dmp3%2Cmp4%2Caac%2Cwav%2Cogg%26audioCodec%3Dmp3%2Caac%2Cpcm%2Cvorbis%29%2Badd-limitation%28scope%3DmusicCodec%26scopeName%3Daac%26type%3DupperBound%26name%3Daudio.bitrate%26value%3D350%29%2Badd-limitation%28scope%3DmusicCodec%26scopeName%3Dmp3%26type%3DupperBound%26name%3Daudio.bitrate%26value%3D350%29%2Badd-limitation%28scope%3DmusicCodec%26scopeName%3Dwav%26type%3DupperBound%26name%3Daudio.samplingRate%26value%3D48000%29%2Badd-transcode-target%28type%3DmusicProfile%26context%3Dstreaming%26protocol%3Dhttp%26container%3Dmp3%26audioCodec%3Dmp3%29&X-Plex-Session-Identifier=3f0ad5dfa2a7b02e9249ba99e5c092719173034a&X-Plex-Chunked=1&X-Plex-Product=Plex%20for%20Alexa&X-Plex-Version=3.0.0&X-Plex-Device=Alexa&X-Plex-Device-Name=Alexa&X-Plex-Client-Identifier=3f0ad5dfa2a7b02e9249ba99e5c092719173034a&X-Plex-Features=external-media&Accept=application%2Fjson HTTP/1.1
CONNECTION: close
Host: 192.168.0.1:32400
ACCEPT: /
USER-AGENT: Linux UPnP/1.0 Sonos/54.2-72031 (ZPS18)
HTTP/1.1 200 OK
ETag: “035adb92ed2b42537e2770186ac60bd0a9ecfad0”
Last-Modified: Tue, 31 Dec 2019 08:33:10 GMT
Accept-Ranges: bytes
Connection: close
Content-Length: 7323339
Content-Type:
X-Plex-Protocol: 1.0
Date: Wed, 01 Jan 2020 18:37:37 GMT
ID3…TXXX…replaygain_track_gain.-2.37 dBTXXX…"…replaygain_track_peak.0.750916 dBRVA2…track…C…;TXXX…replaygain_album_gain.-1.21 dBTXXX…"…replaygain_album_peak.0.805328 dBRVA2…album…)TXXX…k…mixramp_start.-51.00 0.00;-34.79 0.40;-11.00 0.50;-8.76 0.70;-5.66 3.10;-2.72 7.50;1.03 67.90;3.14 157.10;TXXX…*…mixramp_end.-51.00 0.18;-39.44 2.58;-29.76 7.58;-23.01 8.68;-20.63 9.58;-17.07 11.48;-14.97 13.28;-11.97 15.28;-8.90 17.38;-5.97 22.78;-2.64 25.58;0.95 29.28;3.12 30.18;TXXX…mixramp_ref.89.00…
and then the start of the MP3 file but the transfer would get aborted early on
So the two difference are that the Content Type changes from audio/mpeg to blank
There is also the additional loudness information
I was able to force a working file to non working by executing an analysis on the library and restarting plex (Get Info on the file then shows the additional loudness data)
I could then recover by removing the content from the library and then adding it back again
I’ve set the server to Never analyse the library
I’ve also analysed the exchange for the Sonos App and while it looks like the failed case (no content type and the loudness information" the GET instruction is a lot shorter
Request by Sonos App (Works)
GET /library/parts/7901/1572734809/file.mp3?X-Plex-Session-Identifier=48-A6-B8-82-4A-60%3A8&includeLoudnessTag=1&X-Plex-Product=Plex%20for%20Sonos&X-Plex-Version=3.0.0&X-Plex-Device=Sonos&X-Plex-Client-Identifier=sonos-28a974da-6d9b-474a-bcd9-b3829f8c25e1&X-Plex-Token=XXXXXXXXXX&X-Plex-Platform=Sonos&Accept=application%2Fjson HTTP/1.1
CONNECTION: close
Host: 192.168.0.1:32400
ACCEPT: /
USER-AGENT: Linux UPnP/1.0 Sonos/54.2-72031 (ZPS18)
HTTP/1.1 200 OK
ETag: “035adb92ed2b42537e2770186ac60bd0a9ecfad0”
Last-Modified: Tue, 31 Dec 2019 08:33:10 GMT
Accept-Ranges: bytes
Connection: close
Content-Length: 7323339
Content-Type:
X-Plex-Protocol: 1.0
Date: Thu, 02 Jan 2020 10:29:50 GMT
ID3…TXXX…replaygain_track_gain.-2.37 dBTXXX…"…replaygain_track_peak.0.750916 dBRVA2…track…C…;TXXX…replaygain_album_gain.-1.21 dBTXXX…"…replaygain_album_peak.0.805328 dBRVA2…album…)TXXX…k…mixramp_start.-51.00 0.00;-34.79 0.40;-11.00 0.50;-8.76 0.70;-5.66 3.10;-2.72 7.50;1.03 67.90;3.14 157.10;TXXX…*…mixramp_end.-51.00 0.18;-39.44 2.58;-29.76 7.58;-23.01 8.68;-20.63 9.58;-17.07 11.48;-14.97 13.28;-11.97 15.28;-8.90 17.38;-5.97 22.78;-2.64 25.58;0.95 29.28;3.12 30
So I can now access all my (test) library by voice command and I also understand why files stopped working overnight (by default the server carries out a depp analysis of the library after 02:00)
It doesn’t explain why the casting from Plex app still fails but hopefully this might give the developers some idea.
I would be interested to hear if any other Sonos users see the same behaviour with analysed and not analysed files
