Skip to content

Commit

Permalink
Added renderer config for Sony Bravia XR series (#4808)
Browse files Browse the repository at this point in the history
* Added renderer config for Sony Bravia XR series

Fixes #4279

* Added generic Sony BRAVIA TV config for fallback

* Stop EX from being generic

* Same for HX

* More

* Fix LoadingPriority

* Update priority

* Remove generic matcher from Sony Bravia X
  • Loading branch information
SubJunk authored Jul 17, 2024
1 parent bc4b23b commit ecba3b9
Show file tree
Hide file tree
Showing 10 changed files with 148 additions and 9 deletions.
56 changes: 56 additions & 0 deletions src/main/external-resources/renderers/Sony-Bravia.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#---------------------------------------------------------------------------------------------------
# Profile for Sony Bravia
# See DefaultRenderer.conf for descriptions of all the available options.

RendererName = Sony Bravia
RendererIcon = Sony-BraviaXD.png

# =================================================================================
# This is a generic profile to provide better support for BRAVIA TVs that we do not
# explicitly recognize. Ideally, this will NOT be used, because a more specific
# one should exist.
# It is a clone of Sony-Bravia-XR.conf because that should provide good support for
# TVs from 2021 onwards.
# =================================================================================

UserAgentAdditionalHeader = X-AV-Client-Info
UserAgentAdditionalHeaderSearch = BRAVIA
UpnpDetailsSearch = BRAVIA

SeekByTime = true
DLNALocalizationRequired = true
TranscodeVideo = MPEGTS-H264-AC3
TranscodeAudio = WAV
KeepAspectRatioTranscoding = true
MuxNonMod4Resolution = true
H264LevelLimit = 5.1
SupportedVideoBitDepths = 8,10
ForceJPGThumbnails = true
ThumbnailAsResource = true
CreateDLNATreeFaster = true
SendDLNAOrgFlags = false

# Supported video formats:
Supported = f:3gp|3g2 v:h264|mp4 a:aac-lc|he-aac|ac3|eac3|mpa m:video/3gpp
Supported = f:avi v:divx|h264|h265|mjpeg|mp4 a:aac-lc|he-aac|ac3|dts|eac3|mp3|mpa m:video/avi
Supported = f:mkv v:divx|h264|mp4|vp8|vp9 a:aac-lc|he-aac|ac3|dts|eac3|mpa|vorbis si:ASS|SUBRIP m:video/x-matroska
Supported = f:mkv v:h265 a:aac-lc|he-aac|ac3|dts|eac3 si:ASS|SUBRIP m:video/x-matroska
Supported = f:mov v:h264|mjpeg|mp4 a:aac-lc|he-aac|ac3|dts|eac3|lpcm|mpa si:ASS|SUBRIP m:video/quicktime
Supported = f:mp4 v:h264|mp4 a:aac-lc|he-aac|ac3|ac4|dts|eac3|lpcm|mpa m:video/mp4
Supported = f:mp4 v:h265 a:aac-lc|he-aac|ac3|ac4|dts|eac3|lpcm m:video/mp4
Supported = f:mpegps v:mpeg1|mpeg2 a:ac3|lpcm|mpa m:video/mpeg
Supported = f:mpegts v:h264|h265|mpeg2 a:aac-lc|he-aac|ac3|eac3|mpa m:video/vnd.dlna.mpeg-tts
Supported = f:webm v:vp8|vp9 a:vorbis m:video/webm
Supported = f:wmv|asf v:vc1 a:wma m:video/x-ms-wmv

# Supported audio formats:
Supported = f:3g2a m:audio/3gpp2
Supported = f:3ga m:audio/3gpp
Supported = f:m4a a:aac-lc|he-aac m:audio/x-m4a
Supported = f:flac a:flac m:audio/flac
Supported = f:mp3 n:2 m:audio/mpeg s:48000
Supported = f:wav a:dts|lpcm m:audio/wav
Supported = f:wma m:audio/x-ms-wma

# Supported subtitles formats:
SupportedExternalSubtitlesFormats = ASS,SUBRIP
3 changes: 2 additions & 1 deletion src/main/external-resources/renderers/Sony-BraviaEX.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ RendererIcon = braviaex.png

UserAgentAdditionalHeader = X-AV-Client-Info
UserAgentAdditionalHeaderSearch = (BRAVIA KDL.+EX[3457])|(BRAVIA KDL.+[CN]X[578])
UpnpDetailsSearch = Sony , (KDL.+EX[3457])|(KDL.+[CN]X[578])
UpnpDetailsSearch = (KDL.+EX[3457])|(KDL.+[CN]X[578])
LoadingPriority = 2

SeekByTime = true
DLNALocalizationRequired = true
Expand Down
3 changes: 2 additions & 1 deletion src/main/external-resources/renderers/Sony-BraviaHX.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ RendererIcon = braviahx.png

UserAgentAdditionalHeader = X-AV-Client-Info
UserAgentAdditionalHeaderSearch = BRAVIA KDL.+HX
UpnpDetailsSearch = Sony , KDL.+HX
UpnpDetailsSearch = KDL.+HX
LoadingPriority = 2

SeekByTime = true
DLNALocalizationRequired = true
Expand Down
3 changes: 2 additions & 1 deletion src/main/external-resources/renderers/Sony-BraviaW.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ RendererIcon = braviaw.png

UserAgentAdditionalHeader = X-AV-Client-Info
UserAgentAdditionalHeaderSearch = BRAVIA KDL-[0-9][0-9]W(6|7|8|9)[0-9][0-9](A|B|C)
UpnpDetailsSearch = Sony , KDL-[0-9][0-9]W(6|7|8|9)[0-9][0-9](A|B|C)
UpnpDetailsSearch = KDL-[0-9][0-9]W(6|7|8|9)[0-9][0-9](A|B|C)
LoadingPriority = 2

SeekByTime = true
DLNALocalizationRequired = true
Expand Down
4 changes: 3 additions & 1 deletion src/main/external-resources/renderers/Sony-BraviaX.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ RendererIcon = Sony-BraviaX.png

UserAgentAdditionalHeader = X-AV-Client-Info
UserAgentAdditionalHeaderSearch = (KD|FW)-[0-9][0-9](S|X|Z)[0-9]{1,4}D
UpnpDetailsSearch = Sony , (KD|FW)-[0-9][0-9](S|X|Z)[0-9]{1,4}D
UpnpDetailsSearch = (KD|FW)-[0-9][0-9](S|X|Z)[0-9]{1,4}D

LoadingPriority = 2

# Supported video formats:
Supported = f:3gp|3g2 v:h264|mp4 a:aac-lc|he-aac|ac3|eac3|mpa m:video/3gpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RendererIcon = braviaxbr.png
UserAgentAdditionalHeader = X-AV-Client-Info
UserAgentAdditionalHeaderSearch = XBR-[0-9][0-9]A1
UpnpDetailsSearch = XBR-[0-9][0-9]A1
LoadingPriority = 2
LoadingPriority = 3

SeekByTime = true
TranscodeVideo = MPEGTS-H264-AC3
Expand Down
3 changes: 2 additions & 1 deletion src/main/external-resources/renderers/Sony-BraviaXBR.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ RendererIcon = braviaxbr.png

UserAgentAdditionalHeader = X-AV-Client-Info
UserAgentAdditionalHeaderSearch = BRAVIA XBR-[0-9][0-9]
UpnpDetailsSearch = Sony , XBR-[0-9][0-9]
UpnpDetailsSearch = XBR-[0-9][0-9]
LoadingPriority = 2

SeekByTime = true
DLNALocalizationRequired = true
Expand Down
59 changes: 59 additions & 0 deletions src/main/external-resources/renderers/Sony-BraviaXR.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#---------------------------------------------------------------------------------------------------
# Profile for Sony Bravia XR
# See DefaultRenderer.conf for descriptions of all the available options.

RendererName = Sony Bravia XR
RendererIcon = Sony-BraviaXD.png

# =================================================================================
# This renderer has sent the following string/s:
#
# X-av-client-info: av=5.0; cn="Sony Corporation"; mn="BRAVIA XR-55X90K"; mv="3.0";
# X-av-physical-unit-info: pa="BRAVIA XR-55X90K";
#
# Manual: https://helpguide.sony.net/tv/jusltn1/v1/en-003/04-01-03_03.html
# Naming convention from https://en.tab-tv.com/identification-tv-sony-2012-2015-year/
# =================================================================================

UserAgentAdditionalHeader = X-AV-Client-Info
UserAgentAdditionalHeaderSearch = (XR)-\\d{2}|K-\\d{2}XR\\d{2}
UpnpDetailsSearch = (XR)-\\d{2}|K-\\d{2}XR\\d{2}
LoadingPriority = 2

SeekByTime = true
DLNALocalizationRequired = true
TranscodeVideo = MPEGTS-H264-AC3
TranscodeAudio = WAV
KeepAspectRatioTranscoding = true
MuxNonMod4Resolution = true
H264LevelLimit = 5.1
SupportedVideoBitDepths = 8,10
ForceJPGThumbnails = true
ThumbnailAsResource = true
CreateDLNATreeFaster = true
SendDLNAOrgFlags = false

# Supported video formats:
Supported = f:3gp|3g2 v:h264|mp4 a:aac-lc|he-aac|ac3|eac3|mpa m:video/3gpp
Supported = f:avi v:divx|h264|h265|mjpeg|mp4 a:aac-lc|he-aac|ac3|dts|eac3|mp3|mpa m:video/avi
Supported = f:mkv v:divx|h264|mp4|vp8|vp9 a:aac-lc|he-aac|ac3|dts|eac3|mpa|vorbis si:ASS|SUBRIP m:video/x-matroska
Supported = f:mkv v:h265 a:aac-lc|he-aac|ac3|dts|eac3 si:ASS|SUBRIP m:video/x-matroska
Supported = f:mov v:h264|mjpeg|mp4 a:aac-lc|he-aac|ac3|dts|eac3|lpcm|mpa si:ASS|SUBRIP m:video/quicktime
Supported = f:mp4 v:h264|mp4 a:aac-lc|he-aac|ac3|ac4|dts|eac3|lpcm|mpa m:video/mp4
Supported = f:mp4 v:h265 a:aac-lc|he-aac|ac3|ac4|dts|eac3|lpcm m:video/mp4
Supported = f:mpegps v:mpeg1|mpeg2 a:ac3|lpcm|mpa m:video/mpeg
Supported = f:mpegts v:h264|h265|mpeg2 a:aac-lc|he-aac|ac3|eac3|mpa m:video/vnd.dlna.mpeg-tts
Supported = f:webm v:vp8|vp9 a:vorbis m:video/webm
Supported = f:wmv|asf v:vc1 a:wma m:video/x-ms-wmv

# Supported audio formats:
Supported = f:3g2a m:audio/3gpp2
Supported = f:3ga m:audio/3gpp
Supported = f:m4a a:aac-lc|he-aac m:audio/x-m4a
Supported = f:flac a:flac m:audio/flac
Supported = f:mp3 n:2 m:audio/mpeg s:48000
Supported = f:wav a:dts|lpcm m:audio/wav
Supported = f:wma m:audio/x-ms-wma

# Supported subtitles formats:
SupportedExternalSubtitlesFormats = ASS,SUBRIP
3 changes: 2 additions & 1 deletion src/main/external-resources/renderers/Sony-X-Series-TV.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ RendererIcon = Sony-BraviaX.png

UserAgentAdditionalHeader = X-AV-Client-Info
UserAgentAdditionalHeaderSearch = (KD|FW)-[0-9][0-9]X[0-9][0-9]
UpnpDetailsSearch = Sony , (KD|FW)-[0-9][0-9]X[0-9][0-9]
UpnpDetailsSearch = (KD|FW)-[0-9][0-9]X[0-9][0-9]
LoadingPriority = 2

SeekByTime = true
TranscodeVideo = MPEGTS-H264-AC3
Expand Down
21 changes: 19 additions & 2 deletions src/test/java/net/pms/configuration/RendererConfigurationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ public void testKnownHeaders() throws ConfigurationException, InterruptedExcepti

testHeaders("Sony Bluray UBP-X800M2", "X-AV-Client-Info: av=5.0; cn=\"Sony Corporation\"; mn=\"UBP-X800M2\"; mv=\"2.0\";");

testHeaders("Sony Bravia", "X-AV-Client-Info: av=5.0; cn=\"Sony Corporation\"; mn=\"BRAVIA\"; mv=\"1.7\";");

testHeaders("Sony Bravia EX", "X-AV-Client-Info: av=5.0; cn=\"Sony Corporation\"; mn=\"BRAVIA KDL-32CX520\"; mv=\"1.7\";");

testHeaders("Sony Bravia HX", "X-AV-Client-Info: av=5.0; cn=\"Sony Corporation\"; mn=\"BRAVIA KDL-55HX750\"; mv=\"1.7\";");
Expand All @@ -328,10 +330,25 @@ public void testKnownHeaders() throws ConfigurationException, InterruptedExcepti
"modelName=XBR-65A1E"
);

