joerg-krause writes

I have an issue with the Windows Media Player. The scenario is the following:

I’m clearing the current MPD playlist, adding an radio station URL and start playing all via libmdpclient. Afterwards I start playing to an mp3 audio file from a Windows Media Player to upmpdcli. The audio file starts to play with good audio output, stops after a short time, starts playing again, but this time only noise is produced.

What happens here is weird.

The Windows Media Player sends an SetAVTransportURI with an URI pointing to an mp3 stream and a bunch of different URIs pointing to different audio format streams, like LPCM or WMA, in the CurrentURIMetaData.

upmpdcli inserts the URI into the MPD queue and issues a play command correctly. MPD loads the mad decoder and starts playing the mp3 audio file, for at most one second before the Media Player issues a new SetAVTransportURI with an URI from the CurrentURIMetaData. This time the URI is a LPCM decoded stream. However, MPD still tries to decode the stream with mad which produces audio noise.

The audio garbage is perhaps an issue with MPD or a missing LPCM decoder. But there is at least an issue with upmpdcli handling the MPD state: https://github.com/medoc92/upmpdcli/blob/master/src/avtransport.cxx#L400.

Stopping MPD right after play make the Media Player not happy. I guess the player does not like the results of the GetPositionInfo or GetTransportInfo so it issues another SetAVTransportURI.

I was able to make the Media Player happy be removing the code which restores the MPD state. I’ve read the comment about upmpd_do_restore_play_state_after_add, but I’m not sure what would be a proper solution here.

Below you find the log from upmpdcli:

src/mpdcli.cxx:796::MPDCli::getQueueSongs: 1 songs
src/ohplaylist.cxx:146::OHPlaylist::translateIdArray: current ids: 19
src/ohplaylist.cxx:220::OHPlaylist::makeIdArray: using mpd data for 19 uri http://mp3channels.webradio.antenne.de:80/rockantenne
src/ohplaylist.cxx:227::OHPlaylist::makeIdArray: dropping uri http://192.168.1.119:10243/WMPNSSv4/251939366/0_ezkwMDVGODE2LUUxMzQtNEFENi05ODZGLUI4QUMxQUFCQjJFM30uMC40.mp3
src/ohplaylist.cxx:234::OHPlaylist::makeIdArray: saving metacache
src/ohmetacache.cxx:128::dmcacheSave: got save task: 1 entries to /var/cache/upmpdcli//metacache
src/mpdcli.cxx:811::MPDCli::getQueueData
src/mpdcli.cxx:796::MPDCli::getQueueSongs: 1 songs
src/ohplaylist.cxx:146::OHPlaylist::translateIdArray: current ids: 19
src/mpdcli.cxx:811::MPDCli::getQueueData
src/mpdcli.cxx:796::MPDCli::getQueueSongs: 1 songs
src/ohplaylist.cxx:146::OHPlaylist::translateIdArray: current ids: 19
libupnpp/device/device.cxx:350::UPNP_EVENT_SUBSCRIPTION_REQUEST: urn:upnp-org:serviceId:AVTransport
libupnpp/device/device.cxx:293::UPNP_CONTROL_ACTION_REQUEST: GetTransportInfo. Params: <?xml version="1.0"? >
<m:GetTransportInfo xmlns:m="urn:schemas-upnp-org:service:AVTransport:1" >
<InstanceID xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="ui4" >0</InstanceID >
</m:GetTransportInfo >

