INTERACT FORUM

More => Old Versions => JRiver Media Center 20 for Windows => Topic started by: mattlovell on October 21, 2014, 09:22:33 am

Title: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on October 21, 2014, 09:22:33 am
In a different thread (within the MC20 forum), I posted the following:

Quote
The Yamaha RX-A1040 and JRiver's DNLA server occasionally get into a mode in which switching to a new track/song has a moment of initial static (or pops) before successful playback begins.  In other threads on this forum, I've seen the static attributed to mis-interpretation of the header/tags for a file.  Why is the problem occurring with L16 (no header), though?  Is there anything I can do to prevent this static?

This static only seems to happen when pushing a track change to the Yamaha.  If the Yamaha itself is just progressing through an established playlist, it doesn't occur.  This also doesn't occur all the time; I haven't figured out what triggers it, but once established it seems fairly persistent (until the next power cycle).

I also noticed that JRemote (and perhaps JRiver, I didn't walk back to the computer to check) can get out-of-sync with the receiver's current position within the playlist.

Any thoughts?  I'm open to trying a few experiments and, if they would be helpful, capturing logs.

Thanks!
  Matt
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on October 21, 2014, 10:41:22 am
The earlier thread I found referencing static with track changes was for MC18:

  http://yabb.jriver.com/interact/index.php?topic=76494.0

Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on October 21, 2014, 10:50:14 am
It's also, at first impression, similar to this thread:

  http://yabb.jriver.com/interact/index.php?topic=74972.0

The conclusion from that thread, below, is that the noise was being caused by tags.  I swear that I'm already running PCM L16, though.

I'll have to double-check that again, but I was wondering if there were any other possible causes.


Quote
In case anyone is interested, a technical note about wav & aif files: such files comprise linear pcm audio data sandwiched between a so called RIFF header at the start, and the ID3v2 tag data / album art at the end. As horse says, the WAV and AIF formats are well and publicly documented.

If you hear a click at the start of a track, it means the player tried to convert the RIFF header into sound, and if you hear white noise at the end, it means the player tried to convert the tags and album art into sound.

If your player outputs such clicks or white noise, this is fundamentally unacceptable from any self respecting manufacturer. It is simply shoddy programming, and shows that the programmers were too lazy to read or implement the most basic of specs. I would guess their test procedure was something like "yeah buddy there's sound coming out; ok that's fine then..." => So you should definitely give WD (and any other player manufacturer) hell for responding in such a patronising way.

PS the good news is that if you set MC to do Always Convert / L16 No header, it strips the RIFF header from the start and the tags & album art from the end, and simply feeds the remaining intervening pcm audio data straight to your player unmolested. (In the case of wav just swapping the byte order).
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on October 21, 2014, 06:07:37 pm
For anyone looking at this thread for reference, Bob suggested the following:

Quote
If you right click on the zone and under DLNA controller options, disable SetNext support does it still happen?
My experimentation has been limited (about 10 minutes of switching tracks), but disabling SetNext appears to have resolved the issue!

How should I present this deficiency to Yamaha (as it seems like something a firmware update could resolve, since little of DLNA/UPnP stack should be hardcoded)? 
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on October 21, 2014, 08:42:37 pm
bob writes:
Quote
It would be interesting if you downloaded UPnP Tools for Developer and ran the device spy to see if your Yamaha claims to support the SetNextAVTransportURI function.

Here's the device XML for the RX-A1040.  Looks like they do (if seeing service:AVTransport:1 is what I'm looking for).

<root>
 <yamaha:X_device>
  <yamaha:X_URLBase>http://10.0.0.79:80/</yamaha:X_URLBase>
  <yamaha:X_serviceList><yamaha:X_service>
  <yamaha:X_specType>urn:schemas-yamaha-com:service:X_YamahaRemoteControl:1</yamaha:X_specType>
  <yamaha:X_controlURL>/YamahaRemoteControl/ctrl</yamaha:X_controlURL>
  <yamaha:X_unitDescURL>/YamahaRemoteControl/desc.xml</yamaha:X_unitDescURL>
  </yamaha:X_service></yamaha:X_serviceList></yamaha:X_device>
  <specVersion>
    <major>1</major>
    <minor>0</minor>
  </specVersion>
<device ms:X_MS_SupportsWMDRM="true">
  <dlna:X_DLNADOC>DMR-1.50</dlna:X_DLNADOC>
  <pnpx:X_compatibleId>MS_DigitalMediaDeviceClass_DMR_V001
  </pnpx:X_compatibleId><pnpx:X_deviceCategory>MediaDevices Multimedia.DMR MediaDevice.DMC
  </pnpx:X_deviceCategory><pnpx:X_hardwareId>VEN_0033&DEV_0006&REV_01
  </pnpx:X_hardwareId><df:X_deviceCategory>Multimedia.DMR
  </df:X_deviceCategory>
    <deviceType>urn:schemas-upnp-org:device:MediaRenderer:1</deviceType>
    <friendlyName>RX-A1040 B536C5</friendlyName>
    <manufacturer>Yamaha Corporation</manufacturer>
    <manufacturerURL>http://www.yamaha.com/</manufacturerURL>
    <modelDescription>AV Receiver</modelDescription>
    <modelName>RX-A1040</modelName>
    <modelNumber>A1040</modelNumber>
    <modelURL>http://www.yamaha.com/</modelURL>
    <serialNumber>00689AA3</serialNumber>
    <UDN>uuid:5f9ec1b3-ed59-1900-4530-00a0deb536c5</UDN>
    <UPC>123810928305</UPC>
   <iconList>
     <icon><mimetype>image/jpeg</mimetype><width>48</width><height>48</height><depth>24</depth><url>/BCO_device_sm_icon.jpg</url></icon>
     <icon><mimetype>image/jpeg</mimetype><width>120</width><height>120</height><depth>24</depth><url>/BCO_device_lrg_icon.jpg</url></icon>
     <icon><mimetype>image/png</mimetype><width>48</width><height>48</height><depth>24</depth><url>/BCO_device_sm_icon.png</url></icon>
    <icon><mimetype>image/png</mimetype><width>120</width><height>120</height><depth>24</depth><url>/BCO_device_lrg_icon.png</url></icon>
  </iconList><serviceList>
  <service>
    <serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType>
    <serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId>
    <SCPDURL>/RenderingControl/desc.xml</SCPDURL>
    <controlURL>/RenderingControl/ctrl</controlURL>
    <eventSubURL>/RenderingControl/evt</eventSubURL>
  </service>
  <service>
    <serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>
    <serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
    <SCPDURL>/ConnectionManager/desc.xml</SCPDURL>
    <controlURL>/ConnectionManager/ctrl</controlURL>
    <eventSubURL>/ConnectionManager/evt</eventSubURL>
  </service>
  <service>
    <serviceType>urn:schemas-upnp-org:service:AVTransport:1</serviceType>
    <serviceId>urn:upnp-org:serviceId:AVTransport</serviceId>
    <SCPDURL>/AVTransport/desc.xml</SCPDURL>
    <controlURL>/AVTransport/ctrl</controlURL>
    <eventSubURL>/AVTransport/evt</eventSubURL>
  </service>
  </serviceList>
  <presentationURL>http://10.0.0.79/</presentationURL>
 </device>
</root>


also of likely interest is the excerpt from the service XML:

