Playing flac files to Sonos

Server Version#: 1.24.5.5173
Player Version#: Sonos
I have a bunch of .flac files that I’ve ripped from CD. When I try to play some of them through the Sonos app I receive an error saying connection to Plex was lost. Looking at the PMS logs [Transcode] Streaming Resource: Bandwidth exceeded: 2147483647 kbps > 32000 kbps

The 32000 kbps comes from my setting of 40mbps upload speed, but I can’t figure out why these new .flac files are showing such a weirdly high bandwidth. The same files play fine with PlexAmp and even play fine on the Sonos when I map my network drive directly as a Music Library.

I also see these errors if I turn on debug:
Cannot direct play this item. Required bandwidth is not known and only kbps is available

I may have narrowed down the problem, but not sure why or how to fix. I tested with a file that works and a file that does not work. It seems the error for a file that does work says “Cannot direct play this item. Required bandwidth is not known and only kbps is available”

If I get info on the 2 files, I can see this XML tag in the file that works: requiredBandwidths=“691,691,691,691,691,691,691,691”

However that tag is missing in the file which does not work. I have no idea how or why that tag is missing on some of my flac files but I believe that is the cause of my problem. Any ideas where that metadata tag comes from?

Can you try running a deep analysis on the file?

I found a post which described the deep analysis, I wasn’t sure how to kick that off manually, however noticed that my scheduled tasks were set to run at 2AM. I checked this morning and the files now have requiredBandwidths metadata.

Here is a snippet of the before XML:

<Media id="394667" duration="681800" audioChannels="2" audioCodec="flac" container="flac">
<Part accessible="1" exists="1" id="427088" key="/library/parts/427088/1643086092/file.flac" duration="681800" file="\\TOWER\Media\Music\Pink Floyd\Animals (1977)\03 Pigs (Three Different Ones).flac" size="55455870" container="flac">
<Stream id="343926" streamType="2" selected="1" codec="flac" index="0" channels="2" bitrate="651" albumGain="1.96" albumPeak="0.648834" albumRange="9.359037" audioChannelLayout="stereo" bitDepth="16" endRamp="-42.61 0.10;-38.74 1.00;-29.91 6.40;-22.98 12.10;-20.95 15.60;-17.47 18.90;-14.73 19.60;-11.74 25.10;-8.86 31.20;-5.41 36.40;-2.98 45.40;0.25 123.90;" gain="1.96" loudness="-19.96" lra="9.36" peak="0.648834" samplingRate="44100" startRamp="-51.00 0.00;-36.47 0.20;-28.37 0.30;-23.56 0.40;-18.44 2.60;-17.49 2.70;-12.19 10.30;-11.30 10.40;-6.70 36.10;-4.84 36.20;-2.53 52.40;0.26 282.90;" displayTitle="FLAC (Stereo)" extendedDisplayTitle="FLAC (Stereo)"> </Stream>
<Stream id="343927" key="/library/streams/343927" streamType="4" codec="txt" format="txt" provider="com.plexapp.agents.lyricfind" displayTitle="TXT (External)" extendedDisplayTitle="TXT (External)"> </Stream>
</Part>

Same file with XML after deep analysis:

<Media id="394667" duration="681800" bitrate="651" audioChannels="2" audioCodec="flac" container="flac">
<Part accessible="1" exists="1" id="427088" key="/library/parts/427088/1643086092/file.flac" duration="681800" file="\\TOWER\Media\Music\Pink Floyd\Animals (1977)\03 Pigs (Three Different Ones).flac" size="55455870" container="flac" deepAnalysisVersion="6" requiredBandwidths="652,652,652,652,652,652,652,652">
<Stream id="343926" streamType="2" selected="1" codec="flac" index="0" channels="2" bitrate="651" albumGain="1.96" albumPeak="0.648834" albumRange="9.359037" audioChannelLayout="stereo" bitDepth="16" endRamp="-42.61 0.10;-38.74 1.00;-29.91 6.40;-22.98 12.10;-20.95 15.60;-17.47 18.90;-14.73 19.60;-11.74 25.10;-8.86 31.20;-5.41 36.40;-2.98 45.40;0.25 123.90;" gain="1.96" loudness="-19.96" lra="9.36" peak="0.648834" requiredBandwidths="652,652,652,652,652,652,652,652" samplingRate="44100" startRamp="-51.00 0.00;-36.47 0.20;-28.37 0.30;-23.56 0.40;-18.44 2.60;-17.49 2.70;-12.19 10.30;-11.30 10.40;-6.70 36.10;-4.84 36.20;-2.53 52.40;0.26 282.90;" displayTitle="FLAC (Stereo)" extendedDisplayTitle="FLAC (Stereo)"> </Stream>
<Stream id="343927" key="/library/streams/343927" streamType="4" codec="txt" format="txt" provider="com.plexapp.agents.lyricfind" displayTitle="TXT (External)" extendedDisplayTitle="TXT (External)"> </Stream>
</Part>

This seems to have solved it, so my question is now:

  1. How can I have deep analysis run when a new file is added to a library
  2. Why are my specific .flacs needing a deep analysis and this metadata where as other .flacs work immediately after adding them to the library

I’d like to avoid needing to wait overnight for a new file to be playable.

I think you can force it to run when a track is added by changing the “ Analyze audio tracks for loudness” and “Analyze audio tracks for sonic features” to “as a scheduled task and when media is added” under “settings, library”.

Thanks, I have since set those. Looks to be a solution.

As a side note I had upgraded PMS to latest version = 1.25.3.5409 and the problem still exists. Reading the patch notes back from my previous version I saw a lot of fixes related to scanning Music so was hopeful it was fixed, but was not.