libupnpp/device/device.cxx:293::UPNP_CONTROL_ACTION_REQUEST: SetAVTransportURI. Params: <?xml version="1.0"? >
<m:SetAVTransportURI xmlns:m="urn:schemas-upnp-org:service:AVTransport:1" >
<InstanceID xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="ui4" >0</InstanceID >
<CurrentURI xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="string" >http://192.168.1.100:10246/MDEServer/53E296A7-3F0B-4C6C-A2F8-0A4F7AA2FB62/1000.mp3</CurrentURI >
<CurrentURIMetaData xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="string" >&lt;DIDL-Lite xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot; xmlns:microsoft=&quot;urn:schemas-microsoft-com:WMPNSS-1-0/&quot; xmlns:dlna=&quot;urn:schemas-dlna-org:metadata-1-0/&quot;&gt;&lt;item id=&quot;1000&quot; restricted=&quot;1&quot; parentID=&quot;0&quot; microsoft:cpId=&quot;{EFB4DB67-C704-4A4E-9A85-95D9F0AD22AC}&quot; microsoft:trackId=&quot;1&quot;&gt;&lt;dc:title&gt;Wonderful Tonight&lt;/dc:title&gt;&lt;dc:creator&gt;Eric Clapton&lt;/dc:creator&gt;&lt;res size=&quot;3610529&quot; duration=&quot;0:03:45.360&quot; bitrate=&quot;16000&quot; protocolInfo=&quot;http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=01700000000000000000000000000000&quot; sampleFrequency=&quot;48000&quot; bitsPerSample=&quot;16&quot; nrAudioChannels=&quot;2&quot; microsoft:codec=&quot;{00000055-0000-0010-8000-00AA00389B71}&quot;&gt;http://192.168.1.100:10246/MDEServer/53E296A7-3F0B-4C6C-A2F8-0A4F7AA2FB62/1000.mp3&lt;/res&gt;&lt;res duration=&quot;0:03:45.360&quot; bitrate=&quot;16000&quot; protocolInfo=&quot;http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=10;DLNA.ORG_FLAGS=01700000000000000000000000000000&quot; sampleFrequency=&quot;48000&quot; bitsPerSample=&quot;16&quot; nrAudioChannels=&quot;2&quot; microsoft:codec=&quot;{00000055-0000-0010-8000-00AA00389B71}&quot;&gt;http://192.168.1.100:10246/MDEServer/53E296A7-3F0B-4C6C-A2F8-0A4F7AA2FB62/1000.mp3?formatID=00000008-A9AF-4584-84E2-55BFEF0A7D7E&lt;/res&gt;&lt;res duration=&quot;0:03:45.360&quot; bitrate=&quot;192000&quot; protocolInfo=&quot;http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=10;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01700000000000000000000000000000&quot; sampleFrequency=&quot;48000&quot; bitsPerSample=&quot;16&quot; nrAudioChannels=&quot;2&quot; microsoft:codec=&quot;{00000001-0000-0010-8000-00AA00389B71}&quot;&gt;http://192.168.1.100:10246/MDEServer/53E296A7-3F0B-4C6C-A2F8-0A4F7AA2FB62/1000.mp3?formatID=00000029-A9AF-4584-84E2-55BFEF0A7D7E&lt;/res&gt;&lt;res duration=&quot;0:03:45.360&quot; bitrate=&quot;176400&quot; protocolInfo=&quot;http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=10;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01700000000000000000000000000000&quot; sampleFrequency=&quot;44100&quot; bitsPerSample=&quot;16&quot; nrAudioChannels=&quot;2&quot; microsoft:codec=&quot;{00000001-0000-0010-8000-00AA00389B71}&quot;&gt;http://192.168.1.100:10246/MDEServer/53E296A7-3F0B-4C6C-A2F8-0A4F7AA2FB62/1000.mp3?formatID=00000027-A9AF-4584-84E2-55BFEF0A7D7E&lt;/res&gt;&lt;res duration=&quot;0:03:45.360&quot; bitrate=&quot;88200&quot; protocolInfo=&quot;http-get:*:audio/L16;rate=44100;channels=1:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=10;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01700000000000000000000000000000&quot; sampleFrequency=&quot;44100&quot; bitsPerSample=&quot;16&quot; nrAudioChannels=&quot;1&quot; microsoft:codec=&quot;{00000001-0000-0010-8000-00AA00389B71}&quot;&gt;http://192.168.1.100:10246/MDEServer/53E296A7-3F0B-4C6C-A2F8-0A4F7AA2FB62/1000.mp3?formatID=00000025-A9AF-4584-84E2-55BFEF0A7D7E&lt;/res&gt;&lt;res duration=&quot;0:03:45.360&quot; bitrate=&quot;24000&quot; protocolInfo=&quot;http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE;DLNA.ORG_OP=10;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01700000000000000000000000000000&quot; sampleFrequency=&quot;48000&quot; nrAudioChannels=&quot;2&quot; microsoft:codec=&quot;{00000161-0000-0010-8000-00AA00389B71}&quot;&gt;http://192.168.1.100:10246/MDEServer/53E296A7-3F0B-4C6C-A2F8-0A4F7AA2FB62/1000.wma?formatID=00000070-A9AF-4584-84E2-55BFEF0A7D7E&lt;/res&gt;&lt;upnp:class&gt;object.item.audioItem.musicTrack&lt;/upnp:class&gt;&lt;upnp:genre&gt;Rock&lt;/upnp:genre&gt;&lt;dc:publisher&gt;Polydor&lt;/dc:publisher&gt;&lt;upnp:artist role=&quot;Performer&quot;&gt;Eric Clapton&lt;/upnp:artist&gt;&lt;upnp:author role=&quot;Composer&quot;&gt;Eric Clapton&lt;/upnp:author&gt;&lt;upnp:author role=&quot;Composer&quot;&gt;Michael Kamen&lt;/upnp:author&gt;&lt;upnp:album&gt;Time Pieces: The Best of Eric Clapton&lt;/upnp:album&gt;&lt;upnp:originalTrackNumber&gt;4&lt;/upnp:originalTrackNumber&gt;&lt;dc:date&gt;1982-01-02&lt;/dc:date&gt;&lt;upnp:actor role=&quot;Composer&quot;&gt;Eric Clapton&lt;/upnp:actor&gt;&lt;upnp:actor role=&quot;Composer&quot;&gt;Michael Kamen&lt;/upnp:actor&gt;&lt;upnp:albumArtURI&gt;http://192.168.1.100:10246/MDEServer/53E296A7-3F0B-4C6C-A2F8-0A4F7AA2FB62/1000.jpg?albumArt=0&lt;/upnp:albumArtURI&gt;&lt;upnp:albumArtURI dlna:profileID=&quot;JPEG_TN&quot;&gt;http://192.168.1.100:10246/MDEServer/53E296A7-3F0B-4C6C-A2F8-0A4F7AA2FB62/1000.jpg?albumArt=0,formatID=00000020-A9AF-4584-84E2-55BFEF0A7D7E,width=158,height=160&lt;/upnp:albumArtURI&gt;&lt;desc id=&quot;artist&quot; nameSpace=&quot;urn:schemas-microsoft-com:WMPNSS-1-0/&quot; xmlns:microsoft=&quot;urn:schemas-microsoft-com:WMPNSS-1-0/&quot;&gt;&lt;microsoft:artistPerformer&gt;Eric Clapton&lt;/microsoft:artistPerformer&gt;&lt;/desc&gt;&lt;desc id=&quot;author&quot; nameSpace=&quot;urn:schemas-microsoft-com:WMPNSS-1-0/&quot; xmlns:microsoft=&quot;urn:schemas-microsoft-com:WMPNSS-1-0/&quot;&gt;&lt;microsoft:authorComposer&gt;Eric Clapton&lt;/microsoft:authorComposer&gt;&lt;/desc&gt;&lt;desc id=&quot;author&quot; nameSpace=&quot;urn:schemas-microsoft-com:WMPNSS-1-0/&quot; xmlns:microsoft=&quot;urn:schemas-microsoft-com:WMPNSS-1-0/&quot;&gt;&lt;microsoft:authorComposer&gt;Michael Kamen&lt;/microsoft:authorComposer&gt;&lt;/desc&gt;&lt;desc id=&quot;Year&quot; nameSpace=&quot;urn:schemas-microsoft-com:WMPNSS-1-0/&quot; xmlns:microsoft=&quot;urn:schemas-microsoft-com:WMPNSS-1-0/&quot;&gt;&lt;microsoft:year&gt;1982&lt;/microsoft:year&gt;&lt;/desc&gt;&lt;desc id=&quot;fileInfo&quot; nameSpace=&quot;urn:schemas-microsoft-com:WMPNSS-1-0/&quot; xmlns:microsoft=&quot;urn:schemas-microsoft-com:WMPNSS-1-0/&quot;&gt;&lt;microsoft:fileIdentifier&gt;AMGa_id=R     4026;AMGp_id=P    64692;AMGt_id=T  1065031&lt;/microsoft:fileIdentifier&gt;&lt;/desc&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;</CurrentURIMetaData >
</m:SetAVTransportURI >

