INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: JRiver used as a renderer + HTTP chunked-encoding + flac ?  (Read 5476 times)

philippe44

  • Recent member
  • *
  • Posts: 7
JRiver used as a renderer + HTTP chunked-encoding + flac ?
« on: June 28, 2015, 03:38:38 pm »

Hi - I wrote a while a go a UPnP control point + server that works with various renderers. I've facing a problem with MC as a renderer where MC fails when I'm sending the audio content in flac format and using HTTP chunked mode. MC complains about a problem and closes the connection after 4 chunks (1MB per chunk). When sending PCM or MP3, chunked mode works fine. I don't have an error when I send flac content in non chunk mode (sending a 'content size'), but that is not an acceptable working mode as I often send streaming audio, so I don't know the size in advance. I've tried to set different flac headers, including no headers, but that does not change anything
Logged

AndrewFG

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3392
Re: JRiver used as a renderer + HTTP chunked-encoding + flac ?
« Reply #1 on: June 28, 2015, 06:39:15 pm »

1MB is a mighty large chunk size. Typically the HTTP specs refer to about 32k or 64k. So try chunking at that size instead. If you are going to send megabyte chunks, you may as well send the whole file in one go.

PS in my experience, if you don't have a known value for sending a ContentLength you can often just exclude that header entirely. (Indeed MC does that all the time, in fact even when it does have enough information for it to offer a ContentLength -- either precisely or approximately).

Logged
Author of Whitebear Digital Media Renderer Analyser - http://www.whitebear.ch/dmra.htm
Author of Whitebear - http://www.whitebear.ch/mediaserver.htm

philippe44

  • Recent member
  • *
  • Posts: 7
Re: JRiver used as a renderer + HTTP chunked-encoding + flac ?
« Reply #2 on: June 28, 2015, 07:02:28 pm »

Thanks Andrew - I've tried with a lower chunk size and got the same result, unfortunately. What is strange is that it *only* shows that problem with FLAC. It works with raw PCM and MP3. I also have the option to not send the content-length but it gives exactly the same result (again, problem only with flac). The only case where it works with flac is when I send a real content-length but then I fall into another issue as MC, contrary to other renderers, when told that content-type is N bytes, it wants N bytes and even if I close the socket, it re-opens it and asks for the same URI again and again. Other players consider a socket close as a end of file and move to the next URI (if any).

As the problem only happens with FLAC, I'm wondering if there is something special in JRiver when handling FLAC for unknown file size. I also have the option in my application to not send a flac header (flac normally allows that as a streamable format, each chunk contains enough information), but that does not change anything

The difficulty of my application is that it is a bridge between 2 "domains" so I don't have access to the full size of the data to send nor do I have the full content available at start - I have to treat everything as a stream, although I often have a large amount of data already cached, so I can send lots of MB to the renderer as fast as it can eat them - normally, this works fine with TCP flow control
Logged

AndrewFG

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3392
Re: JRiver used as a renderer + HTTP chunked-encoding + flac ?
« Reply #3 on: June 29, 2015, 02:04:11 am »

Ok. You will need to wait for bob to answer this one...
Logged
Author of Whitebear Digital Media Renderer Analyser - http://www.whitebear.ch/dmra.htm
Author of Whitebear - http://www.whitebear.ch/mediaserver.htm

philippe44

  • Recent member
  • *
  • Posts: 7
Re: JRiver used as a renderer + HTTP chunked-encoding + flac ?
« Reply #4 on: July 03, 2015, 12:15:21 am »

hup ?
Logged

philippe44

  • Recent member
  • *
  • Posts: 7
Re: JRiver used as a renderer + HTTP chunked-encoding + flac ?
« Reply #5 on: August 22, 2015, 07:32:41 pm »

Ok. You will need to wait for bob to answer this one...

Hi- I just bought a multiplatform license. Any chance to have an update on that question ? Bob ?
Logged

philippe44

  • Recent member
  • *
  • Posts: 7
Re: JRiver used as a renderer + HTTP chunked-encoding + flac ?
« Reply #6 on: October 18, 2015, 11:51:50 pm »

Still no answer from the developers ? A bit disapointing - could be a quick explanation why it does not work.
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13941
Re: JRiver used as a renderer + HTTP chunked-encoding + flac ?
« Reply #7 on: October 19, 2015, 10:33:07 am »

Have you looked at a trace (for example using wireshark)?
I'm pretty certain we don't support chunked encoding and it's a bit rusty in my memory but I don't think flac supports seeking a stream unless it's in an ogg container, are you trying to seek on the stream you are sending?
Logged

philippe44

  • Recent member
  • *
  • Posts: 7
Re: JRiver used as a renderer + HTTP chunked-encoding + flac ?
« Reply #8 on: October 22, 2015, 01:11:03 am »

Have you looked at a trace (for example using wireshark)?
I'm pretty certain we don't support chunked encoding and it's a bit rusty in my memory but I don't think flac supports seeking a stream unless it's in an ogg container, are you trying to seek on the stream you are sending?

Thank you for your answer - I'm not trying to seek, simply sending the file but with chunked-encoding and that fails only with flac. Flac is fully streamable (organized in packets with headers pattern to detect sync). Byte seeking can be supported in flac but you have to re-synchronize your decoder by finding header pattern or use DLNA TimeSeek. To many extend, for these kind of problems, flac is no different than MP3
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13941
Re: JRiver used as a renderer + HTTP chunked-encoding + flac ?
« Reply #9 on: October 22, 2015, 10:03:29 am »

Thank you for your answer - I'm not trying to seek, simply sending the file but with chunked-encoding and that fails only with flac. Flac is fully streamable (organized in packets with headers pattern to detect sync). Byte seeking can be supported in flac but you have to re-synchronize your decoder by finding header pattern or use DLNA TimeSeek. To many extend, for these kind of problems, flac is no different than MP3
If you send me a wireshark trace with a working mp3 and a failing flac I'll take a look.
It would be nice if they were the same track just encoded differently. The start of the content directory through the failure is the range I'd like with a capture filter so that only the Renderer and controller/server are in the trace. You can send it to bob (at) jriver (dot) com in a zipfile. Our server can take large files.
Logged

philippe44

  • Recent member
  • *
  • Posts: 7
Re: JRiver used as a renderer + HTTP chunked-encoding + flac ?
« Reply #10 on: October 24, 2015, 01:15:50 am »

Thanks - I've sent the traces
Logged
Pages: [1]   Go Up