Post Reply 
Flac->Wav transcoding not working on Cambridge StreamMagic 6
14-02-2014, 17:48 (This post was last modified: 14-02-2014 17:49 by Andre Gosselin.)
Post: #1
Flac->Wav transcoding not working on Cambridge StreamMagic 6
I have Cambridge Audio StreamMagic 6 renderer on which I want to experiment with the MinimStreamer Flac->Wav transcoding (setting "stream.transcode" property to "flac:wav"). I created the following directory structure with simple file names and a 16bit/44.1KHz flac file to ease the test:
a\b\c.flac
Using BubbleUPnP as control point, I can see when looking in the track metadata that the stream is set to
Quote:WAV, 16 its, stereo, 44100Hz, 146 MB
http:192.168.0.101:9790/minimserver/*/flac/a/b/c.flac/$!transcode.wav
All this seems correct. Trying to play the track on the StreamMagic 6 renderer however does not work. I get the following inside the log file (set to debug level):
Quote:10:07:35.931 Thread-348: HTTPService: accepted incoming connection
10:07:35.936 Thread-348: HTTPService: waiting for incoming connection
10:07:35.939 Thread-347: HTTPService: received request, Socket[addr=/192.168.0.11,port=4364,localport=9790]
10:07:35.940 Thread-347: HTTPService: adding connection org.jminim.lib.HTTPConnection@2dd55ae7
10:07:35.940 Thread-392: HTTPConnection: reading HTTP request
10:07:35.941 Thread-391: HTTPConnection: writer thread waiting for request
10:07:35.948 Thread-392: GET /minimserver/*/flac/a/b/c.flac/%24!transcode.wav HTTP/1.1
10:07:35.949 Thread-392: Host: 192.168.0.101:9790, Accept: */*, Range: bytes=0-127999
10:07:35.949 Thread-391: HTTPConnection: writer thread processing request
10:07:35.949 Thread-392: HTTPConnection: reading HTTP request
Fri Feb 14 10:07:35 sending HTTP response '404 Not Found: Requested resource not found' to request 'GET /minimserver/*/flac/a/b/c.flac/%24!transcode.wav'
10:07:35.950 Thread-391: HTTPConnection: completed request; socket=Socket[addr=/192.168.0.11,port=4364,localport=9790], keepAlive=false
10:07:35.951 Thread-391: HTTPConnection: closing Socket[addr=/192.168.0.11,port=4364,localport=9790]
10:07:35.951 Thread-391: HTTPService: removing connection org.jminim.lib.HTTPConnection@2dd55ae7
10:07:35.951 Thread-392: HTTPConnection: connection closed by client
According to the log, the renderer appears to have recoded the '$' sign to a '%24' inside it's GET request, to which MinimServer replies with a "404 Not Found" error.

The only way I found to get transcoding working on the StreamMagic is to wrap MinimServer inside a proxy using BubbleUPnP server. The GET request now shows a '$' sign and the track plays OK. Log file contains:
Quote:11:10:57.395 Thread-348: HTTPService: accepted incoming connection
11:10:57.395 Thread-348: HTTPService: waiting for incoming connection
11:10:57.399 Thread-347: HTTPService: received request, Socket[addr=/192.168.0.101,port=55025,localport=9790]
11:10:57.399 Thread-347: HTTPService: adding connection org.jminim.lib.HTTPConnection@5c588ded
11:10:57.400 Thread-496: HTTPConnection: reading HTTP request
11:10:57.407 Thread-495: HTTPConnection: writer thread waiting for request
11:10:57.407 Thread-496: GET /minimserver/*/flac/a/b/c.flac/$!transcode.wav HTTP/1.1
11:10:57.407 Thread-496: Host: 192.168.0.101:58050, Accept: */*, Range: bytes=0-127999, Via: 1.1 (jetty), X-Forwarded-For: 192.168.0.11, X-Forwarded-Proto: http, X-Forwarded-Host: 192.168.0.101, X-Forwarded-Server: 192.168.0.101
11:10:57.408 Thread-496: HTTPConnection: reading HTTP request
I tried the same experiments using a different control point (UPnPlay), with the same results.