<action>
  <name>SetNextAVTransportURI</name>
     <argumentList>
        <argument>
            <name>InstanceID</name>
            <direction>in</direction>
            <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
        </argument>
        <argument>
           <name>NextURI</name>
           <direction>in</direction>
           <relatedStateVariable>NextAVTransportURI</relatedStateVariable>
        </argument>
        <argument>
           <name>NextURIMetaData</name>
           <direction>in</direction>
           <relatedStateVariable>NextAVTransportURIMetaData</relatedStateVariable>
       </argument>
   </argumentList>
</action>
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: bob on October 30, 2014, 03:19:45 pm
In UPnP tools, can you just click on the + to expand the device, then click on the + to expand AVTransport:1 then see if the function exists (note that the variable may exist but not the function).
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on October 30, 2014, 07:02:14 pm
Quote
In UPnP tools, can you just click on the + to expand the device, then click on the + to expand AVTransport:1 then see if the function exists (note that the variable may exist but not the function).

Yes, expanding the AVTransport:1 scheme, I see the following functions (among others):


The SetNextAVTransportURI() function has the arguments listed in the action XML excerpt from my previous post.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: bob on October 30, 2014, 07:26:56 pm
Yes, expanding the AVTransport:1 scheme, I see the following functions (among others):

  • Seek
  • SetAVTransportURI
  • SetNextAVTransportURI
  • SetPlayMode

The SetNextAVTransportURI() function has the arguments listed in the action XML excerpt from my previous post.

Ok, I suspect then there might be a problem with GetMediaInfo.
We use that to determine what the renderer thinks is the NextURI to be played.
This function is required to be supported by the base DLNA spec.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on October 30, 2014, 08:59:18 pm
Quote
Ok, I suspect then there might be a problem with GetMediaInfo.
We use that to determine what the renderer thinks is the NextURI to be played.
This function is required to be supported by the base DLNA spec.

A problem on JRiver's side or on the receiver's side?  (It was unclear to me above.)

There are certainly a lot of parameters for GetMediaInfo(), I'll give it that!
<action>
  <name>GetMediaInfo</name>
  <argumentList>
  <argument><name>InstanceID</name><direction>in</direction><relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable></argument>
  <argument><name>NrTracks</name><direction>out</direction><relatedStateVariable>NumberOfTracks</relatedStateVariable></argument>
  <argument><name>MediaDuration</name><direction>out</direction><relatedStateVariable>CurrentMediaDuration</relatedStateVariable></argument>
  <argument><name>CurrentURI</name><direction>out</direction><relatedStateVariable>AVTransportURI</relatedStateVariable></argument>
  <argument><name>CurrentURIMetaData</name><direction>out</direction><relatedStateVariable>AVTransportURIMetaData</relatedStateVariable></argument>
  <argument><name>NextURI</name><direction>out</direction><relatedStateVariable>NextAVTransportURI</relatedStateVariable></argument>
  <argument><name>NextURIMetaData</name><direction>out</direction><relatedStateVariable>NextAVTransportURIMetaData</relatedStateVariable></argument>
  <argument><name>PlayMedium</name><direction>out</direction><relatedStateVariable>PlaybackStorageMedium</relatedStateVariable></argument>
  <argument><name>RecordMedium</name><direction>out</direction><relatedStateVariable>RecordStorageMedium</relatedStateVariable></argument>
  <argument><name>WriteStatus</name><direction>out</direction><relatedStateVariable>RecordMediumWriteStatus</relatedStateVariable></argument> 
 </argumentList>
</action>
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: bob on October 30, 2014, 11:36:13 pm
A problem on JRiver's side or on the receiver's side?  (It was unclear to me above.)

There are certainly a lot of parameters for GetMediaInfo(), I'll give it that!
<action>
  <name>GetMediaInfo</name>
  <argumentList>
  <argument><name>InstanceID</name><direction>in</direction><relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable></argument>
  <argument><name>NrTracks</name><direction>out</direction><relatedStateVariable>NumberOfTracks</relatedStateVariable></argument>
  <argument><name>MediaDuration</name><direction>out</direction><relatedStateVariable>CurrentMediaDuration</relatedStateVariable></argument>
  <argument><name>CurrentURI</name><direction>out</direction><relatedStateVariable>AVTransportURI</relatedStateVariable></argument>
  <argument><name>CurrentURIMetaData</name><direction>out</direction><relatedStateVariable>AVTransportURIMetaData</relatedStateVariable></argument>
  <argument><name>NextURI</name><direction>out</direction><relatedStateVariable>NextAVTransportURI</relatedStateVariable></argument>
  <argument><name>NextURIMetaData</name><direction>out</direction><relatedStateVariable>NextAVTransportURIMetaData</relatedStateVariable></argument>
  <argument><name>PlayMedium</name><direction>out</direction><relatedStateVariable>PlaybackStorageMedium</relatedStateVariable></argument>
  <argument><name>RecordMedium</name><direction>out</direction><relatedStateVariable>RecordStorageMedium</relatedStateVariable></argument>
  <argument><name>WriteStatus</name><direction>out</direction><relatedStateVariable>RecordMediumWriteStatus</relatedStateVariable></argument> 
 </argumentList>
</action>

This is just a static list of parameters.
The way to test it is to run device spy and invoke GetMediaInfo while the interactions are occurring.
Even if the renderer supports it properly it's quite possible that it can't actually deal with the timing of the reception of the NextURI.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 01, 2014, 09:50:25 am
Quote
The way to test it is to run device spy and invoke GetMediaInfo while the interactions are occurring.
Even if the renderer supports it properly it's quite possible that it can't actually deal with the timing of the reception of the NextURI.

Ok, I'll try experimenting.

Is it significant at all that the behavior doesn't occur all the time?  Upon first power-on (of both the receiver and JRiver), probably around a dozen track/playlist transitions can be pushed to the receiver fine, with no initial static/popping occurring.  After some point, though, the initial static "crops up" and then persists for all further pushed changes.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 01, 2014, 10:05:54 am
Quote
Quote
The way to test it is to run device spy and invoke GetMediaInfo while the interactions are occurring.
Even if the renderer supports it properly it's quite possible that it can't actually deal with the timing of the reception of the NextURI.

Ok, I'll try experimenting.

Random invocations of GetMediaInfo() during playback don't seem to cause any harm.

One other tidbit to note...  This time around, I was using JRiver on the PC directly to push the track changes (making sure that SetNext support was enabled for the RXA1040).  I was unable to induce the static/popping at all, even after many playlist updates.  GetMediaInfo() calls from the Device Spy were also all handled fine.

In all of my previous experimenting, I was sitting out in the living room and using JRemote to change tracks.

What does the addition of JRemote as the control point (not a true DLNA Control Point, I realize) throw into the mix?
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 01, 2014, 10:12:54 am
Quote
One other tidbit to note...  This time around, I was using JRiver on the PC directly to push the track changes (making sure that SetNext support was enabled for the RXA1040).  I was unable to induce the static/popping at all, even after many playlist updates.  GetMediaInfo() calls from the Device Spy were also all handled fine.

Ok, I have to revoke the statement above; the popping just took longer to initiate for some reason.  So, I was able to get the static/popping to happen just pushing URI changes directly from JRiver (no JRemote interaction involved).

Nothing odd happened with the GetMediaInfo() calls from the Device Spy.  Those all completed fine, and didn't induce any static/popping themselves.

  Matt
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 01, 2014, 10:49:53 am
After further experimenting, with JRiver's DLNA server setup to always convert to PCM L16, and with SetNext support enabled for the receiver, I found that disabling "DLNAExtra" (under the DLNA server advanced settings) seems to have done the trick.  Gapless playback is working, so I think that means that SetNext is indeed being used, and (thus far) no static/popping has occurred after many, many playlist changes.