src/mpdcli.cxx:733::MPDCli::clearQueue
src/avtransport.cxx:344::SetAVTransportURI: curpos: -1 is_song 0 qlen 0
src/mpdcli.cxx:681::MPDCli::insert at :0 uri http://192.168.1.100:10246/MDEServer/53E296A7-3F0B-4C6C-A2F8-0A4F7AA2FB62/1000.mp3
src/mpdcli.cxx:537::MPDCli::play(pos=0)
src/avtransport.cxx:404::MPD Status: 1
src/mpdcli.cxx:572::MPDCli::stop
libupnpp/device/device.cxx:293::UPNP_CONTROL_ACTION_REQUEST: GetPositionInfo. Params: <?xml version="1.0"? >
<m:GetPositionInfo xmlns:m="urn:schemas-upnp-org:service:AVTransport:1" >
<InstanceID xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="ui4" >0</InstanceID >
</m:GetPositionInfo >

src/mpdcli.cxx:811::MPDCli::getQueueData
src/mpdcli.cxx:796::MPDCli::getQueueSongs: 1 songs
src/ohplaylist.cxx:146::OHPlaylist::translateIdArray: current ids: 20
src/ohplaylist.cxx:220::OHPlaylist::makeIdArray: using mpd data for 20 uri http://192.168.1.100:10246/MDEServer/53E296A7-3F0B-4C6C-A2F8-0A4F7AA2FB62/1000.mp3
src/ohplaylist.cxx:227::OHPlaylist::makeIdArray: dropping uri http://mp3channels.webradio.antenne.de:80/rockantenne
src/ohplaylist.cxx:234::OHPlaylist::makeIdArray: saving metacache
libupnpp/device/device.cxx:293::UPNP_CONTROL_ACTION_REQUEST: GetTransportInfo. Params: <?xml version="1.0"? >
<m:GetTransportInfo xmlns:m="urn:schemas-upnp-org:service:AVTransport:1" >
<InstanceID xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="ui4" >0</InstanceID >
</m:GetTransportInfo >