I am wondering if this problem is due to a bug in the StreamMagic renderer or not. Is this rewrite of the '$' as '%24' in the GET request (the source of the problem as far as I can tell) a disallowed 'behavior' by the UPnP specification, or a possibility which MinimServer is not prepared to handle ? Accessing MinimServer through a BubbleUPnP server proxy solves the issue, but this can be seen as a workaround which adds an undesirable layer of complexity to a system. Is there somwthing else I could try ? Could MinimServer be modified to handle the StreamMagic 6 behavior, or should the issue be reported to Cambridge Audio ?

Your help would be greatly appreciated.
Find all posts by this user
Quote this message in a reply
14-02-2014, 22:44 (This post was last modified: 14-02-2014 22:44 by simoncn.)
Post: #2
RE: Flac->Wav transcoding not working on Cambridge StreamMagic 6
(14-02-2014 17:48)Andre Gosselin Wrote:  I am wondering if this problem is due to a bug in the StreamMagic renderer or not. Is this rewrite of the '$' as '%24' in the GET request (the source of the problem as far as I can tell) a disallowed 'behavior' by the UPnP specification, or a possibility which MinimServer is not prepared to handle ? Accessing MinimServer through a BubbleUPnP server proxy solves the issue, but this can be seen as a workaround which adds an undesirable layer of complexity to a system. Is there somwthing else I could try ? Could MinimServer be modified to handle the StreamMagic 6 behavior, or should the issue be reported to Cambridge Audio ?

Your help would be greatly appreciated.

I have read the relevant specifications, and it is debatable whether or not the renderer is permitted to do percent encoding of the reserved URL character '$' when it sends a GET request. However, it appears to be legal for the renderer to do percent encoding of some other URL path characters in a GET request. To handle this, the simplest approach seems to be for MinimServer to accept percent encoding in GET requests for all path characters except '/' (which definitely can't be percent encoded). This change should enable MinimServer to interoperate with the StreamMagic.

I will release an update in the next few days with this change, assuming that it doesn't cause any other problems.
Find all posts by this user
Quote this message in a reply
14-02-2014, 22:59
Post: #3
RE: Flac->Wav transcoding not working on Cambridge StreamMagic 6
(14-02-2014 22:44)simoncn Wrote:  
(14-02-2014 17:48)Andre Gosselin Wrote:  I am wondering if this problem is due to a bug in the StreamMagic renderer or not. Is this rewrite of the '$' as '%24' in the GET request (the source of the problem as far as I can tell) a disallowed 'behavior' by the UPnP specification, or a possibility which MinimServer is not prepared to handle ? Accessing MinimServer through a BubbleUPnP server proxy solves the issue, but this can be seen as a workaround which adds an undesirable layer of complexity to a system. Is there somwthing else I could try ? Could MinimServer be modified to handle the StreamMagic 6 behavior, or should the issue be reported to Cambridge Audio ?

Your help would be greatly appreciated.

I have read the relevant specifications, and it is debatable whether or not the renderer is permitted to do percent encoding of the reserved URL character '$' when it sends a GET request. However, it appears to be legal for the renderer to do percent encoding of some other URL path characters in a GET request. To handle this, the simplest approach seems to be for MinimServer to accept percent encoding in GET requests for all path characters except '/' (which definitely can't be percent encoded). This change should enable MinimServer to interoperate with the StreamMagic.

I will release an update in the next few days with this change, assuming that it doesn't cause any other problems.
Great support ! Thanks a lot, I will wait for this update when it is ready.
Find all posts by this user
Quote this message in a reply
19-02-2014, 18:36
Post: #4
RE: Flac->Wav transcoding not working on Cambridge StreamMagic 6
(14-02-2014 22:59)Andre Gosselin Wrote:  Great support ! Thanks a lot, I will wait for this update when it is ready.

This change is now available in MinimServer update 20.
Find all posts by this user
Quote this message in a reply
19-02-2014, 19:10
Post: #5
RE: Flac->Wav transcoding not working on Cambridge StreamMagic 6
(19-02-2014 18:36)simoncn Wrote:  
(14-02-2014 22:59)Andre Gosselin Wrote:  Great support ! Thanks a lot, I will wait for this update when it is ready.

This change is now available in MinimServer update 20.

Works OK. Thanks Simon!
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)