I'm keeping my fingers crossed.  (I noted previously that the behavior seemed "modal".)

What exactly does DLNAExtra provide (i.e., what am I missing) and could its presence/absence explain the behavior observed?

Thanks!
  Matt
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: bob on November 01, 2014, 11:41:22 am
After further experimenting, with JRiver's DLNA server setup to always convert to PCM L16, and with SetNext support enabled for the receiver, I found that disabling "DLNAExtra" (under the DLNA server advanced settings) seems to have done the trick.  Gapless playback is working, so I think that means that SetNext is indeed being used, and (thus far) no static/popping has occurred after many, many playlist changes.

I'm keeping my fingers crossed.  (I noted previously that the behavior seemed "modal".)

What exactly does DLNAExtra provide (i.e., what am I missing) and could its presence/absence explain the behavior observed?

Thanks!
  Matt

DLNAExtra mostly provides extra information about the stream using the DLNA flags. It also provides coverart via Resource records. It could be that your device doesn't like those extra resource records.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 02, 2014, 10:10:45 pm
Quote
After further experimenting, with JRiver's DLNA server setup to always convert to PCM L16, and with SetNext support enabled for the receiver, I found that disabling "DLNAExtra" (under the DLNA server advanced settings) seems to have done the trick.  Gapless playback is working, so I think that means that SetNext is indeed being used, and (thus far) no static/popping has occurred after many, many playlist changes.

I'm keeping my fingers crossed.  (I noted previously that the behavior seemed "modal".)

Arrgg... It took a while, but the static upon track/playlist push eventually cropped up!  So, I guess it's not DLNAExtra after all.

I guess I'm back to disabling SetNext.  Disappointing when playing something like Sgt. Pepper's, but I guess I'll live with it.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 02, 2014, 10:17:06 pm
Quote
Arrgg... It took a while, but the static upon track/playlist push eventually cropped up!  So, I guess it's not DLNAExtra after all.

The phenomenon seems to occur more readily when JRiver has to convert Ogg Vorbis tracks.  (The DLNA Server is set to Always Convert to PCM L16, if you recall.)  I'll try to experiment further...
 
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 02, 2014, 10:49:26 pm
Quote
Arrgg... It took a while, but the static upon track/playlist push eventually cropped up!  So, I guess it's not DLNAExtra after all.

Latest settings:

Lots and lots of track changes thus far, from MP3 to Ogg and back, without the static/pops.   I'm going to let several tracks play through normally and then resume playlist changes after that to see what then happens.

I hate issues that aren't readily reproducible!
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: AndrewFG on November 03, 2014, 08:37:09 am
I am guessing that your problem is is none of the above..

My guess is that it is caused by a bandwith bottleneck on your LAN when the client starts the download of the track from the server. How fast is your LAN? If you are on wifi, then try using an Ethernet connection instead...
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 03, 2014, 09:19:19 am
Quote
My guess is that it is caused by a bandwith bottleneck on your LAN when the client starts the download of the track from the server. How fast is your LAN? If you are on wifi, then try using an Ethernet connection instead...

The two wired segments are running at 1 Gb/s and 100 Mb/s, respectively, with very little traffic (basically just an active iPad with JRemote talking back to MC and the DLNA receiver).  The wireless segment is running 802.11n; the receiver is running on the wired segment "after" the wireless bridge.  A Roku (also wired on that same segment) is able to stream HD movies in 5.1 from Vudu without issue.  Using an Airport Express (with this and the previous receiver), playback has also been fine for years.

My first inclination is to think that there's plenty of BW (and responsiveness) for a 16-bit stereo PCM stream.

Disabling SetNext also definitely had an impact (seemingly eliminating the problem).  I would like to have gapless playback, so thus my various experiments with SetNext re-enabled.  I'm willing to buy into the notion that there is something about the communication between the receiver and JRiver that, only eventually, confuses the receiver.  That seems to be the case since SetNext functionality does appear to work (it's advertised as implemented and does achieve gapless playback when enabled).   I am thoroughly confused why the problem takes a while to manifest, which lends some credence to suspecting network traffic.  It's just hard to believe that the fairly limited communication I've seen for DLNA would stress the network.

I would like to understand the protocol involved in push playlist changes over DLNA better.  Does the DLNA Control Point first pause or stop the renderer, push the new media URIs, and then "push" play? 
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: bob on November 03, 2014, 09:39:06 am
Lots of renderers implement the bitrate field incorrectly.
That's why it's not enabled by default.

When using the SetNext function there is no stop/pause/play logic used at all. It's all up to the renderer to do that when it wants. That is how the tracks can be played without a gap.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 03, 2014, 09:47:33 am
Quote
Lots of renderers implement the bitrate field incorrectly.
That's why it's not enabled by default.

You can count Yamaha in that camp.  I had enabled it a while ago and just left it enabled, since it didn't seem to be doing anything. 

Quote
When using the SetNext function there is no stop/pause/play logic used at all. It's all up to the renderer to do that when it wants. That is how the tracks can be played without a gap.

How about when the playlist is changing (i.e., one is pushing a new track and/or playlist to the renderer)?
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 03, 2014, 10:13:19 am
Quote
How about when the playlist is changing (i.e., one is pushing a new track and/or playlist to the renderer)?

"Peeking" with Wireshark, it looks like the following communication takes place:


So, seems like the renderer is directed to stop prior to updating the playlist.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: bob on November 03, 2014, 10:25:24 am
"Peeking" with Wireshark, it looks like the following communication takes place:

  • JRiver checks current status of the renderer
  • Renderer replies that it is Playing
  • JRiver issues Stop
  • Renderer stops
  • JRiver re-checks current status
  • Render replies that it is Stopped
  • JRiver invokes SetAVTransportURI
  • Renderer provides SetAVTransportURIResponse
  • JRiver issues Play
  • Renderer provides PlayResponse
  • JRiver invokes GetPositionInfo  (and renderer responds...)
  • JRiver invokes GetTransportSettings  (and renderer responds)
  • JRiver invokes GetMediaInfo  (and renderer responds)
  • JRiver invokes SetNextAVTransportURI
  • Renderer provides SetNextAVTransportURIResponse

So, seems like the renderer is directed to stop prior to updating the playlist.

Well of course if you change the currently playing track!
Otherwise, it doesn't do any stop logic.
If you change the next to play the setNext will be resent.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 03, 2014, 11:58:24 am
Looking at a network trace with the initial static manifesting, there are a handful of duplicate TCP acks coming from the receiver, resulting in TCP packet re-transmissions from the JRiver server.  The TCP stream in question is the one transferring the .wav file that was just started.  The re-transmission hiccup occurs in several small bursts near the start of the file; looking at the trace, they may well continue to occur...

Perhaps the network is to be suspected after all.

I don't believe I saw that behavior when playback (and track switching) was completely normal.  I'll experiment further.

Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 04, 2014, 08:33:01 am
Ok, one further tidbit that may be of interest.

Once the problem has presented itself, initial static/popping occurs at the start of a new track even when the renderer is stopped.  One can have nothing playing, having directly stopped the renderer some time ago.  Upon selecting (via JRemote) and new track (and rest of playlist as well) to play, playback starts with a second or two of static. 

So, perhaps there is an internal buffer management issue within the Yamaha receiver, but there certainly is no competing overlap of old and new PCM streams on the network itself.

