mikebrady / shairport-sync

AirPlay and AirPlay 2 audio player
Other
7.3k stars 574 forks source link

Metadata mixed up [Solved] #465

Closed fosple closed 7 years ago

fosple commented 7 years ago

Hey,

when streaming music from iTunes to shairport-sync the metadata info seems to be scrambled (XML tags are closed before they were opened, etc.). It in fact looks like lines are interchanged or lines are missing. Therefore the shairport-sync-metadata-reader can't parse the resulting XML anymore. This happens when I'm streaming from an iOS device or from iTunes (Mac)

Source:

Sink:

Command to start shairport-sync & listen to pipe

shairport-sync -a "Radio" --metadata-pipename /tmp/shairport-sync-metadata

Example:

<data encoding="base64">
MjM5OTU1ODMzMA==</data></item>
</data></item>
AIA=</data><item><type>636f7265</type><code>6173636d</code><length>0</length></item>
<item><type>636f7265</type><code>6173666d</code><length>3</length></item>
</item>
</data></item>
<item><type>636f7265</type><code>61654856</code><length>1</length>
<data encoding="base64">
AA==</data></item>
</item>
<item><type>636f7265</type><code>61654744</code><length>4</length>
<data encoding="base64">
AAAGwA==</data></item>
<item><type>636f7265</type><code>61654755</code><length>8</length>
<data encoding="base64">
AAAAAAyIzIA=</data></item>
<item><type>636f7265</type><code>61654752</code><length>8</length>
<data encoding="base64">
AAAAAASMJto=</data><item><type>636f7265</type><code>61654d6b</code><length>4</length>
<data encoding="base64">
<item><type>636f7265</type><code>61736b70</code><length>4</length>
<data encoding="base64">
AAAAAA==</data></item>
<item><type>636f7265</type><code>61736163</code><length>2</length>
<data encoding="base64">
mikebrady commented 7 years ago

Hi there. Is it possible that you're reading the pipe from two or more places? This is the usual cause of this problem...

fosple commented 7 years ago

@mikebrady Thanks! I just checked that and in fact that was the cause of the problem. I did my own implementation of the shairport-sync-metadata-reader and wanted to check it against the original implementation, so I was reading the pipe from two places. Thanks a lot for the super fast reply :)

mikebrady commented 7 years ago

Problem solved!