src/ohmetacache.cxx:128::dmcacheSave: got save task: 1 entries to /var/cache/upmpdcli//metacache
libupnpp/device/device.cxx:293::UPNP_CONTROL_ACTION_REQUEST: GetCurrentTransportActions. Params: <?xml version="1.0"? >
<m:GetCurrentTransportActions xmlns:m="urn:schemas-upnp-org:service:AVTransport:1" >
<InstanceID xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="ui4" >0</InstanceID >
</m:GetCurrentTransportActions >

libupnpp/device/device.cxx:293::UPNP_CONTROL_ACTION_REQUEST: Play. Params: <?xml version="1.0"? >
<m:Play xmlns:m="urn:schemas-upnp-org:service:AVTransport:1" >
<InstanceID xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="ui4" >0</InstanceID >
<Speed xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="string" >1</Speed >
</m:Play >

src/avtransport.cxx:569::UpMpdAVTransport::playcontrol State: 1 what 1
src/mpdcli.cxx:537::MPDCli::play(pos=-1)
libupnpp/device/device.cxx:293::UPNP_CONTROL_ACTION_REQUEST: GetProtocolInfo. Params: <?xml version="1.0"? >
<m:GetProtocolInfo xmlns:m="urn:schemas-upnp-org:service:ConnectionManager:1" ></m:GetProtocolInfo >

