Bug 8562 - mov123 should not resample non-44.1k sample rates
: mov123 should not resample non-44.1k sample rates
Status: RESOLVED WONTFIX
Product: Logitech Media Server
Classification: Unclassified
Component: Transcoding
: 7.4.0
: PC Windows XP
: P5 normal (vote)
: 7.4.0
Assigned To: Blackketter Dean
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-06-25 13:48 UTC by Anoop Mehta
Modified: 2009-09-08 09:19 UTC (History)
6 users (show)

See Also:
Category: ---


Attachments
48 khz file (9.44 MB, audio/m4a)
2008-06-25 13:48 UTC, Anoop Mehta
Details
test version of mov123 (19.39 KB, application/octet-stream)
2008-07-18 04:12 UTC, Blackketter Dean
Details
error log from building on Windows (14.78 KB, text/html)
2008-07-23 01:34 UTC, Michael Herger
Details
Project conversion errors (46.87 KB, application/pdf)
2008-07-23 01:35 UTC, Michael Herger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anoop Mehta 2008-06-25 13:48:10 UTC
Created attachment 3493 [details]
48 khz file

When a 48khz file is scanned in, SC7 shows that this file is a 44.1khz file and the SB3 or Duet plays the file as a 44.1khz file. 

File attached.
Comment 1 Spies Steven 2008-06-25 15:13:48 UTC
Seems to be a couple SqueezeCenter issues with this file.

The first is that SqueezeCenter is identifying the file as 44.1 kHz when it is actually 48 kHz.

The second is that since it is an AAC file it will be transcoded to FLAC, AIFF or MP3 on the fly depending on the hardware and the file type settings.  This transcoding is handled by mov123 which appears to me to force everything to 44.1 kHz.

If it turns out that mov123 really does force everything to 44.1 kHz this behavior should be documented in separate bug/feature request.
Comment 2 Spies Steven 2008-06-30 10:48:25 UTC
Dean, this bug has the iTunes Plus AAC 48 kHz attached to it.  I don't see anything on iTunes that features this track as 48 kHz.  Perhaps it was just a bonus?
Comment 3 EnochLight 2008-07-05 19:28:36 UTC
"If it turns out that mov123 really does force everything to 44.1 kHz this
behavior should be documented in separate bug/feature request."

I digress - this is a bug that requires attention.  As the Duet/SB Classic is advertised to support this sample rate as well as AAC files, a user should expect a 48Khz AAC file to play back fine.  If it is filed separately, please let me know where the post will be so I can be notified once it is fixed.

Cheers!
Comment 4 Chris Owens 2008-07-14 09:12:41 UTC
Dean are you the best person to look at this?
Comment 5 EnochLight 2008-07-14 16:59:54 UTC
Is *anyone* looking at this?
Comment 6 Blackketter Dean 2008-07-17 06:42:54 UTC
I believe that the change is simply this:

Index: tools/mov123/mov123.cpp
===================================================================
--- tools/mov123/mov123.cpp	(revision 21765)
+++ tools/mov123/mov123.cpp	(working copy)
@@ -364,7 +364,7 @@
         theOutputFormat.format = k16BitBigEndianFormat;
         theOutputFormat.numChannels = 2; // theInputFormat.numChannels;
         theOutputFormat.sampleSize = 16;
-        theOutputFormat.sampleRate = 44100 << 16; //theInputFormat.sampleRate;
+        theOutputFormat.sampleRate = theSrcInputFormatInfo. sampleRate;
         theOutputFormat.sampleCount = 0;
         theOutputFormat.buffer = NULL;
         theOutputFormat.reserved = 0;

But I am unable to test here.  Note that this change should be tested across all players, etc...

Alan: Would this bug be yours?
Comment 7 EnochLight 2008-07-17 18:25:02 UTC
Dean, I'd be happy to lend a hand and test if I knew how.  How do I integrate that code into my version of SqueezeCenter to test it on my setup?  Or... is this something that has to be coded into the actual program on your end?  BTW, thanks for addressing this bug - it's not everyday that a company's CTO gets involved like this.  A true testament to Slim and one of the reason's I'm an avid supporter.
Comment 8 Blackketter Dean 2008-07-18 04:12:09 UTC
Created attachment 3620 [details]
test version of mov123

Try replacing the file Bin/darwin/mov123 with this file and post your experience.
Comment 9 EnochLight 2008-07-18 22:33:15 UTC
Sorry, do you mean the move123.exe file located here:

C:\Program Files\SqueezeCenter\server\Bin\MSWin32-x86-multi-thread

I don't seem to have a directory called "Bin/darwin/"...  I also noticed the mov123 file you posted was not an executable.  Please advise and I will be happy to test!

Cheers!
Comment 10 Blackketter Dean 2008-07-19 04:51:55 UTC
Ah, sorry, I thought you were on a Mac, my mistake.  That's a Mac version.

