Bug 8434 - MP4 -> FLAC conversion - big endian vs. little endian
: MP4 -> FLAC conversion - big endian vs. little endian
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Transcoding
: unspecified
: PC Other
: P3 normal (vote)
: 7.4.0
Assigned To: Alan Young
: MOV123
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-06-15 06:58 UTC by Sascha Picchiantano
Modified: 2009-10-05 14:35 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sascha Picchiantano 2008-06-15 06:58:12 UTC
with each and every version of SC that I install, I have to go into the convert config file and manually fix that mov to flac conversion (MP4) is NOT using big endian but little endian. I had to do this since version 6.x. I am now at version 7.1 and it still comes with this wrong config file.

Mac OS X on Intel processors must not use big endian. It must use little endian. With big endian, all you get is static noise. Big endian is for the old PowerPC architecture.

Actually I think you should release two different SC distributions, one for PPC based Macs, and one for Intel based Macs, to get this right. Or have the installer check what processor you have and install the appropriate convert.conf file.
Comment 1 Blackketter Dean 2008-06-15 08:52:51 UTC
It seems to me that mov123 on OSX should always return the same endianness of _data_ when decoding, independent of the cpu orientation.  
Comment 2 Sascha Picchiantano 2008-06-15 20:24:30 UTC
Well obviously it doesn't. Here is the part of the convert.conf for that:

mov flc * *
        [mov123] $FILE$ | [flac] -cs --totally-silent --compression-level-0 --endian big --sign signed --channels 2 --bps 16 --sample-rate 44100 -


As you can see, one of the parameters says --endian big