libupnpp/device/device.cxx:350::UPNP_EVENT_SUBSCRIPTION_REQUEST: urn:upnp-org:serviceId:RenderingControl
src/conman.cxx:97::UpMpdConMan::getProtocolInfo
src/mpdcli.cxx:811::MPDCli::getQueueData
src/mpdcli.cxx:796::MPDCli::getQueueSongs: 1 songs
src/ohplaylist.cxx:146::OHPlaylist::translateIdArray: current ids: 20
libupnpp/device/device.cxx:293::UPNP_CONTROL_ACTION_REQUEST: GetPositionInfo. Params: <?xml version="1.0"? >
<m:GetPositionInfo xmlns:m="urn:schemas-upnp-org:service:AVTransport:1" >
<InstanceID xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="ui4" >0</InstanceID >
</m:GetPositionInfo >

libupnpp/device/device.cxx:293::UPNP_CONTROL_ACTION_REQUEST: GetTransportInfo. Params: <?xml version="1.0"? >
<m:GetTransportInfo xmlns:m="urn:schemas-upnp-org:service:AVTransport:1" >
<InstanceID xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="ui4" >0</InstanceID >
</m:GetTransportInfo >

libupnpp/device/device.cxx:293::UPNP_CONTROL_ACTION_REQUEST: Stop. Params: <?xml version="1.0"? >
<m:Stop xmlns:m="urn:schemas-upnp-org:service:AVTransport:1" >
<InstanceID xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="ui4" >0</InstanceID >
</m:Stop >

src/avtransport.cxx:569::UpMpdAVTransport::playcontrol State: 2 what 0
src/mpdcli.cxx:572::MPDCli::stop
libupnpp/device/device.cxx:293::UPNP_CONTROL_ACTION_REQUEST: GetVolume. Params: <?xml version="1.0"? >
<m:GetVolume xmlns:m="urn:schemas-upnp-org:service:RenderingControl:1" >
<InstanceID xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="ui4" >0</InstanceID >
<Channel xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="string" >Master</Channel >
</m:GetVolume >

libupnpp/device/device.cxx:293::UPNP_CONTROL_ACTION_REQUEST: GetPositionInfo. Params: <?xml version="1.0"? >
<m:GetPositionInfo xmlns:m="urn:schemas-upnp-org:service:AVTransport:1" >
<InstanceID xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="ui4" >0</InstanceID >
</m:GetPositionInfo >

libupnpp/device/device.cxx:293::UPNP_CONTROL_ACTION_REQUEST: GetMute. Params: <?xml version="1.0"? >
<m:GetMute xmlns:m="urn:schemas-upnp-org:service:RenderingControl:1" >
<InstanceID xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="ui4" >0</InstanceID >
<Channel xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="string" >Master</Channel >
</m:GetMute >

libupnpp/device/device.cxx:293::UPNP_CONTROL_ACTION_REQUEST: GetTransportInfo. Params: <?xml version="1.0"? >
<m:GetTransportInfo xmlns:m="urn:schemas-upnp-org:service:AVTransport:1" >
<InstanceID xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="ui4" >0</InstanceID >
</m:GetTransportInfo >