Is the order of operations that I posted above (Stop, SetAV, Play, SetNextAV) required by the DLNA specification?  I ask since it may be interesting to have both SetAVTransportURI and SetNextAVTransportURI invoked prior to starting Play.  Would such a change be a possible option for the DLNA server?  (I'm also willing to try a one-off, experimental build.)
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 04, 2014, 08:47:33 am
Quote
One can have nothing playing, having directly stopped the renderer some time ago.  Upon selecting (via JRemote) a new track (and rest of playlist as well) to play, playback starts with a second or two of static.

Oh, and at no point in time (whether the initial static occurs or not) does SetNextAVTransportURI not "stick".  Playback of the next track always seems to work as intended and Device Spy invocation of GetMediaInfo() always shows the correct information.

In addition to my question above regarding the order of operations, I have one other...  What happens when setting up AVTransport of a file with no artwork and with no tags?  Does info still get sent over to the renderer as empty strings or are the fields omitted entirely?  (A network trace will give me the answer, so perhaps I'll try to answer my own question this evening.)
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: AndrewFG on November 04, 2014, 09:18:47 am
I still think it is a network bottleneck issue. I don't see anything wrong with the Upnp command sequences you have been posting. And in any case there is nothing in particluar about Upnp command sequences that could cause static to be injected into the stream, since the media stream server and the control point are two quite different animals.

i would try hardwiring your server and your renderer together without any other devices on the LAN segment.
And if that does not work, then I would take your Yamaha in to be checked over..

Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: JimH on November 04, 2014, 10:35:42 am
We've seen problems in the past with devices that didn't like things like cover art or tags in WAV files.

I would expect a network bandwidth problem to cause gaps in playback, but not static.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: bob on November 04, 2014, 11:42:09 am
If you are sending PCM L16 there are no tags.
A test would be to do the conversion in your library to PCM L16 then the same conversion by pulling the URL your rendering device is attempting to get (see the status screen) with a browser and binary compare the resulting file with the manual conversion one.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 04, 2014, 07:14:43 pm
Quote
i would try hardwiring your server and your renderer together without any other devices on the LAN segment.
And if that does not work, then I would take your Yamaha in to be checked over..

Problem replicated with the server and renderer wired together.

I may have also stumbled upon the "recipe" to reproduce the issue:


I'll have to power-cycle everything and see if that is indeed a direct route to reproducing the issue.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 04, 2014, 08:55:11 pm
Quote
Problem replicated with the server and renderer wired together.

I may have also stumbled upon the "recipe" to reproduce the issue:

    Allow the rendered to play through a track completely, such that it uses the next track that was setup
    After that change the playlist (perhaps preferably to one of my Ogg Vorbis files with no tags and no artwork?)

I'll have to power-cycle everything and see if that is indeed a direct route to reproducing the issue.

That indeed appears to be the recipe:

This will produce many, many seconds of static/popping for me (at least with a wired connection, I have yet to try the above back on wireless).  At one point, JRiver got thoroughly confused regarding the renderer's state, thinking it was stopped when it was still playing.  Trying to stop the renderer via the Yamaha remote control, it then picked up another track from JRiver.

I tried the DLNA server in foobar 2000, MediaMonkey, and Windows Media Center, but none of them (that I could find) support gapless play back to start with.  (Plus, I would have to buy MediaMonkey Gold in order to stream the Ogg Vorbis file in step 3 above.)

I guess I'll remove my 50ft span of cable and go back to "gappy" playback (or ditch DLNA and resume using Airplay + Airfoil), unless someone has some other suggestion.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: bob on November 04, 2014, 11:55:11 pm
That indeed appears to be the recipe:
  • Start with the first track from Sgt. Pepper's Lonely Hearts Club Band
  • Allow the renderer to move one to Track 2
  • Pick from Bach's English Suites (a set of large-ish Ogg Vorbis with no real tag info and no artwork

This will produce many, many seconds of static/popping for me (at least with a wired connection, I have yet to try the above back on wireless).  At one point, JRiver got thoroughly confused regarding the renderer's state, thinking it was stopped when it was still playing.  Trying to stop the renderer via the Yamaha remote control, it then picked up another track from JRiver.

I tried the DLNA server in foobar 2000, MediaMonkey, and Windows Media Center, but none of them (that I could find) support gapless play back to start with.  (Plus, I would have to buy MediaMonkey Gold in order to stream the Ogg Vorbis file in step 3 above.)

I guess I'll remove my 50ft span of cable and go back to "gappy" playback (or ditch DLNA and resume using Airplay + Airfoil), unless someone has some other suggestion.

So you are saying there is only an issue when you modify the active playlist during playback?
If you just give it a playlist and don't mess with it there is no issue?
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 05, 2014, 07:27:52 am
Quote
So you are saying there is only an issue when you modify the active playlist during playback?
If you just give it a playlist and don't mess with it there is no issue?

Yes, that has been my experience (as noted in the thread's subject).

Of course, I've spent most of my time recently just pushing changes, rather than listening to whole albums! :)  I'll have to carve out some time to do so, both upon initial power-up and after inducing the issue (now that I have a recipe for reproducing it).
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 05, 2014, 07:49:43 am
Quote
Of course, I've spent most of my time recently just pushing changes, rather than listening to whole albums! Smiley  I'll have to carve out some time to do so, both upon initial power-up and after inducing the issue (now that I have a recipe for reproducing it).

I'm 5 tracks into Sgt. Pepper's (after initial power-on for both JRiverMC and the Yamaha), and tracks have been playing fine, transitioning fine as well (and gaplessly).  I'll keep listening a bit more, but we have to head off to work in a bit.

This evening, I'll try triggering the problem and listening again.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 05, 2014, 12:39:13 pm
I noticed the following tidbit in the changelog for MC 20.0.31:

Quote
6. Fixed: DLNA, when pushing tracks to a renderer, when the playlist changes the next item to play, resend the SetNextAVTransportURI (for devices that support it) to keep the playlist in sync with the device.

I'm pretty sure I'm using 20.0.30 at the moment.  Think the above update is relevant to this thread?
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: bob on November 05, 2014, 01:01:41 pm
I noticed the following tidbit in the changelog for MC 20.0.31:

I'm pretty sure I'm using 20.0.30 at the moment.  Think the above update is relevant to this thread?

That's why I asked if it worked when not messing with the playlist.
It could be an issue. There however is a possibility that your renderer may not behave properly when receiving a second SetNext.
Only testing will tell.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: AndrewFG on November 05, 2014, 02:15:19 pm
That's why I asked if it worked when not messing with the playlist.
It could be an issue. There however is a possibility that your renderer may not behave properly when receiving a second SetNext.
Only testing will tell.


Hi bob, It might help if you send a SetNext (nul) to clear the prior playlist url value, and then another SetNext to set the new value. ??
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: bob on November 05, 2014, 02:28:49 pm
Hi bob, It might help if you send a SetNext (nul) to clear the prior playlist url value, and then another SetNext to set the new value. ??
Hi Andrew, I think that could be helpful.
It will be interesting to see if the changes already made affect his issue.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 05, 2014, 10:15:28 pm
Quote
It will be interesting to see if the changes already made affect his issue.

MC 20.0.33 seems to have improved the problem somewhat, but it is still present.  Previously, with MC 20.0.30, the "recipe" I have above (allow a playlist change to occur, then push out a new playlist featuring large ogg vorbis files) was serving to trigger the problem immediately.  With 20.0.33, the problem didn't manifest itself upon the first run through that recipe.  (You can imagine my excitement!)  Repeating the recipe with similar files though (switching between mp3/m4a and ogg vorbis after letting a playlist make some progress), the issue did manifest.

Interestingly (perhaps), allowing a newly-established playlist to progress on its own, no inter-track noise occurred at all.  After that normal playlist progress, the issue also then stopped (at least for a while)!  I could push out a new playlist without issue. 

So, the changes made from 20.0.30 to 20.0.33 seem to have had an effect, but didn't entirely eliminate the behavior.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: bob on November 06, 2014, 10:13:45 am
MC 20.0.33 seems to have improved the problem somewhat, but it is still present.  Previously, with MC 20.0.30, the "recipe" I have above (allow a playlist change to occur, then push out a new playlist featuring large ogg vorbis files) was serving to trigger the problem immediately.  With 20.0.33, the problem didn't manifest itself upon the first run through that recipe.  (You can imagine my excitement!)  Repeating the recipe with similar files though (switching between mp3/m4a and ogg vorbis after letting a playlist make some progress), the issue did manifest.

Interestingly (perhaps), allowing a newly-established playlist to progress on its own, no inter-track noise occurred at all.  After that normal playlist progress, the issue also then stopped (at least for a while)!  I could push out a new playlist without issue. 

So, the changes made from 20.0.30 to 20.0.33 seem to have had an effect, but didn't entirely eliminate the behavior.

If you alter the playlist in the first 10 seconds or last 10 seconds of a track you are going to run into the track changing and SetNext logic. You should avoid that scenario during testing.
If you can reproduce the issue cutting it down to a single variable there might be more that can be done otherwise I'm inclined to dismiss this as a shortcoming of the renderer that can't be worked around.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 06, 2014, 10:33:59 am
Quote
If you alter the playlist in the first 10 seconds or last 10 seconds of a track you are going to run into the track changing and SetNext logic. You should avoid that scenario during testing.

Good to know.

Quote
If you can reproduce the issue cutting it down to a single variable there might be more that can be done otherwise I'm inclined to dismiss this as a shortcoming of the renderer that can't be worked around.

I'll see what else I can discover examining network traces.  The only obvious hiccup I've seen hints at TCP windowing woes with the receiver (which, due to the increased bandwidth, grew worse when I had the receiver wired).  I've forwarded some details to Yamaha's support email, but they've acted as a pretty good black hole in terms of returning any information.

Know of any other Windows or Linux-based DLNA server + control points that support sending SetNextAVTransport?  I'm not interested in switching (JRiver + JRemote is still one of the best user interfaces I've seen), but I would be interested to see if any control point ordered operations differently.  (Looking through the UPnP and DLNA specs, I see they took the route of never, ever providing example flows that put several operations together!)

Finally, I'm curious whether JRiver looked into the ability of AVTransport to convey a playlist (e.g., .m3u) rather than a single track?
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 06, 2014, 09:21:50 pm
I've also been curious why JRiver (and JRemote) get "off" regarding the current track being played by the receiver.  In the typical case, the receiver has advanced to the next track (gaplessly), but its own display and JRiver+JRemote still show the last track.  Peeking at the GetPositionInfoResponse, it is also guilty of hanging onto the last track too long!

Note the Track Duration and RelTime values below.  In this particular trace, I observed RelTime get to 20 seconds in a track that is only 6 seconds long.

<s:Envelope
..xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
..s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
.<s:Body>
..<u:GetPositionInfoResponse xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
...<Track>1</Track>
...<TrackDuration>0:00:06</TrackDuration>
...<TrackMetaData>&lt;DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:dlna="urn:schemas-dlna-org:device-1-0" xmlns:av="urn:schemas-sony-com:av" xmlns:pv="http://www.pv.com/pvns/"&gt;
&lt;item id="F333861" parentID="0" restricted="1"&gt;
&lt;dc:title&gt;The Sex (Intro)&lt;/dc:title&gt;
&lt;upnp:class&gt;object.item.audioItem.musicTrack&lt;/upnp:class&gt;
&lt;upnp:artist&gt;Tove Lo&lt;/upnp:artist&gt;
&lt;upnp:artist role="Performer"&gt;Tove Lo&lt;/upnp:artist&gt;
&lt;upnp:artist role="AlbumArtist"&gt;Tove Lo&lt;/upnp:artist&gt;
&lt;dc:creator&gt;Tove Lo&lt;/dc:creator&gt;
&lt;upnp:album&gt;Queen of the Clouds (Deluxe)&lt;/upnp:album&gt;
&lt;upnp:genre&gt;Spoken Word&lt;/upnp:genre&gt;
&lt;upnp:author role="Composer"&gt;Tove Lo&lt;/upnp:author&gt;
&lt;upnp:originalTrackNumber&gt;1&lt;/upnp:originalTrackNumber&gt;
&lt;upnp:playbackCount&gt;1&lt;/upnp:playbackCount&gt;
&lt;dc:date&gt;2014-09-30T01:00:00&lt;/dc:date&gt;
&lt;pv:playcount&gt;1&lt;/pv:playcount&gt;
&lt;pv:lastPlayedTime&gt;2014-11-05T21:02:44&lt;/pv:lastPlayedTime&gt;
&lt;pv:addedTime&gt;1412134475&lt;/pv:addedTime&gt;
&lt;pv:modificationTime&gt;1412131968&lt;/pv:modificationTime&gt;
&lt;upnp:albumArtURI dlna:profileID="JPEG_TN"&gt;http://10.0.0.3:52101/AArs/333861.jpg&lt;/upnp:albumArtURI&gt;
&lt;res protocolInfo="http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_CI=0" duration="0:00:06.000" size="1068984" nrAudioChannels="2" sampleFrequency="44100" bitsPerSample="16"&gt;http://10.0.0.3:52101/Music/F333861.wav&lt;/res&gt;
&lt;/item&gt;
&lt;/DIDL-Lite&gt;
</TrackMetaData>
...<TrackURI>http://10.0.0.3:52101/Music/F333861.wav</TrackURI>
...<RelTime>0:00:08</RelTime>
...<AbsTime>2:06:14</AbsTime>
...<RelCount>8000</RelCount>
...<AbsCount>7574000</AbsCount>
..</u:GetPositionInfoResponse>
.</s:Body>
</s:Envelope>


Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: bob on November 07, 2014, 11:05:52 am
Don't experiment with 6 second tracks.
The SetNext logic will be unable to deal properly with that. I don't think anything under 20 seconds will work properly. DLNA is simply not that fine grained.

When your renderer proceeds to the next track via the SetNext call the GetMediaInfo should immediately reflect that. If it doesn't it's broken on your renderer.

Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 07, 2014, 11:29:56 am
Quote
The SetNext logic will be unable to deal properly with that. I don't think anything under 20 seconds will work properly. DLNA is simply not that fine grained.

The 6-second track was convenient since I was taking a trace capture.  I've seen the same behavior (JRiver, JRemote, and receiver's own display still show the previous song) for 3 and 4 minutes tracks (even though the receiver has moved on).
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: bob on November 07, 2014, 11:43:08 am
The 6-second track was convenient since I was taking a trace capture.  I've seen the same behavior (JRiver, JRemote, and receiver's own display still show the previous song) for 3 and 4 minutes tracks (even though the receiver has moved on).