Michael:  Can you build a test version of mov123 with that one-line change?
Comment 11 EnochLight 2008-07-19 05:06:37 UTC
Oh ok. ;^). Also it should be noted that I am on Vista SP1, not XP as this bug listing states. 
Comment 12 Michael Herger 2008-07-22 05:17:58 UTC
Matt - can't reach winbuild. Could you please take a look? Thanks!
Comment 13 Matt Wise 2008-07-22 08:31:45 UTC
Michael,
  'Winbuild' is the old VM image we were using. Now we're using 'win32-build' (to go with a slightly more accurate naming scheme) that is a dedicated host. I'm not sure what you want me to try though... 
Comment 14 Michael Herger 2008-07-23 01:34:46 UTC
Created attachment 3654 [details]
error log from building on Windows

Dean - cannot compile on Windows. Not sure whether these are all issues due to new version of VisualC, Quicktime SDK etc. The project file caused VC to run some updates with errors/warnings, SoundComponents.h is no longer part of the QT SDK etc. 

Can you take a look at this please?
Comment 15 Michael Herger 2008-07-23 01:35:27 UTC
Created attachment 3655 [details]
Project conversion errors
Comment 16 Michael Herger 2008-07-23 09:48:53 UTC
Matt - do you still have the old winbuild VM around? I'm having trouble compiling on the new machine, most likely to incompatible QT header files and VC compiler. The old VM might still have what we were using before.
Comment 17 Michael Herger 2008-07-24 04:53:19 UTC
Thanks Matt. But still no luck :-(. No QT SDK on that machine neither.

Volunteers? 
Comment 18 Chris Owens 2008-07-28 09:57:12 UTC
Dean, Michael is stuck on this problem.  Could you chat with him about it?
Comment 19 Chris Owens 2008-07-28 11:18:53 UTC
Steven could you please test the 'test version of mov123' which Dean tells me is a mav binary?
Comment 20 Spies Steven 2008-07-29 11:54:25 UTC
(In reply to comment #19)
> Steven could you please test the 'test version of mov123' which Dean tells me
> is a mav binary?

The attached mov123 mac binary appears to broken or incomplete.  I also noticed the size is only 20 KB while the shipping one is 68 KB.

Could someone try building it again?
Comment 21 Michael Herger 2008-07-30 07:53:13 UTC
That's the one I have to punt post 7.2 as I won't be able to fix this.
Comment 22 Chris Owens 2008-08-04 09:20:19 UTC
Dean, everyone seems to be blocked on this.  Is there anything you can do to spur movement on this?  Thanks!
Comment 23 Blackketter Dean 2008-08-05 07:43:50 UTC
Matt: Can you try to get mov123 built automatically on Mac and Windows as part of the build system?  
Comment 24 Matt Wise 2008-08-05 08:21:04 UTC
It was my understanding that we couldnt even get mov123 to compile ... let alone automatically. I can easily script something up once we have some instructions on how to compile mov123 via command line.
Comment 25 Blackketter Dean 2008-08-05 10:18:51 UTC
It does compile, at least on my computer, but Michael wasn't able to do it on his.  Let's get it into the build system with the current default and see if the makefile (or whatever) needs to be tweaked.
Comment 26 Matt Wise 2008-11-10 10:17:47 UTC
Automatic build setup for Mac platform... output of successful build result is here:

https://builds:8080/parabuild/build/log.htm?cid=883&logid=56895&buildrunid=21504

Michael,  once you make the appropriate changes and the build finishes, let me know and I'll upload the file somewhere useful! 

Comment 27 Alan Young 2008-11-10 10:24:18 UTC
We should not change this unless we also add WAV header output, otherwise the transcoding framework (or player when transcoding to wav==pcm) will not know what it is getting.
Comment 28 Matt Wise 2008-11-10 11:58:57 UTC
Ok, so mov123 is building on Mac ... but not on windows. I've converted it to a newer Visual Studio project to get it started, but theres a dependency on SoundComponents.h. Unfortunately according to Apple, this has been deprecated and is no longer available (see http://developer.apple.com/DOCUMENTATION/QuickTime/INMAC/SOUND/tp_snd33_snd33add.e.htm). It looks like Mov123 will need some re-working to get it to compile against the new SDKs from Apple. 
Comment 29 Blackketter Dean 2008-11-17 09:54:11 UTC
Steven to test on mac
Comment 30 Blackketter Dean 2008-11-23 11:30:12 UTC
ping, steven: is it working better?
Comment 31 Blackketter Dean 2008-11-23 12:14:17 UTC
Just checked in a couple of tweaks to make it build with VC++ Express 2008, QuickTime SDK 7.3 on windows XP.  You should be able to work with that Matt.
Comment 32 Matt Wise 2008-11-24 09:37:20 UTC
Put in a few more fixes to point Mov123 to standard QuickTime SDK locations -- but still havn't fixed the issue. Here's the latest build failure:

https://builds:8080/parabuild/build/log.htm?cid=b486&logid=60751&buildrunid=23006


"Starting build process now..."

Microsoft (R) Visual Studio Version 9.0.21022.8.
Copyright (C) Microsoft Corp. All rights reserved.
------ Build started: Project: mov123, Configuration: Release Win32 ------
Linking...
Searching libraries
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\kernel32.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\user32.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\gdi32.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\winspool.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\comdlg32.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\advapi32.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\shell32.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\ole32.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\oleaut32.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\uuid.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\odbc32.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\odbccp32.lib:
    Searching ..\..\..\..\..\..\..\..\..\..\..\..\Program Files\QuickTime SDK\Libraries\QTMLClient.lib:
    Searching C:\Program Files\Microsoft Visual Studio 9.0\VC\LIB\OLDNAMES.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\kernel32.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\user32.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\gdi32.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\winspool.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\comdlg32.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\advapi32.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\shell32.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\ole32.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\oleaut32.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\uuid.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\odbc32.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\odbccp32.lib:
    Searching ..\..\..\..\..\..\..\..\..\..\..\..\Program Files\QuickTime SDK\Libraries\QTMLClient.lib:
    Searching C:\Program Files\Microsoft Visual Studio 9.0\VC\LIB\OLDNAMES.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\kernel32.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\user32.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\gdi32.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\winspool.lib:
    Searching C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\comdlg32.lib:
Finished searching libraries
mov1231.obj : error LNK2019: unresolved external symbol _fprintf referenced in function "unsigned char __cdecl SoundConverterFillBufferDataProc(struct SoundComponentData * *,void *)" (?SoundConverterFillBufferDataProc@@YAEPAPAUSoundComponentData@@PAX@Z)
mov1231.obj : error LNK2019: unresolved external symbol ___iob_func referenced in function "unsigned char __cdecl SoundConverterFillBufferDataProc(struct SoundComponentData * *,void *)" (?SoundConverterFillBufferDataProc@@YAEPAPAUSoundComponentData@@PAX@Z)
mov1231.obj : error LNK2019: unresolved external symbol _fwrite referenced in function "short __cdecl ConvertMovieSndTrack(char const *)" (?ConvertMovieSndTrack@@YAFPBD@Z)
mov1231.obj : error LNK2019: unresolved external symbol _printf referenced in function "short __cdecl ConvertMovieSndTrack(char const *)" (?ConvertMovieSndTrack@@YAFPBD@Z)
mov1231.obj : error LNK2019: unresolved external symbol _strncmp referenced in function "short __cdecl ConvertMovieSndTrack(char const *)" (?ConvertMovieSndTrack@@YAFPBD@Z)
mov1231.obj : error LNK2019: unresolved external symbol ___security_cookie referenced in function "short __cdecl ConvertMovieSndTrack(char const *)" (?ConvertMovieSndTrack@@YAFPBD@Z)
mov1231.obj : error LNK2019: unresolved external symbol @__security_check_cookie@4 referenced in function "short __cdecl ConvertMovieSndTrack(char const *)" (?ConvertMovieSndTrack@@YAFPBD@Z)
mov1231.obj : error LNK2019: unresolved external symbol _memset referenced in function "short __cdecl ConvertMovieSndTrack(char const *)" (?ConvertMovieSndTrack@@YAFPBD@Z)
mov1231.obj : error LNK2019: unresolved external symbol __setmode referenced in function _main
mov1231.obj : error LNK2019: unresolved external symbol __fileno referenced in function _main
LINK : error LNK2001: unresolved external symbol _mainCRTStartup
QTMLClient.lib(QTLoadLibraryUtils.obj) : error LNK2019: unresolved external symbol __access referenced in function _GetPathToQuickTimeFolder
QTMLClient.lib(QTLoadLibraryUtils.obj) : error LNK2019: unresolved external symbol _strncpy referenced in function _GetPathToQuickTimeFolder
Release/mov123.exe : fatal error LNK1120: 13 unresolved externals
Build log was saved at "file://c:\parabuild\etc\build\b10956co\a\u\t\o\7.3\trunk\tools\mov123\Release\BuildLog.htm"
mov123 - 14 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Comment 33 Chris Owens 2008-11-24 10:03:45 UTC
Dean to help with the build.
Comment 34 Alan Young 2008-11-25 09:01:38 UTC
Considering the title of this bug, do not forget what I said in comment #27.
Comment 35 Blackketter Dean 2008-11-25 20:50:52 UTC
Matt: I need login instructions for that build machine to figure out what's going on.

Alan: about your comment re: comment 27: if we change mov123 to not resample, then we should know the output sample rate from the input sample rate, right?
Comment 36 Alan Young 2008-11-25 21:31:32 UTC
The architecture does not have that capability. It is assumed that all transcoded streams are either self-describing (mp3, flac, ofg) or PCM fixed 44100/16/2/LE. The way to fix this is, first to fix bug 10000, and then get mov123 (and others) to output WAV, not PCM format. But this is 8.0, not 7.3 timescale.
Comment 37 Blackketter Dean 2008-11-25 21:34:37 UTC
got it.
Comment 38 Matt Wise 2008-11-26 07:09:03 UTC
Sorry Dean, instructions sent! 
Comment 39 Alan Young 2009-06-09 02:37:38 UTC
I think that this is really obsolete with the move to FAAD for AAC files. At least it now very much an edge case.