libupnpp/device/device.cxx:293::UPNP_CONTROL_ACTION_REQUEST: SetAVTransportURI. Params: <?xml version="1.0"? >
<m:SetAVTransportURI xmlns:m="urn:schemas-upnp-org:service:AVTransport:1" >
<InstanceID xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="ui4" >0</InstanceID >
<CurrentURI xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="string" >http://192.168.1.100:10246/MDEServer/53E296A7-3F0B-4C6C-A2F8-0A4F7AA2FB62/1000.mp3?formatID=00000029-A9AF-4584-84E2-55BFEF0A7D7E</CurrentURI >
<CurrentURIMetaData xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="string" >&lt;DIDL-Lite xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot; xmlns:microsoft=&quot;urn:schemas-microsoft-com:WMPNSS-1-0/&quot; xmlns:dlna=&quot;urn:schemas-dlna-org:metadata-1-0/&quot;&gt;&lt;item id=&quot;1000&quot; restricted=&quot;1&quot; parentID=&quot;0&quot; microsoft:cpId=&quot;{EFB4DB67-C704-4A4E-9A85-95D9F0AD22AC}&quot; microsoft:trackId=&quot;1&quot;&gt;&lt;dc:title&gt;Wonderful Tonight&lt;/dc:title&gt;&lt;dc:creator&gt;Eric Clapton&lt;/dc:creator&gt;&lt;res duration=&quot;0:03:45.360&quot; bitrate=&quot;192000&quot; protocolInfo=&quot;http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=10;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01700000000000000000000000000000&quot; sampleFrequency=&quot;48000&quot; bitsPerSample=&quot;16&quot; nrAudioChannels=&quot;2&quot; microsoft:codec=&quot;{00000001-0000-0010-8000-00AA00389B71}&quot;&gt;http://192.168.1.100:10246/MDEServer/53E296A7-3F0B-4C6C-A2F8-0A4F7AA2FB62/1000.mp3?formatID=00000029-A9AF-4584-84E2-55BFEF0A7D7E&lt;/res&gt;&lt;res duration=&quot;0:03:45.360&quot; bitrate=&quot;176400&quot; protocolInfo=&quot;http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=10;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01700000000000000000000000000000&quot; sampleFrequency=&quot;44100&quot; bitsPerSample=&quot;16&quot; nrAudioChannels=&quot;2&quot; microsoft:codec=&quot;{00000001-0000-0010-8000-00AA00389B71}&quot;&gt;http://192.168.1.100:10246/MDEServer/53E296A7-3F0B-4C6C-A2F8-0A4F7AA2FB62/1000.mp3?formatID=00000027-A9AF-4584-84E2-55BFEF0A7D7E&lt;/res&gt;&lt;res duration=&quot;0:03:45.360&quot; bitrate=&quot;88200&quot; protocolInfo=&quot;http-get:*:audio/L16;rate=44100;channels=1:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=10;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01700000000000000000000000000000&quot; sampleFrequency=&quot;44100&quot; bitsPerSample=&quot;16&quot; nrAudioChannels=&quot;1&quot; microsoft:codec=&quot;{00000001-0000-0010-8000-00AA00389B71}&quot;&gt;http://192.168.1.100:10246/MDEServer/53E296A7-3F0B-4C6C-A2F8-0A4F7AA2FB62/1000.mp3?formatID=00000025-A9AF-4584-84E2-55BFEF0A7D7E&lt;/res&gt;&lt;res duration=&quot;0:03:45.360&quot; bitrate=&quot;24000&quot; protocolInfo=&quot;http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE;DLNA.ORG_OP=10;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01700000000000000000000000000000&quot; sampleFrequency=&quot;48000&quot; nrAudioChannels=&quot;2&quot; microsoft:codec=&quot;{00000161-0000-0010-8000-00AA00389B71}&quot;&gt;http://192.168.1.100:10246/MDEServer/53E296A7-3F0B-4C6C-A2F8-0A4F7AA2FB62/1000.wma?formatID=00000070-A9AF-4584-84E2-55BFEF0A7D7E&lt;/res&gt;&lt;upnp:class&gt;object.item.audioItem.musicTrack&lt;/upnp:class&gt;&lt;upnp:genre&gt;Rock&lt;/upnp:genre&gt;&lt;dc:publisher&gt;Polydor&lt;/dc:publisher&gt;&lt;upnp:artist role=&quot;Performer&quot;&gt;Eric Clapton&lt;/upnp:artist&gt;&lt;upnp:author role=&quot;Composer&quot;&gt;Eric Clapton&lt;/upnp:author&gt;&lt;upnp:author role=&quot;Composer&quot;&gt;Michael Kamen&lt;/upnp:author&gt;&lt;upnp:album&gt;Time Pieces: The Best of Eric Clapton&lt;/upnp:album&gt;&lt;upnp:originalTrackNumber&gt;4&lt;/upnp:originalTrackNumber&gt;&lt;dc:date&gt;1982-01-02&lt;/dc:date&gt;&lt;upnp:actor role=&quot;Composer&quot;&gt;Eric Clapton&lt;/upnp:actor&gt;&lt;upnp:actor role=&quot;Composer&quot;&gt;Michael Kamen&lt;/upnp:actor&gt;&lt;upnp:albumArtURI&gt;http://192.168.1.100:10246/MDEServer/53E296A7-3F0B-4C6C-A2F8-0A4F7AA2FB62/1000.jpg?albumArt=0&lt;/upnp:albumArtURI&gt;&lt;upnp:albumArtURI dlna:profileID=&quot;JPEG_TN&quot;&gt;http://192.168.1.100:10246/MDEServer/53E296A7-3F0B-4C6C-A2F8-0A4F7AA2FB62/1000.jpg?albumArt=0,formatID=00000020-A9AF-4584-84E2-55BFEF0A7D7E,width=158,height=160&lt;/upnp:albumArtURI&gt;&lt;desc id=&quot;artist&quot; nameSpace=&quot;urn:schemas-microsoft-com:WMPNSS-1-0/&quot; xmlns:microsoft=&quot;urn:schemas-microsoft-com:WMPNSS-1-0/&quot;&gt;&lt;microsoft:artistPerformer&gt;Eric Clapton&lt;/microsoft:artistPerformer&gt;&lt;/desc&gt;&lt;desc id=&quot;author&quot; nameSpace=&quot;urn:schemas-microsoft-com:WMPNSS-1-0/&quot; xmlns:microsoft=&quot;urn:schemas-microsoft-com:WMPNSS-1-0/&quot;&gt;&lt;microsoft:authorComposer&gt;Eric Clapton&lt;/microsoft:authorComposer&gt;&lt;/desc&gt;&lt;desc id=&quot;author&quot; nameSpace=&quot;urn:schemas-microsoft-com:WMPNSS-1-0/&quot; xmlns:microsoft=&quot;urn:schemas-microsoft-com:WMPNSS-1-0/&quot;&gt;&lt;microsoft:authorComposer&gt;Michael Kamen&lt;/microsoft:authorComposer&gt;&lt;/desc&gt;&lt;desc id=&quot;Year&quot; nameSpace=&quot;urn:schemas-microsoft-com:WMPNSS-1-0/&quot; xmlns:microsoft=&quot;urn:schemas-microsoft-com:WMPNSS-1-0/&quot;&gt;&lt;microsoft:year&gt;1982&lt;/microsoft:year&gt;&lt;/desc&gt;&lt;desc id=&quot;fileInfo&quot; nameSpace=&quot;urn:schemas-microsoft-com:WMPNSS-1-0/&quot; xmlns:microsoft=&quot;urn:schemas-microsoft-com:WMPNSS-1-0/&quot;&gt;&lt;microsoft:fileIdentifier&gt;AMGa_id=R     4026;AMGp_id=P    64692;AMGt_id=T  1065031&lt;/microsoft:fileIdentifier&gt;&lt;/desc&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;</CurrentURIMetaData >
</m:SetAVTransportURI >