Leave JRemote out of this for now, your goal is to cut this down to a single variable.

Since you are said the display doesn't match what's playing, it means GetMediaInfo is broken on your renderer. You can verify this by invoking it from the UPnP tools suite while the second track of a playlist is playing. The results should match what you see on the Media Center display (and what is actually playing).
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: bob on November 07, 2014, 04:40:40 pm
I found an interesting difference between my 2 renderers that will play 24 bit wave which seems to lead me to a reasonable conclusion about your static issue.

If I start playing a file with the Audiophile DAC specified output format 24 bit PCM (the preset) and seek in the file on the Raumfeld, it often gets static or some other weirdness.
If I do the same to the WDTV it plays fine.

My hunch is the following:
The Raumfeld (and your Yamaha) gets the seek command, then does a range request for the file from the point of the seek (we send it a time seek, it calls for a byte range seek).

One problem could simply be that the range request wasn't on a sample boundary (6 bytes in this case). This would cause all sorts of grief. As it turned out for the Raumfeld this wasn't the case.

The other possibility is that the renderer could be (wrongly) trying to interpret the first 44 bytes of the file from the range request as a wave header. I'm very suspicious that this is the case because of the seeming random behavior after the seek. This would also explain why the L16 setting works. It's headerless, it's 16 bits which is bound to be the assumed default and in any case the bit depth is returned in the DLNA flags upon the receipt of the range request. Also, even if there is no explicit seek, the renderer doesn't necessarily open a file and read it's contents in one chunk. Some do multiple range requests during playback.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: AndrewFG on November 08, 2014, 01:47:59 am
I am not sure how Seek would be involved in a SetNext scenario. However assuming that is the case, you need to keep in mind that if MC sends a time based seek, and the renderer converts it to a byte range seek, it will need to have either the bitRate or the file size and track duration. If MC provides a bitRate then byte seek offset = (time seek offset x bitRate). If MC provides a duration and filesize then byte seek offset = (file size x time seek offset / duration). Where, in both cases the renderer must round down to the nearest frame boundary. In either case, its hard to see how MC might be to blame for the renderer seeking to the wrong position.