If I leave it at that, all I get is digital rubbish and extreme distortion from the speakers. If I change it to --endian little, it wors as it should (although recent versions have introduced extreme noise levels, but that's another story).

This has been discussed on the forums a couple of times.
Comment 3 Chris Owens 2008-06-19 09:34:40 UTC
Steven are you able to reproduce this?  

No offense intended, Sascha, but I would expect very many more users would be reporting this problem, so I think maybe there's more to it.
Comment 4 Sascha Picchiantano 2008-06-19 09:51:58 UTC
No offense taken!

Though as a matter of fact this was discussed in the forum at least twice (about a year ago or so) and the fix to change the endian in the config file was suggested there. And the fix works. There was at least one other person with the same problem, plus the guy recommending the fix, so that's three with that problem :)

Cheers
Sascha
Comment 5 Spies Steven 2008-07-29 14:41:54 UTC
I have not been able to reproduce this issue on a number of different Macintosh platforms and operating systems including both PowerPC and Intel architectures and 10.4 and 10.5.

In all cases leaving the convet.conf mov123 to flac parameter --endian big worked while changing it to --endian little resulted in nothing but noise.

I have no idea why the Quicktime, mov123 and flac combination on your system would result in needing to change the --endian parameter from big to little.

Sascha, I am curious if you need to make the change for Apple Lossless files as well.  Can you try playing an Apple Lossless file and report back?  Perhaps this would help isolate the issue.
Comment 6 Sascha Picchiantano 2008-07-30 16:13:23 UTC
Hi..

I tried with lossless but the problem remains.

I also tried upgrading to SC 7.1.0 but that didn't help either. In fact, it crippled my workaround for the problem (using faad instead of mov123) by introducing lot's of harsh pop-sounds (like scratches on vinyl records) into my sound.

Comment 7 Spies Steven 2008-07-31 09:59:10 UTC
So you get the same endian issue with both mov123 and alac when transcoding to flac?  I'm at a loss.

What happens when you disable flac and mp3 transcoding for both AAC and Apple Lossless and send wav and aiff to the player?  Do you still get an endian issue then?
Comment 8 Spies Steven 2008-08-06 15:46:33 UTC
Sascha, have you had a chance to try disabling flac?

I was also curious which version of flac SqueezeCenter is using and at what path.  One way to tell is to debug enable player.source under setting, advanced, logging.  Play an AAC file with AAC to FLAC enabled. Then open the SqueezeCenter log file and look near the bottom of the log.  You should see the lines "Using command for conversion:" with a command containing the full path to FLAC.  If you enter this full path in terminal it should also tell you the version.
Comment 9 Sascha Picchiantano 2008-08-06 22:53:51 UTC
sorry for not replying earlier. Been out of town. I will look into this over the weekend and let you know about the results.

thanks!

sascha
Comment 10 Spies Steven 2008-08-08 11:19:24 UTC
Thanks Sascha, I look forward to seeing your results.

Dean, would it be possible for mov123 to output wav instead of raw pcm?  Would that not get around the issue of having to specify endiness for flac in the first place?
Comment 11 Chris Owens 2008-08-11 10:44:40 UTC
Steven will continue looking at this for the 7.3 release.
Comment 12 Sascha Picchiantano 2008-08-12 03:26:24 UTC
Hi,

I don't know what to say but I just removed my custom-convert.conf that I was using to decode mov with faad instead of mov123. So I am now using the original convert.conf that has the big endian enabled. It suddenly works. I didn't change anything else.

I can only assume that the recent iTunes update to v7.7 also changed some of the quicktime components and that this removed the error.

Not sure though. Maybe we can keep this open or on hold to see what happens with future updates of iTunes/quicktime/SC?

Cheers
Sascha
Comment 13 Spies Steven 2008-08-12 08:48:58 UTC
That is fantastic news!  What I am going to do is resolve this as works for me.  If anyone experiences this issue again please reopen and add additional comments.
Comment 14 Sascha Picchiantano 2008-08-21 23:03:17 UTC
Hi,
unfortunately I was a little bit to fast with calling this to be resolved. The issue is still there. When I said it was gone I didn't pay attention to the kind of music files I played. They were mp3. Sorry for that. So the bug with mp4 is still there.
Comment 15 Spies Steven 2008-08-22 09:50:02 UTC
Dean, how difficult would it be to have mov123 output wav instead of raw pcm?  If mov123 output wav then we would not need to specify endiness on the command line and avoid this issue altogether.

From the mov123 comments:

Todo:
- extract channel, sample rate, and sample size information from the movie for use in reencoding later
- CLI options for:
- specifying output file
- output files for AIFF and WAV
- changing sample rate, sample size, channel count, codec usage
- be graceful about failures
Comment 16 Sascha Picchiantano 2008-08-23 08:43:53 UTC
if I may suggest something: why don't you switch to faad? I built a custom-convert.conf that uses faad instead of mov123 and that works perfectly.
Comment 17 Sascha Picchiantano 2008-10-05 09:09:47 UTC
are there any news on this? this is driving me crazy. I am using a custom-convert.conf to use faad instead of mov123, but unfortunately you guys changes something in the installer of SC, so that now everytime I install a new version (upgrade existing installation) of SC my custom-convert.conf is deleted!! as well as the faad binary, it gets deleted from the server's bin directory.
Comment 18 Blackketter Dean 2008-11-05 07:24:46 UTC
Alan, didn't this get addressed?
Comment 19 Alan Young 2008-11-05 08:29:25 UTC
No, not for mov123.

As suggested by Steven, getting it to put a WAV header on the file would be the best solution.
Comment 20 Chris Owens 2008-11-10 09:46:37 UTC
We still can't reproduce this bug.  We have plans to improve this conversion, but it seems to work for all other customers.
Comment 21 Alan Young 2009-03-10 01:52:09 UTC
This should now be fixed in the 7.4 branch by the changes for bug 10602 which passed the WAV header to flac. 

It will not actually be fixed for real Movie files (.mov) where mov123 will still be used but they will be very rare now.
Comment 22 James Richardson 2009-10-05 14:35:15 UTC
This bug has been marked as fixed in the 7.4.0 release version of SqueezeBox Server!
    * SqueezeCenter: 28672
    * Squeezebox 2 and 3: 130
    * Transporter: 80
    * Receiver: 65
    * Boom: 50
    * Controller: 7790
    * Radio: 7790  

Please see the Release Notes for all the details: http://wiki.slimdevices.com/index.php/Release_Notes

If you haven't already, please download and install the new version from http://www.logitechsqueezebox.com/support/download-squeezebox-server.html

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.