src/mpdcli.cxx:733::MPDCli::clearQueue
src/avtransport.cxx:344::SetAVTransportURI: curpos: -1 is_song 0 qlen 0
src/mpdcli.cxx:681::MPDCli::insert at :0 uri http://192.168.1.100:10246/MDEServer/53E296A7-3F0B-4C6C-A2F8-0A4F7AA2FB62/1000.mp3?formatID=00000029-A9AF-4584-84E2-55BFEF0A7D7E
src/mpdcli.cxx:537::MPDCli::play(pos=0)
src/avtransport.cxx:404::MPD Status: 1
src/mpdcli.cxx:572::MPDCli::stop
libupnpp/device/device.cxx:293::UPNP_CONTROL_ACTION_REQUEST: GetTransportInfo. Params: <?xml version="1.0"? >
<m:GetTransportInfo xmlns:m="urn:schemas-upnp-org:service:AVTransport:1" >
<InstanceID xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="ui4" >0</InstanceID >
</m:GetTransportInfo >

src/mpdcli.cxx:811::MPDCli::getQueueData
src/mpdcli.cxx:796::MPDCli::getQueueSongs: 1 songs
src/ohplaylist.cxx:146::OHPlaylist::translateIdArray: current ids: 21
src/ohplaylist.cxx:220::OHPlaylist::makeIdArray: using mpd data for 21 uri http://192.168.1.100:10246/MDEServer/53E296A7-3F0B-4C6C-A2F8-0A4F7AA2FB62/1000.mp3?formatID=00000029-A9AF-4584-84E2-55BFEF0A7D7E
src/ohplaylist.cxx:227::OHPlaylist::makeIdArray: dropping uri http://192.168.1.100:10246/MDEServer/53E296A7-3F0B-4C6C-A2F8-0A4F7AA2FB62/1000.mp3
src/ohplaylist.cxx:234::OHPlaylist::makeIdArray: saving metacache
src/ohmetacache.cxx:128::dmcacheSave: got save task: 1 entries to /var/cache/upmpdcli//metacache
libupnpp/device/device.cxx:293::UPNP_CONTROL_ACTION_REQUEST: GetCurrentTransportActions. Params: <?xml version="1.0"? >
<m:GetCurrentTransportActions xmlns:m="urn:schemas-upnp-org:service:AVTransport:1" >
<InstanceID xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="ui4" >0</InstanceID >
</m:GetCurrentTransportActions >