Perhaps one thing that MC could do though, is in the case that it receives a seek that is not aligned to a frame boundary, it could perhaps force a frame alignment anyway. But there is perhaps then a risk of breaking interoperability with renderers who intentionally send non aligned seeks and have the smarts to align things internally. In that case both MC and the renderer would be being too smart for each other...

Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 08, 2014, 10:27:47 am
Bob writes:
Quote
I found an interesting difference between my 2 renderers that will play 24 bit wave which seems to lead me to a reasonable conclusion about your static issue...

That is an interesting difference but, like AndrewFG, I'm not sure how a Seek command would be involved.  I haven't seen one while examining network traces from the playlist change; all I've seen is Stop, SetAVTransport, Play, then one invocation of your [ GetPositionInfo, GetMediaInfo, GetVolume, GetMute] loop, then SetNextAVTransport.

It may not be fruitful, but I was wondering about the timing of the Play command when JRiver has transcoding to perform.  When does the transcoding get started, when JRiver "knows" about the push+play it's about to issue or only after the HTTP GET from the renderer?  Just curious if there was a race condition there.

FWIW, Yamaha did recently release firmware 1.60 for their Aventage series receivers (bumping up from version 1.44).  I've upgraded, but noticed no difference in behavior as a DLNA renderer.  Sound continues to be excellent, and normal track-to-track progression happens without issue (other than GetPositionInfoResponse and GetMediaInfoResponse taking a while to "catch up" to what's currently being played).
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 08, 2014, 02:25:42 pm
It's a little bit of a diversion from the static/stuttering issue, but ...

Quote
Sound continues to be excellent, and normal track-to-track progression happens without issue (other than GetPositionInfoResponse and GetMediaInfoResponse taking a while to "catch up" to what's currently being played).

JRiver MC19 (specifically, 19.0.163) seems much better able to "track" the currently-playing song on the receiver than does MC20.  I have basically the same DLNA server setup (Always convert, LPCM16) on both.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 08, 2014, 02:35:36 pm
Quote
JRiver MC19 (specifically, 19.0.163) seems much better able to "track" the currently-playing song on the receiver than does MC20.  I have basically the same DLNA server setup (Always convert, LPCM16) on both.

Arrggg... too many options! :)

The two servers weren't quite identical.  Once I got MC20 setup the same as MC19, the "very delayed track change" from GetMediaInfoResponse, GetPositionInfoResponse, and even the receiver's on screen display went away!  (I had the PS3 compatible option set under MC20, as part of a seemingly never-ending chain of experiments).

It's fascinating to me that Renderer behavior can be affected so much by what the Control Point is doing!
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 08, 2014, 02:45:45 pm
Quote
It's fascinating to me that Renderer behavior can be affected so much by what the Control Point is doing!

Experimenting further, and avoiding the 10sec window Bob mentioned in an earlier post, the noise/stutter upon pushing a track and playlist change is also gone!  I swear I had tested things all this set of DLNA server options previously, but I guess not.

Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 08, 2014, 02:57:14 pm
Any declared victory on this topic, of course, must eventually be qualified or retracted...

Here are my current DLNA server settings:

Eventually, with normal playback of Track 1 from Queen of the Clouds (the 6-second track mentioned earlier in this thread), JRiver and the Yamaha got "off" regarding what was played.  The first time playing through that track and its successor, no problem occurred.  Sometime later, though, it cropped back up.  Noticing that the on-screen display of the playing track was incorrect (but >10 second into the new track), I then tried pushing a new track out.  Sure enough, the initial static/stutter occurred again!

When the next-track info was accurate between JRiver and the Yamaha, everything was working without issue.  Somehow, though, the two got off from one other.

I wonder whether AndrewFG's suggestion, earlier in this thread, to do a SetNext of (nul) at some point (perhaps when Stop is issued) would be appropriate after all.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 08, 2014, 10:52:14 pm
Quote
When the next-track info was accurate between JRiver and the Yamaha, everything was working without issue.  Somehow, though, the two got off from one other.

I wonder whether AndrewFG's suggestion, earlier in this thread, to do a SetNext of (nul) at some point (perhaps when Stop is issued) would be appropriate after all.

It's something about transcoding to PCM (at least PCM L16)...

The Yamaha renderer accepts MP3 natively.  If I modify the DLNA server to convert to PCM L16 only when needed, I can play gaplessly with correctly-indicated track transitions, and push new playlists to the renderer, without ever hearing any static or stuttering.  Sending a sequence of MP3s to the receiver in this fashion, SetNext works great!

Pick an m4a file (from recent iTunes purchases) or an ogg vorbis file (or, presumably, anything that requires conversion to PCM), however, and both the next-track indication gets "off" from actual playback and the static/popping makes an appearance.

("Always convert" or "convert when necessary" was one of the differences between how I had MC19 and MC20 setup.  MC19 was setup to only convert when necessary.)

I want to do more experimenting tomorrow, and see if the problem still occurs with PCM 16 with headers.  I'll post what I find out.  (Perhaps the header information within the MP3 files is being used by the Yamaha renderer?)

Does this make sense at all?  More work is required at the DLNA server for transcoding to PCM, of course, but I've never heard any gap or problem during playback, outside of the track transition. 
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: AndrewFG on November 08, 2014, 11:20:42 pm
^

You mention seeing a Stop command in your logs. Normally in the Set / Play / SetNext (repeat) sequence there should not be any Stop commands (nor indeed should there be any Seek commands). Are you doing anything additional that would cause Stops or Seeks to be sent??
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: AndrewFG on November 08, 2014, 11:50:16 pm
^

