hzeller / gmrender-resurrect

Resource efficient UPnP/DLNA renderer, optimal for Raspberry Pi, CuBox or a general MediaServer. Fork of GMediaRenderer to add some features to make it usable.
GNU General Public License v2.0
832 stars 202 forks source link

Adding command line option for "insert silence before playing 1st song on the list" #57

Open pinkgold opened 10 years ago

pinkgold commented 10 years ago

Hi, hzeller!!

My name is Jerry and I am the 1st-distributor of gmrender-resurrect in Korea.

You can check it in my blog:

http://blog.naver.com/casteraprn/80199922944

First of all, As one of the members of Linux UPNP user group in Korea,

I deeply appreciate your state-of-the-art work of gmrender-resurrect.

I applied your program to Pogo and Alix, so many of their users are really enjoying UPNP feature of each device.

Here I wrote this issue because I want to suggest making an option of your future release, if possible.

Whenever I started to play a list of music files, 1~3 seconds of beginning of the 1st file in the list is skipped always and it makes me really crazy.

So if you add "insert silence" option with user-input duration and inset that silence whenever gmrender-resurrect just starts to playing a list of music,

It will be very useful to users like me.

Thank you so much for reading this message.

With all my honers and respects, Jerry

hzeller commented 10 years ago

So gmrender dosen't know about lists, it gets the song one by one from the UPnP controller. So it wouldn't know when to insert the silence. From what you describe, that happens in the first song the UPnP controller sends to the renderer. What UPnP controller program are you using on your phone or computer to remotely control gmrender-resurrect ?

This shouldn't happen in the first place, it should play right away. gmrender passes the URL with the content it gets from the UPnP controller directly to gstreamer, which should take care of the rest. What version of gstreamer are you using ?