libupnpp/device/device.cxx:293::UPNP_CONTROL_ACTION_REQUEST: Play. Params: <?xml version="1.0"? >
<m:Play xmlns:m="urn:schemas-upnp-org:service:AVTransport:1" >
<InstanceID xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="ui4" >0</InstanceID >
<Speed xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="string" >1</Speed >
</m:Play >

src/avtransport.cxx:569::UpMpdAVTransport::playcontrol State: 1 what 1
src/mpdcli.cxx:537::MPDCli::play(pos=-1)
libupnpp/device/device.cxx:293::UPNP_CONTROL_ACTION_REQUEST: GetTransportInfo. Params: <?xml version="1.0"? >
<m:GetTransportInfo xmlns:m="urn:schemas-upnp-org:service:AVTransport:1" >
<InstanceID xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="ui4" >0</InstanceID >
</m:GetTransportInfo >

libupnpp/device/device.cxx:293::UPNP_CONTROL_ACTION_REQUEST: GetPositionInfo. Params: <?xml version="1.0"? >
<m:GetPositionInfo xmlns:m="urn:schemas-upnp-org:service:AVTransport:1" >
<InstanceID xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="ui4" >0</InstanceID >
</m:GetPositionInfo >

joerg-krause writes

I have an idea how to fix this issue: The MPD state is fetched after the clearQueue() command: https://github.com/medoc92/upmpdcli/blob/master/src/avtransport.cxx#L332-L335, which returns always STOP for !setnext.

upmpdcli should get the MPD state before clearing the MPD queue.

joerg-krause writes

Note that MPD cannot handle a raw PCM stream via HTTP. I’m using a custom procolinfo.txt which had PCM mime-types enabled, e.g. audio/L16. After removing those mime-types from my protocolinfo.txt WMP does not send any PCM encoded URIs in the filed CurrentURIMetaData anymore.

joerg-krause writes

medoc92 writes

J�rg Krause writes:

> Note that MPD adds support for audio\L16 in commit MaxKellermann/MPD@5a22a0c.

Thanks for the heads up, this should mean that we can uncomment the protocolinfo lines if the mpd instance includes the mpd patch. Did you try it ?

medoc92 writes

Ok, had a look at this. The MPD patch is buggy (L16 is network byte order, MPD takes it as little-endian). Another issue is that the transcoding server I tried this with (AssetUPnP) does not set the rate and channels parameters in the MIME type (just audio/L16, not audio/L16;rate=44100;channels=2). I can fix the byte order issue and make MPD default to 44100/2, but I doubt that the latter will make it into the official source, as it’s not conform to the rfc (says no default for rate, and 1 default channel).

joerg-krause writes

@medoc92 No, I have not tried yet.

If AssetUPnP does not send the parameters in the MIME type maybe we can convince the maintainers to add compatibility to this RFC…