Bob, I wonder if this could be a caching issue in the renderer? I think MC always provides the exact same url whenever calling Set or SetNext for the same track. So perhaps the renderer tries to satisfy part of its GET from cache, and perhaps it has a bug stitching together the cached results and the new GET results e.g. causing a frame alignment error similar to what you described in your Seek case.

In my DMRA I provide always a different url each time I call Set or SetNext even for the same track, in order to prevent any such caching; I prepend a fixed length prefix of random characters in the url, and chop off that prefix when the GET comes in. That way the renderer always thinks it is downloading a new track, even when MC is actually serving the same track again. And just to make sure, I set the no-cache HTTP header in the GET response too.


Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 09, 2014, 08:36:24 am
AndrewFG asked:
Quote
You mention seeing a Stop command in your logs. Normally in the Set / Play / SetNext (repeat) sequence there should not be any Stop commands (nor indeed should there be any Seek commands). Are you doing anything additional that would cause Stops or Seeks to be sent??

JRiver MC always seems to issue a Stop, SetAVTransport, Play sequence whenever one changes the playlist.  I believe Bob mentioned in an earlier post that they never issue Stop for "normal" track changes. 

I have never observed a Seek (and am never directly specifying that playback start anywhere but at the start of a new track).

Just to repeat one tidbit, I've never heard the static/stutter when the renderer is just progressing from track to track (independent of whether files are being streamed natively or a forced conversion to PCM L16 is occurring).  The only time the static/stutter happens is when establishing a new (albeit 2-entry long) playlist via SetAVTransport and SetNextAVTransport.  Oddly, the static/stutter happens even if the renderer is currently Stopped.

Quote
Bob, I wonder if this could be a caching issue in the renderer? I think MC always provides the exact same url whenever calling Set or SetNext for the same track. So perhaps the renderer tries to satisfy part of its GET from cache, and perhaps it has a bug stitching together the cached results and the new GET results e.g. causing a frame alignment error similar to what you described in your Seek case.

I think it is accurate to say that the same URL is always used in reference to the same track.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 09, 2014, 09:49:55 am
Quote
I want to do more experimenting tomorrow, and see if the problem still occurs with PCM 16 with headers.  I'll post what I find out.  (Perhaps the header information within the MP3 files is being used by the Yamaha renderer?)

With PCM 16 (Header present) and m4a files, the problem still occurs.

I cannot use PCM 16 conversion for Ogg Vorbis, for then I run into my other problem, namely

   Streaming ogg vorbis files using audiophile DAC DLNA server
   http://yabb.jriver.com/interact/index.php?topic=92655.0

The initial static/stutter also occurs with conversion to MP3 High Quality, so at least that part of my latest hypothesis is consistent.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: bob on November 10, 2014, 12:53:05 pm
I am not sure how Seek would be involved in a SetNext scenario. However assuming that is the case, you need to keep in mind that if MC sends a time based seek, and the renderer converts it to a byte range seek, it will need to have either the bitRate or the file size and track duration. If MC provides a bitRate then byte seek offset = (time seek offset x bitRate). If MC provides a duration and filesize then byte seek offset = (file size x time seek offset / duration). Where, in both cases the renderer must round down to the nearest frame boundary. In either case, its hard to see how MC might be to blame for the renderer seeking to the wrong position.

Perhaps one thing that MC could do though, is in the case that it receives a seek that is not aligned to a frame boundary, it could perhaps force a frame alignment anyway. But there is perhaps then a risk of breaking interoperability with renderers who intentionally send non aligned seeks and have the smarts to align things internally. In that case both MC and the renderer would be being too smart for each other...

From what I understood there is no issue if he just lets a playlist play.

I'm starting to lose track of the permutations of this testing and can only devote so much time to it.
Andrew, I agree with your assessment of the seek situation. Since I believe he has the bitrate on by default the renderer is getting all three pieces of information you mentioned.
I can't see why it would be terribly important if the seek wasn't 100% perfect as long as it was on a sample boundry which it appears to be in my testing case anyway.
That's why I thought it might be more likely to have to do with the "missing" wave header for the seeked part of the wave file.

Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: bob on November 10, 2014, 12:55:29 pm
Bob writes:
That is an interesting difference but, like AndrewFG, I'm not sure how a Seek command would be involved.  I haven't seen one while examining network traces from the playlist change; all I've seen is Stop, SetAVTransport, Play, then one invocation of your [ GetPositionInfo, GetMediaInfo, GetVolume, GetMute] loop, then SetNextAVTransport.

It may not be fruitful, but I was wondering about the timing of the Play command when JRiver has transcoding to perform.  When does the transcoding get started, when JRiver "knows" about the push+play it's about to issue or only after the HTTP GET from the renderer?  Just curious if there was a race condition there.

FWIW, Yamaha did recently release firmware 1.60 for their Aventage series receivers (bumping up from version 1.44).  I've upgraded, but noticed no difference in behavior as a DLNA renderer.  Sound continues to be excellent, and normal track-to-track progression happens without issue (other than GetPositionInfoResponse and GetMediaInfoResponse taking a while to "catch up" to what's currently being played).

It doesn't start transcoding until it receives the file request.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: bob on November 10, 2014, 01:06:34 pm
^

Bob, I wonder if this could be a caching issue in the renderer? I think MC always provides the exact same url whenever calling Set or SetNext for the same track. So perhaps the renderer tries to satisfy part of its GET from cache, and perhaps it has a bug stitching together the cached results and the new GET results e.g. causing a frame alignment error similar to what you described in your Seek case.

In my DMRA I provide always a different url each time I call Set or SetNext even for the same track, in order to prevent any such caching; I prepend a fixed length prefix of random characters in the url, and chop off that prefix when the GET comes in. That way the renderer always thinks it is downloading a new track, even when MC is actually serving the same track again. And just to make sure, I set the no-cache HTTP header in the GET response too.

That it could be a caching issue is an interesting idea.
I'll play around with that a bit with the Raumfeld.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: bob on November 10, 2014, 01:08:32 pm
Any declared victory on this topic, of course, must eventually be qualified or retracted...

Here are my current DLNA server settings:
  • Specified output format
  • PCM L16 No Header
  • DLNA
  • DLNAExtra
  • Include session ID

Eventually, with normal playback of Track 1 from Queen of the Clouds (the 6-second track mentioned earlier in this thread), JRiver and the Yamaha got "off" regarding what was played.  The first time playing through that track and its successor, no problem occurred.  Sometime later, though, it cropped back up.  Noticing that the on-screen display of the playing track was incorrect (but >10 second into the new track), I then tried pushing a new track out.  Sure enough, the initial static/stutter occurred again!

When the next-track info was accurate between JRiver and the Yamaha, everything was working without issue.  Somehow, though, the two got off from one other.

I wonder whether AndrewFG's suggestion, earlier in this thread, to do a SetNext of (nul) at some point (perhaps when Stop is issued) would be appropriate after all.

There's no reason to include a session ID, that option is for old legacy upnp devices.
The only other option you might want to use is the bitrate. This depends on proper support of that by the renderer and there are a lot of buggy implementations out there that scale this value improperly.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 10, 2014, 03:04:55 pm
Quote
I'm starting to lose track of the permutations of this testing and can only devote so much time to it.

Perfectly understandable! :)

I'll try to provide a quick summary, eliminating my various false starts and avoiding discussion of my other Ogg Vorbis issue:


Of course, no issue ever crops up if SetNext is disabled altogether.  So, it's definitely a required part of the recipe for the problem.

