Bug 10817 - flac with cue files refuse to play on SC/QNAP
: flac with cue files refuse to play on SC/QNAP
Status: CLOSED WORKSFORME
Product: Logitech Media Server
Classification: Unclassified
Component: Transcoding
: 7.3.3
: Other Linux (other)
: -- normal with 1 vote (vote)
: Investigating
Assigned To: Spies Steven
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-24 12:25 UTC by Eugene Dugaev
Modified: 2012-02-27 17:33 UTC (History)
4 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Dugaev 2009-01-24 12:25:05 UTC
I keep albums in my music collection in folders with a flac file and a cue sheet.

I am setting up SC on Qnap and realised that there's a severe problem: it refuses to play flac files ONLY if playback is started with cue sheet. 

In web interface, when I try to play flac file itself, it does play with no problem. If I try to open cue sheet, it shows the list of tracks. However, when I try to play any of the track, they appear in the playlist, but do not play: my TRANSPORTER just shows each track's name one after another, but doesn't play.

The server log show the following errors:
0103: /volume1/SSODS/bin/sox stio: Unknown output file format for '-':  File type `flac' is not known
0102: /volume1/SSODS/bin/sox stio: Unknown output file format for '-':  File type `flac' is not known
0101:                 state = FLAC__STREAM_DECODER_SEEK_ERROR
0100: kinoproby.flac: ERROR seeking while skipping bytes
0099: 
0098: /volume1/SSODS/bin/sox stio: Unknown output file format for '-':  File type `flac' is not known
0097:                 state = FLAC__STREAM_DECODER_SEEK_ERROR
0096: kinoproby.flac: ERROR seeking while skipping bytes
0095: 
0094: /volume1/SSODS/bin/sox stio: Unknown output file format for '-':  File type `flac' is not known
0093:                 state = FLAC__STREAM_DECODER_SEEK_ERROR
0092: kinoproby.flac: ERROR seeking while skipping bytes
0091: 
0090: /volume1/SSODS/bin/sox stio: Unknown output file format for '-':  File type `flac' is not known
0089:                 state = FLAC__STREAM_DECODER_SEEK_ERROR
0088: kinoproby.flac: ERROR seeking while skipping bytes
0087: 
0086: /volume1/SSODS/bin/sox stio: Unknown output file format for '-':  File type `flac' is not known
0085:                 state = FLAC__STREAM_DECODER_SEEK_ERROR
0084: kinoproby.flac: ERROR seeking while skipping bytes
0083: 
0082: /volume1/SSODS/bin/sox stio: Unknown output file format for '-':  File type `flac' is not known
0081:                 state = FLAC__STREAM_DECODER_SEEK_ERROR
0080: kinoproby.flac: ERROR seeking while skipping bytes
0079: 
0078: /volume1/SSODS/bin/sox stio: Unknown output file format for '-':  File type `flac' is not known
0077: /volume1/SSODS/bin/sox stio: Unknown output file format for '-':  File type `flac' is not known
0076:                 state = FLAC__STREAM_DECODER_SEEK_ERROR
0075: kinoproby.flac: ERROR seeking while skipping bytes

My system is as follows:

System

Hard-/Firmware : QNAP TurboStation TS-109 / 2.1.2 build 1114T
Load / Uptime  : 0.06 0.03 0.03 / 1d 20.24:21 (89% idle)
Memory -- Swap : 248/250 MB (shr: 0, buf: 12, cache: 121, rss: 114) -- 1/518 MB

SqueezeCenter

Version        : 7.3.2-24695
Process status : PID 13960, state S (sleeping)
Memory usage   : 92 MB total, 85 MB (92%) RSS
Uptime         : 02:09:06, 20:25 (15.8%) CPU time
Extra args     : --httpport 9001
SSODS/SC flags : noupnp

MySQL

Version        : 5.0.27-log
Database size  : 29M
Process status : PID 14024, state S (sleeping)
Memory usage   : 44 MB total, 16 MB (38%) RSS
Uptime         : 02:08:49, 00:45 (0.5%) CPU time

Please let me know where did I go wrong?
Comment 1 Eugene Dugaev 2009-01-25 12:06:29 UTC
Last night playing with versions of SC and found that earlier version of Squeezecenter 7.3.1 - 24372 @ Fri Dec 19 17:30:38 PST 2008 (and earlier) WORKS fine with flac and cue-sheets.

Later versions that I tried were:
- 7.3.2, 
- 7.3.3 (squeezecenter-7.3.3-24744) 
- 7.3.4 (squeezecenter-7.4-24746) 

All of them had the problem -- flac+cue sheet duo didn't work.
Comment 2 James Richardson 2009-01-28 09:44:36 UTC
QA to verify
Comment 3 Spies Steven 2009-01-28 10:04:27 UTC
Eugene, the version of SoX that that you are running on your QNAP needs to be updated to include FLAC support.  This is required as a result of change 24410 for bug 9997.
Comment 4 Eugene Dugaev 2009-01-28 12:47:03 UTC
Thanks for the info, but can you please give more details (the link, how to, help file, fm to read through,  etc) on how to do update the SOX and to which version? Isn't it a part of SC?

Comment 5 James Richardson 2009-01-28 16:09:08 UTC
Steven: Can you provide instructions on our Wiki to do this please.  Then point Eugene to the wiki page.
Comment 6 Eugene Dugaev 2009-01-29 06:08:45 UTC
Here's some additional info on the issue from forum topic (user flipflip):

>Yes, the version of SoX in SSODS is compiled without FLAC support. This is because I was unable to 
>compile it with FLAC. And then I thought "who cares?" because the SC plays FLAC natively (doesn't it?)
> and one can still use the flac binary to decode flacs to wav and then pipe it to SoX, lame or whatever.
> Apparently this does not work for flac/cuesheets (why?).

>Unfortunately I don't see me compiling SoX with flac support any time soon (absolutely ZERO time for >anything more than a few comments/hints in the forum).
>
>You can replace the bad sox from SSODS with a good one if you can find it (Optware?) or 
>make it (compile it). If you find one, I'll happily add it to SSODS or put it on my page to download for
> others.

Source: http://forums.slimdevices.com/showthread.php?p=390509

Can anyone clarify the point raised in this regard: why SOX is needed for playing flac files, if both SC and Transporter have native flac support? 
Comment 7 Alan Young 2009-01-29 08:34:01 UTC
Because they need to be transcoded using a 'flac | sox' pipeline in order to extract the necessary set of sample from the source flac file. This has to be done in SC, not the player.

We used to use a 'flac | flac' pipeline but flac will not do resampling and sox will, so we use sox for all FLAC encoding so that we can downsample if needed.

You could create a custom-covert.conf to override the default transcode rule. A suitable entry would be:

flc flc transcode *
	# FT:{START=--skip=%t}U:{END=--until=%v}
	[flac] -dcs $START$ $END$ -- $FILE$ | [flac] -cs --totally-silent --compression-level-0 -
 
Comment 8 Eugene Dugaev 2009-01-29 09:20:35 UTC
Alan, thank you, I'll try it and post results here.

One more question -- why do you need to downsample flac? The only scenario I have in mind is when flac file is 192khz and it has to be transcoded do 96 khz so that Transporter would play it? Or are there other occasions when downsampling/transcoding has to be done?
Comment 9 Alan Young 2009-01-29 09:45:56 UTC
The Transporter will play 96000 samples/s  (and 88200) but other players can only manage a max sample rate of 48000.
Comment 10 Eugene Dugaev 2009-01-29 11:21:10 UTC
The following details are for QNAP TS-109 II PRO. I'm not a unix pro, so correct me where I go wrong. 

Here's step by step guide of how to enable flac with cue files on QNAP for SC versions over 7.2:

1. Create a text file named "custom-convert.conf" (using notepad on pc or textedit on mac). 
In previous post Alan made a typo (and I gh.. copy-pasted it and spent extra 20 minutes figuring it out), so make sure the file name is "custom-convert.conf" :-)

2. Add followng lines to it and save the file. Make sure the lines are not wrapped

flc flc transcode *
        # FT:{START=--skip=%t}U:{END=--until=%v}
        [flac] -dcs $START$ $END$ -- $FILE$ | [flac] -cs --totally-silent --compression-level-0 -

3. Put this file in "Public" share of your QNAP (via Web File Manager of you QNAP)

4. SSH or Telnet to your Qnap (on PC use putty, on mac use Terminal)

5. It may be that case that you already have custom-convert.conf. If so, back up your existing "custom-convert.conf" by typing the following:
cp /volume1/SqueezeCenter/custom-convert.conf /volume1/SqueezeCenter/custom-convert.backup

6. Now copy the text file you've created to Squeezecenter folder by typing the following:
 
cp /volume1/Public/custom-convert.conf /volume1/SqueezeCenter

7. Restart SqueezeCenter

Now it should work. 

Alan, thank you for help and last question is whether we still need to bother with sox update proposed earlier or this workaround should be sufficient?

Comment 11 Alan Young 2009-01-29 11:37:49 UTC
Sorry about the typo earlier.

That workaround will work for now, but please be aware that we will probably change most of the FLAC-producing transcoding rules to use sox instead of flac, so it would be good if someone could build a FLAC-enabled sox for that platform at some time.
Comment 12 Spies Steven 2009-02-24 13:42:23 UTC
*** Bug 11179 has been marked as a duplicate of this bug. ***
Comment 13 James Richardson 2012-02-27 17:33:05 UTC
Closing resolved bugs - if you feel this bug still exists please first re-test
with the latest SW/FW version.  If you are able to reproduce then feel free to
reopen and attach new logs / steps to reproduce.