testHeaders(
"Sony Bravia XR",
"X-av-client-info: av=5.0; cn=\"Sony Corporation\"; mn=\"BRAVIA XR-55X90K\"; mv=\"3.0\";",
"X-av-physical-unit-info: pa=\"BRAVIA XR-55X90K\";",
"X-av-physical-unit-info: K-65XR90\";"
);
testUPNPDetails(
"Sony Bravia XR",
"{friendlyName=Security TV, manufacturer=Sony Corporation, modelName=XR-55X90K, manufacturerURL=http://www.sony.net/}"
);
testUPNPDetails(
"Sony Bravia XR",
"{friendlyName=Security TV, manufacturer=Sony Corporation, modelName=K-65XR90, manufacturerURL=http://www.sony.net/}"
);

testHeaders("Sony X Series TV", "X-AV-Client-Info: av=5.0; cn=\"Sony Corporation\"; mn=\"BRAVIA KD-50X80J\"; mv=\"3.0\";");
testUPNPDetails(
"Sony X Series TV",
"{friendlyName=Security TV, address=192.168.50.183, udn=uuid:96c90ee4-6768-460a-ad31-090018db9149, manufacturer=Sony Corporation, modelName=KD-50X80J, manufacturerURL=http://www.sony.net/}"
"{friendlyName=Security TV, manufacturer=Sony Corporation, modelName=KD-50X80J, manufacturerURL=http://www.sony.net/}"
);

testHeaders("Sony Xperia Z/ZL/ZQ/Z1/Z2", "X-AV-Client-Info: C6603");
Expand Down Expand Up @@ -498,7 +515,7 @@ private static void testHeaders(String correctRendererName, String... headerLine
* that nothing matches at all.
*
* @param correctRendererName The name of the renderer
* @param upnpDetails One or more raw header lines
* @param upnpDetails A raw header line
*/
private void testUPNPDetails(String correctRendererName, String upnpDetails) {
RendererConfiguration rc = RendererConfigurations.getRendererConfigurationByUPNPDetails(upnpDetails);
Expand Down

0 comments on commit ecba3b9

Please sign in to comment.