Using a wired ethernet connection didn't help the problem at all.  Windows does show a jump in network traffic when a playlist push is occurring, jumping from nominally 2 Mbps during normal playback to a spike of about 10 Mbps.  Once normal playback gets re-established, network traffic goes back down to about 2 Mbps.  (For stereo 16-bit PCM at 44.1kHz, I would expect network bandwidth of 1.41 Mbps plus TCP/IP framing overheads, so 2 Mbps seems about right.)

FWIW, the manual for the Yamaha RX-A1040 explicitly claims support for gapless playback from WAV, FLAC, and ALAC files.

Edit: fixed typos, added details from Yamaha manual, and add PCM 16 (with headers) to list of transcodings with woe.


Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 10, 2014, 03:19:13 pm
Adding to my last post...

   ... the initial static occurs when JRiver's DLNA controller is setup to convert to PCM L16 or PCM 16 or PCM 24 or MP3 (High bandwidth).

I should likely also add that no other audio hiccups occurs, once the static/stuttering ends.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 10, 2014, 03:41:17 pm
Quote
  • The initial static does not occur if JRiver is serving up native mp3 files (with no conversion/transcoding).  Those play gaplessly and I can push playlist changes till I'm blue in the face without any audible hiccup of any sort.

<sigh>...Yet another statement I'll have to retract.  The static can eventually occur even when handling MP3 files natively, with no transcoding.

At this point, lacking any other information, I am definitely inclined to call this a problem with the Yamaha DLNA renderer implementation.  SetNext works, but has an issue.  I've been whining at, er.... communicating with Yamaha as well, but I'm not optimistic.

So, to re-recap the problem:
 
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: bob on November 10, 2014, 03:56:45 pm
Are you pushing this "2 track playlist" Send To->Play (your device) using the "Play" or "Add (as next to Play)" options?
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 10, 2014, 03:58:43 pm
Bob writes:
Quote
Are you pushing this "2 track playlist" Send To->Play (your device) using the "Play" or "Add (as next to Play)" options?

I call it a "2 track playlist" since JRiver only has SetAVTransportURI and SetNextAVTRansportURI available.  Since (I don't think) JRiver pushes whole playlists out to renderers, it's a "2-entry playlist". :)

Anyway, via "Play".
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 10, 2014, 04:26:58 pm
Some further clarifications:


Yes, it's a strange thing to have noticed  It's the sort of activity one would engage in only if one had just gotten, say, a new DLNA-capable receiver for the first time and was playing around! :)
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 10, 2014, 09:26:13 pm
BTW, issuing a Seek 0 on the same track that just experienced the static/stuttering (past the 10sec window mentioned earlier), causes a boatload of static with the Yamaha.

<s:Body>
<u:Seek xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>0</InstanceID>
<Unit>REL_TIME</Unit>
<Target>0:00:00</Target>
</u:Seek>
</s:Body>
</s:Envelope>


The TCP activity around this time shows one connection getting RST from the Yamaha, and a fair number of subsequently retried packets. 
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: bob on November 10, 2014, 10:28:09 pm
BTW, issuing a Seek 0 on the same track that just experienced the static/stuttering (past the 10sec window mentioned earlier), causes a boatload of static with the Yamaha.

<s:Body>
<u:Seek xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>0</InstanceID>
<Unit>REL_TIME</Unit>
<Target>0:00:00</Target>
</u:Seek>
</s:Body>
</s:Envelope>


The TCP activity around this time shows one connection getting RST from the Yamaha, and a fair number of subsequently retried packets. 

Since this works perfectly with MC as the renderer (which means there is noting wrong with the data) it could possibly be a stale cache.
We are however telling it not to cache when we serve the content.
There is Andrews random prefix approach however that will interfere with another way we handle a  different situation so while it might be an interesting test, it's not a fix for us.
It really does come down to bugs in the renderer firmware..
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 10, 2014, 10:41:19 pm
Quote
Since this works perfectly with MC as the renderer (which means there is noting wrong with the data) it could possibly be a stale cache.
We are however telling it not to cache when we serve the content.
There is Andrews random prefix approach however that will interfere with another way we handle a  different situation so while it might be an interesting test, it's not a fix for us.
It really does come down to bugs in the renderer firmware..

I suspect that's likely as well.  Perhaps one day I may hear back from Yamaha.

In my previous post, I mentioned that the static/stuttering also occurs with a Seek back to the start of the in-progress track.  Looking at the new TCP stream that gets started following the seek, there's definitely a gap in the progression of data flowing back from JRiver; see the attached screenshot.  Would this sort of pause in data be something that a renderer should be able to handle?

Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 10, 2014, 10:49:22 pm
Quote
Would this sort of pause in data be something that a renderer should be able to handle?

I ask just because, in addition to DLNA SetNext support, the Yamaha's handling of its network interface might be something worthwhile to point Yamaha to.

I wanted to thank you, Bob, for your patience and help with this topic.  I know I had lots of false starts as I familiarized myself with DLNA/UPnP and tried taking stabs at root causes.  In an effort to find another DLNA server + control point to contrast with JRiver, I also have to say that nothing has come close!
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: bob on November 10, 2014, 11:01:46 pm
I suspect that's likely as well.  Perhaps one day I may hear back from Yamaha.

In my previous post, I mentioned that the static/stuttering also occurs with a Seek back to the start of the in-progress track.  Looking at the new TCP stream that gets started following the seek, there's definitely a gap in the progression of data flowing back from JRiver; see the attached screenshot.  Would this sort of pause in data be something that a renderer should be able to handle?

I'd think it was the receivers tcp window filling.
You might try the same test but pulling the url for the served file with curl to a local file (or /dev/null on a linux box) to see if you get the same curve.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: JimH on November 11, 2014, 06:15:02 am
You could let Yamaha know that we will provide them licenses and help if we can.  Thanks for your patience.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: mattlovell on November 11, 2014, 01:10:24 pm
Quote
You could let Yamaha know that we will provide them licenses and help if we can.  Thanks for your patience.

I will do that.

FWIW, I ran across the following review for the Yamaha RX-A1040 that mentions JRiver and a problem that sounds similar.  The workaround the review describes doesn't really work for me, but then I don't get the static with every track change:

http://www.hometheaterhifi.com/receivers/receivers-reviews/yamaha-rx-a1040-audio-video-receiver-review/page-3-in-use.html

Quote
... When switching from one song to another in JRiver, the Yamaha had trouble getting an immediate lock on the bitstream. Switching from one song to another on the fly caused a 1.5 second gap of soft static, and then the Yamaha would pick up the music. This was a disappointment, but there is a workaround; by ending the music stream (pressing the “stop” button on JRiver to end a song), waiting a second, and then starting another song, the Yamaha picked up the new song immediately. Also, I’ve experienced this same behavior with other brands of AV equipment including Denon, HK, Emotiva, and Onkyo, so it may be an artifact of the DAC.

Just to make sure it wasn’t my server or network causing the problem, I switched JRiver to use my Oppo BDP-105 as a source. The Oppo was connected to the Yamaha via HDMI. With this configuration, there was never a skip.
Title: Re: Initial static/pops when pushing track change to DLNA renderer
Post by: bob on November 11, 2014, 02:39:35 pm
....

Just to make sure it wasn’t my server or network causing the problem, I switched JRiver to use my Oppo BDP-105 as a source. The Oppo was connected to the Yamaha via HDMI. With this configuration, there was never a skip.
He's using the Oppo as the "renderer" not the "source/server" I assume.
The Oppo doesn't support SetNext IIRC so that's not a good test anyway.