Can you create a logfile ( shown here how to do https://github.com/hzeller/gmrender-resurrect/blob/master/INSTALL.md#misc-options ) that shows the startup and the first start of the song in which you hear the skipping ?

If you paste it here, make sure to have three backticks around the logfile ( described here https://help.github.com/articles/github-flavored-markdown#fenced-code-blocks ), otherwise the bugtracker swallows some XML characters.

christiscarborough commented 10 years ago

I too am experiencing these gaps at the beginning of tracks. Here's a log of one where the gap was over 1sec.

INFO  [2014-03-19 17:02:06.830254 | transport] RelativeTimePosition: 0:01:02
INFO  [2014-03-19 17:02:07.841302 | transport] RelativeTimePosition: 0:01:03
INFO  [2014-03-19 17:02:08.846481 | transport] RelativeTimePosition: 0:01:04
INFO  [2014-03-19 17:02:09.852293 | transport] RelativeTimePosition: 0:01:05
INFO  [2014-03-19 17:02:10.738901 | gstreamer] about-to-finish cb: setting uri http://192.168.37.90:8200/MediaItems/7423.mp3
INFO  [2014-03-19 17:02:10.739284 | transport] AVTransportURI: http://192.168.37.90:8200/MediaItems/7423.mp3
INFO  [2014-03-19 17:02:10.739611 | transport] AVTransportURIMetaData: <DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" xmlns:sec="http://www.sec.co.kr/"><item id="64$0$0$BD$1$F" parentID="64$0$0$BD$1" restricted="1"><upnp:class>object.item.audioItem.musicTrack</upnp:class><dc:title>The Indifferent Love Of The Lord Our God</dc:title><dc:creator>Simon Indelicate</dc:creator><upnp:artist>Simon Indelicate</upnp:artist><upnp:albumArtURI>http://192.168.37.90:8200/AlbumArt/5288-7423.jpg</upnp:albumArtURI><dc:date>2011-01-01</dc:date><upnp:album>The Book Of Job The Musical: The Original Cast Recording - ACT TWO</upnp:album><upnp:originalTrackNumber>16</upnp:originalTrackNumber><res protocolInfo="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000" bitrate="256000" sampleFrequency="44100" nrAudioChannels="2" size="11008373" duration="0:04:52.000">http://192.168.37.90:8200/MediaItems/7423.mp3</res></item></DIDL-Lite>
INFO  [2014-03-19 17:02:10.739825 | transport] CurrentTrackURI: http://192.168.37.90:8200/MediaItems/7423.mp3
INFO  [2014-03-19 17:02:10.739974 | transport] CurrentTrackMetaData: <DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" xmlns:sec="http://www.sec.co.kr/"><item id="64$0$0$BD$1$F" parentID="64$0$0$BD$1" restricted="1"><upnp:class>object.item.audioItem.musicTrack</upnp:class><dc:title>The Indifferent Love Of The Lord Our God</dc:title><dc:creator>Simon Indelicate</dc:creator><upnp:artist>Simon Indelicate</upnp:artist><upnp:albumArtURI>http://192.168.37.90:8200/AlbumArt/5288-7423.jpg</upnp:albumArtURI><dc:date>2011-01-01</dc:date><upnp:album>The Book Of Job The Musical: The Original Cast Recording - ACT TWO</upnp:album><upnp:originalTrackNumber>16</upnp:originalTrackNumber><res protocolInfo="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000" bitrate="256000" sampleFrequency="44100" nrAudioChannels="2" size="11008373" duration="0:04:52.000">http://192.168.37.90:8200/MediaItems/7423.mp3</res></item></DIDL-Lite>
INFO  [2014-03-19 17:02:10.740220 | transport] NextAVTransportURI:
INFO  [2014-03-19 17:02:10.740358 | transport] NextAVTransportURIMetaData:
INFO  [2014-03-19 17:02:10.741503 | transport] LastChange: <?xml version="1.0"?>
<Event xmlns="urn:schemas-upnp-org:metadata-1-0/AVT/">
<InstanceID val="0">
<AVTransportURI val="http://192.168.37.90:8200/MediaItems/7423.mp3"></AVTransportURI>
<AVTransportURIMetaData val="&lt;DIDL-Lite xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:dlna=&quot;urn:schemas-dlna-org:metadata-1-0/&quot; xmlns:sec=&quot;http://www.sec.co.kr/&quot;&gt;&lt;item id=&quot;64$0$0$BD$1$F&quot; parentID=&quot;64$0$0$BD$1&quot; restricted=&quot;1&quot;&gt;&lt;upnp:class&gt;object.item.audioItem.musicTrack&lt;/upnp:class&gt;&lt;dc:title&gt;The Indifferent Love Of The Lord Our God&lt;/dc:title&gt;&lt;dc:creator&gt;Simon Indelicate&lt;/dc:creator&gt;&lt;upnp:artist&gt;Simon Indelicate&lt;/upnp:artist&gt;&lt;upnp:albumArtURI&gt;http://192.168.37.90:8200/AlbumArt/5288-7423.jpg&lt;/upnp:albumArtURI&gt;&lt;dc:date&gt;2011-01-01&lt;/dc:date&gt;&lt;upnp:album&gt;The Book Of Job The Musical: The Original Cast Recording - ACT TWO&lt;/upnp:album&gt;&lt;upnp:originalTrackNumber&gt;16&lt;/upnp:originalTrackNumber&gt;&lt;res protocolInfo=&quot;http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000&quot; bitrate=&quot;256000&quot; sampleFrequency=&quot;44100&quot; nrAudioChannels=&quot;2&quot; size=&quot;11008373&quot; duration=&quot;0:04:52.000&quot;&gt;http://192.168.37.90:8200/MediaItems/7423.mp3&lt;/res&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;"></AVTransportURIMetaData>
<CurrentTrackURI val="http://192.168.37.90:8200/MediaItems/7423.mp3"></CurrentTrackURI>
<CurrentTrackMetaData val="&lt;DIDL-Lite xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:dlna=&quot;urn:schemas-dlna-org:metadata-1-0/&quot; xmlns:sec=&quot;http://www.sec.co.kr/&quot;&gt;&lt;item id=&quot;64$0$0$BD$1$F&quot; parentID=&quot;64$0$0$BD$1&quot; restricted=&quot;1&quot;&gt;&lt;upnp:class&gt;object.item.audioItem.musicTrack&lt;/upnp:class&gt;&lt;dc:title&gt;The Indifferent Love Of The Lord Our God&lt;/dc:title&gt;&lt;dc:creator&gt;Simon Indelicate&lt;/dc:creator&gt;&lt;upnp:artist&gt;Simon Indelicate&lt;/upnp:artist&gt;&lt;upnp:albumArtURI&gt;http://192.168.37.90:8200/AlbumArt/5288-7423.jpg&lt;/upnp:albumArtURI&gt;&lt;dc:date&gt;2011-01-01&lt;/dc:date&gt;&lt;upnp:album&gt;The Book Of Job The Musical: The Original Cast Recording - ACT TWO&lt;/upnp:album&gt;&lt;upnp:originalTrackNumber&gt;16&lt;/upnp:originalTrackNumber&gt;&lt;res protocolInfo=&quot;http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000&quot; bitrate=&quot;256000&quot; sampleFrequency=&quot;44100&quot; nrAudioChannels=&quot;2&quot; size=&quot;11008373&quot; duration=&quot;0:04:52.000&quot;&gt;http://192.168.37.90:8200/MediaItems/7423.mp3&lt;/res&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;"></CurrentTrackMetaData>
<NextAVTransportURI val=""></NextAVTransportURI>
<NextAVTransportURIMetaData val=""></NextAVTransportURIMetaData>
</InstanceID>
</Event>
INFO  [2014-03-19 17:02:10.858813 | transport] RelativeTimePosition: 0:01:06
INFO  [2014-03-19 17:02:11.042262 | gstreamer] Set next uri to 'http://192.168.37.90:8200/MediaItems/7424.mp3'
INFO  [2014-03-19 17:02:11.042475 | transport] NextAVTransportURI: http://192.168.37.90:8200/MediaItems/7424.mp3
INFO  [2014-03-19 17:02:11.042670 | transport] NextAVTransportURIMetaData: <DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" xmlns:sec="http://www.sec.co.kr/"><item id="64$0$0$BD$1$10" parentID="64$0$0$BD$1" restricted="1"><upnp:class>object.item.audioItem.musicTrack</upnp:class><dc:title>God speaks to his creation</dc:title><dc:creator>Simon Indelicate</dc:creator><upnp:artist>Simon Indelicate</upnp:artist><upnp:albumArtURI>http://192.168.37.90:8200/AlbumArt/5289-7424.jpg</upnp:albumArtURI><upnp:genre>Other</upnp:genre><dc:date>2011-01-01</dc:date><upnp:album>The Book Of Job The Musical: The Original Cast Recording - ACT TWO</upnp:album><upnp:originalTrackNumber>17</upnp:originalTrackNumber><res protocolInfo="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000" bitrate="256000" sampleFrequency="44100" nrAudioChannels="2" size="6292112" duration="0:02:24.000">http://192.168.37.90:8200/MediaItems/7424.mp3</res></item></DIDL-Lite>
INFO  [2014-03-19 17:02:11.043640 | transport] LastChange: <?xml version="1.0"?>
<Event xmlns="urn:schemas-upnp-org:metadata-1-0/AVT/">
<InstanceID val="0">
<NextAVTransportURI val="http://192.168.37.90:8200/MediaItems/7424.mp3"></NextAVTransportURI>
<NextAVTransportURIMetaData val="&lt;DIDL-Lite xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:dlna=&quot;urn:schemas-dlna-org:metadata-1-0/&quot; xmlns:sec=&quot;http://www.sec.co.kr/&quot;&gt;&lt;item id=&quot;64$0$0$BD$1$10&quot; parentID=&quot;64$0$0$BD$1&quot; restricted=&quot;1&quot;&gt;&lt;upnp:class&gt;object.item.audioItem.musicTrack&lt;/upnp:class&gt;&lt;dc:title&gt;God speaks to his creation&lt;/dc:title&gt;&lt;dc:creator&gt;Simon Indelicate&lt;/dc:creator&gt;&lt;upnp:artist&gt;Simon Indelicate&lt;/upnp:artist&gt;&lt;upnp:albumArtURI&gt;http://192.168.37.90:8200/AlbumArt/5289-7424.jpg&lt;/upnp:albumArtURI&gt;&lt;upnp:genre&gt;Other&lt;/upnp:genre&gt;&lt;dc:date&gt;2011-01-01&lt;/dc:date&gt;&lt;upnp:album&gt;The Book Of Job The Musical: The Original Cast Recording - ACT TWO&lt;/upnp:album&gt;&lt;upnp:originalTrackNumber&gt;17&lt;/upnp:originalTrackNumber&gt;&lt;res protocolInfo=&quot;http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000&quot; bitrate=&quot;256000&quot; sampleFrequency=&quot;44100&quot; nrAudioChannels=&quot;2&quot; size=&quot;6292112&quot; duration=&quot;0:02:24.000&quot;&gt;http://192.168.37.90:8200/MediaItems/7424.mp3&lt;/res&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;"></NextAVTransportURIMetaData>
</InstanceID>
</Event>
INFO  [2014-03-19 17:02:11.861242 | transport] RelativeTimePosition: 0:01:07
INFO  [2014-03-19 17:02:14.377335 | transport] CurrentTrackDuration: 0:04:52
INFO  [2014-03-19 17:02:14.377694 | transport] LastChange: <?xml version="1.0"?>
<Event xmlns="urn:schemas-upnp-org:metadata-1-0/AVT/">
<InstanceID val="0">
<CurrentTrackDuration val="0:04:52"></CurrentTrackDuration>
</InstanceID>
</Event>
INFO  [2014-03-19 17:02:14.879789 | transport] CurrentTrackDuration: 0:04:51
INFO  [2014-03-19 17:02:14.880172 | transport] RelativeTimePosition: 0:00:02
INFO  [2014-03-19 17:02:14.880397 | transport] LastChange: <?xml version="1.0"?>
<Event xmlns="urn:schemas-upnp-org:metadata-1-0/AVT/">
<InstanceID val="0">
<CurrentTrackDuration val="0:04:51"></CurrentTrackDuration>
</InstanceID>
</Event>
INFO  [2014-03-19 17:02:15.382405 | transport] CurrentTrackDuration: 0:04:52
INFO  [2014-03-19 17:02:15.382702 | transport] RelativeTimePosition: 0:00:03
INFO  [2014-03-19 17:02:15.382903 | transport] LastChange: <?xml version="1.0"?>
<Event xmlns="urn:schemas-upnp-org:metadata-1-0/AVT/">
<InstanceID val="0">
<CurrentTrackDuration val="0:04:52"></CurrentTrackDuration>
</InstanceID>
</Event>
INFO  [2014-03-19 17:02:16.388146 | transport] RelativeTimePosition: 0:00:04
INFO  [2014-03-19 17:02:17.392475 | transport] RelativeTimePosition: 0:00:05
INFO  [2014-03-19 17:02:18.396193 | transport] RelativeTimePosition: 0:00:06
INFO  [2014-03-19 17:02:19.399845 | transport] RelativeTimePosition: 0:00:07

Note that I have tried replacing ALSA with PulseAudio to see if was the underlying infrastructure. It didn't appear to be - if anything the problem was worse when using PulseAudio as the gstreamer backend.