View Issue Details

IDProjectCategoryView StatusLast Update
0001448MMW v4Playerpublic2007-11-12 22:23
Reporterrusty Assigned To 
PriorityimmediateSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Fixed in Version3.0 
Summary0001448: AAC (m4p, m4a) Playback Support (free)
DescriptionThis bug is being used to track the quicktime-based AAC playback functionality that will be included with the free version of MediaMonkey.

Ideally, this functionality will also cover ALAC.

Discussions in the bug re. payments to via licensing are no longer relevant and will be covered in another feature-bug that discusses an AAC codec/plugin rather than Quicktime.
TagsNo tags attached.
Fixed in build1102

Relationships

related to 0001449 resolveduser9 MMW v4 AAC (m4p, m4a, mp4) Tagging support (failed scans / crash on scan) 
related to 0003467 closedjiri MMW v4 m4a files with 59+ character or unicode filenames/folders cannot be played in MM 
related to 0004487 closedjiri MMW v4 Regression: AAC tracks (*.m4a etc.) cannot be played after updating to the newest QT (starting from build 1135) 

Activities

rusty

2005-03-11 07:26

administrator   ~0005412

I spoke to the people at Via Licensing and they indicated that:
-there is no way that they'll budge on the pricing ($.50 for playback, $1.50 for full codec) and no way that they'll allow playback-only functionality to be given away for free given the volume of our free product.
-we can achieve playback functionality by leveraging the Quicktime engine which supports AAC playback, and there's no fee for doing so.
-if we want to bundle non-Quicktime AAC playback/encoding we can do so for a 30 day trial period.

This implies to me that we have 3 options:
1) Include AAC playback/encoding in the Gold version. I don't particularly want to do this since it raised our COGs siginificantly
2) Use quicktime for playback only and don't bother with encoding for now
3) Have a plugins site that is better integrated with MM so that users can install/use plugins with ease (and without cost).

rusty

2005-03-13 03:17

administrator   ~0005417

I've confirmed that Quicktime can be licensed. SDK and Licensing info are at:
http://developer.apple.com/quicktime/

However, relying on Quicktime would imply an 11MB download requirement from what I see, which doesn't seem to make much sense.

Please give me your thoughts, especially from a technical perspective.

jiri

2006-03-13 07:59

administrator   ~0007057

Last edited: 2006-06-01 07:37

Some links that would probably be useful if we decide to go the QuickTime way:

http://developer.apple.com/samplecode/SoundPlayer/SoundPlayer.html
http://developer.apple.com/documentation/QuickTime/APIREF/soundconverterfillbuffer.htm

A sample on how to use the method above:
http://developer.apple.com/documentation/QuickTime/REF/QT41_HTML/QT41WhatsNew-89.html

rusty

2006-03-13 14:56

administrator   ~0007058

I just looked it up on their site and there are some updates. Fees are:
$.25 per decoder. Initiation payment of $1000 (because we're < 15 employees), Cap of $25,000 annually.
$.27-.50 per encoder-channel i.e. $.52-$1.00 per product (depending on volume, up to a maximum of $250,000)

Source material:
http://www.vialicensing.com/products/mpeg4aac/license.terms.html
http://www.vialicensing.com/products/mpeg4audio/MPEG-4_Audio_FAQ.html

As to why many applications don't pay for this:
-For open source applications there's no one to really go after (i.e. VLC also includes MP3 decoding but doesn't pay) -For commercial but free applications (I'm not sure which ones exist) it's possible that the companies offering it are doing so 'under the radar'
-From what I see on their licensees page, it seems that most of their licensees are hardware companies: http://www.vialicensing.com/products/mpeg4audio/MPEG4_licensees.html

Adding to the complexity of any decision, is also the aspect that it would be best if whatever approach we took allowed for playing iTunes DRM protected files.

This leaves us with the following options:
a) Quicktime or VLC plugin for playback (Pro: plays DRM protected content, free, less development?, usable for video as well?; Con: Huge download--however this won't be an issue for iPod users who've already installed iTunes, Apple may prevent DRM from functioning)
B) Bundled Playback Plugin (free) & Encoding Plugin (Gold) (Pro: works out of the box; Con: expensive, no DRM support)
C) Sell iPod AAC Plugin Addon (Pro: Small download, revenue generation; Con: no DRM support)

Per discussion, for financial reasons, we should move forward on Option A using quicktime. We may decide to offer an encoding option, however, this will be tracked in another bug.

jiri

2006-08-25 09:21

administrator   ~0007773

Last edited: 2006-08-25 10:11

A technical specification of how f_aac.dll plug-in should work:

Currently format (f_???) plug-ins can either work with tags (read and write), for example f_ogg.dll or encode into some format, for example f_flac_codec.dll or both (none yet).

This should be the first plug-in supporting decoding of format, i.e. reading encoded aac (mp4) samples and providing decoded raw audio stream to MediaMonkey.

f_acc plug-in should be created under Plugins folder in SVN, its building batch should be added to MP3Datab\Builds folder as LibBuild_f_aac.bat (and added there to LibBuildAll.bat). See other building batches there for an example of how to do it.

The plug-in will be implemented in C, preferably in MSVC 6.0(?).

The plug-in should implement and export several methods (to be called by MediaMonkey.exe):

void __cdecl FORMAT_Initialize( unsigned int MMInterfCookie, PMMHelperMethods helpers, PMMDecodeMethods decoders)

  This function is already implemented e.g. in f_flac_codec.dll, it gives the plug-in some basic structures to be used.

TDecoder __cdecl FORMAT_DecodeInit( TStreamAccess sourceTrack, int *samplerate, int *channels, int *bitsPerSample, int *seekable)

  This initializes and prepares a decoder. TStreamAccess is used to read data from the file (or in case it’s impossible, filename can be retrieved using this structure). Returned is information about source track samplerate, number of channels, bits per sample and whether it’s possible to seek within the track.

int __cdecl FORMAT_DecodeChunk( TDecoder decoder, void **buffer, int *bytes)

  This method actually decodes samples, on success it returns 0 and fills buffer variable with a pointer to the decoded buffer and bytes variable with number of bytes in buffer. If end of track is reached -1 is returned.

int __cdecl FORMAT_DecodeSeek( TDecoder decoder, int positionMS)

  This method seeks to a given position in stream, i.e. the next read from the track will return data from selected position.

void __cdecl FORMAT_DecodeClose( TDecoder decoder)

  This methods finishes with the given decoder, frees all allocated structures, etc.

Delphi headers for of these functions should be added to FormatsHeader.pas unit.

Internal format handling of decoder plug-ins should be added into FormatsHandler.pas unit (as a new TDecPlugin class). In this unit format plug-ins are loaded, decoder type plug-ins should be recognized (they export necessary methods from their dll described above) and prepared for later decoding.

Actual decoding should be implemented by a new class TFormatPluginDecode that inherits from TBasicDecode (GeneralDecoder.pas). This class can be placed in FormatsHandler.pas. A sample implementation of such a class can be found in WinampDecode.pas as TWinAmpDecode (implements decoding using WinAmp input plug-ins). This class should be pretty simple, only calling appropriate methods from format plug-ins. Creation of TFormatPluginDecode class should be implemented in function GetDecodeClass() in GeneralDecoder.pas.

After all this is implemented, MM will support conversions from AAC tracks, i.e. using Convert function it will be possible to convert AAC->WAV, AAC->MP3, etc. Playback of AAC tracks will require some more work, probably done by Jiri.

user9

2006-09-08 09:06

  ~0007861

Last edited: 2006-09-08 17:59

I have tested the following file extensions (AAC, M4A, M4B, AIFF, AU, M4V, MP4, MOV) and result was in good order.
I have not had possibility test the following file extensions (M4P, AA).

jiri

2006-09-17 20:19

administrator   ~0007900

I have completed support for playback using 'format' plug-ins and so now we can Convert, Burn and Play formats supported by QuickTime (AAC, MP4, etc.).

The only remaining part of this issue is to show something when QuickTime isn't installed. The message should indicate that:
 1. User must install QuickTime in order to make AAC playback work. (with download link, etc.)
 2. There is an option to purchase something from Ventis Media (a standalone app) that supports not only AAC playback, but also encoding.

Leaving to Rusty to specify this message. I suppose that we can only finish this issue after step 2. is specified/implemented.

rusty

2006-09-18 14:58

administrator   ~0007910

Message:

Playback of AAC, M4A, MP4, and M4B files requires downloading either of the following:
1) Quicktime (link to http://quicktime.mediamonkey.com)
2) MediaMonkey AAC Codec (link to http://aac.mediamonkey.com)

jiri

2006-09-18 16:42

administrator   ~0007913

Pavel, so show this message in case QuickTime can't be found (i.e. initialization fails). Also:
 - Use MM COM/scripting methods for showing User Inteface elements (check out f_flac_codec plug-in for an example of how to do it in C/C++).
 - Add '[ ] Don't show this dialog again' checkbox so that users could prevent showing the dialog in the future.

jiri

2006-11-02 12:14

administrator   ~0008130

As discussed over IM, in order to support playback of tagged AAC files, QT function NewMovieFromUserProc() should be used (an example is at http://svn.icculus.org/*checkout*/SDL_sound/trunk/decoders/quicktime.c?rev=334). Part of the example:

/*
 * This procedure is a hook for QuickTime to grab data from the
 * SDL_RWOps data structure when it needs it
 */
static pascal OSErr QT_get_movie_data_proc (long offset, long size,
                                            void *data, void *user_data)
{
  SDL_RWops* rw = (SDL_RWops*)user_data;
  OSErr error;
    
  if (offset == SDL_RWseek (rw, offset, SEEK_SET)) {
      
    if (size == SDL_RWread (rw, data, 1, size)) {
      error = noErr;
    }
    else {
      error = notEnoughDataErr;
    }
  }
  else {
    error = fileOffsetTooBigErr;
  }
  
  return (error);
}

rusty

2007-01-16 23:00

administrator   ~0008439

Last edited: 2007-01-17 14:20

Note: in build 1013, ALAC support is missing.

My mistake--I didn't realize that ALAC is in an .m4a container.

jiri

2007-01-17 14:35

administrator   ~0008440

Resolving.

jiri

2007-06-20 15:25

administrator   ~0009510

There are some problems reported, here is it as described by Steegy (our user):

---------
I tried playing the file on MM3 Alpha5 but MM just terminates. I'm using the default plugins, and QuickTime Alternative (using QuickTime 6.5.2).
 
OK, I now installed QuickTime 7.1.6 and playback works fine. But in any case, MediaMonkey shouldn't crash if an incorrect version of QuickTime is used, or at least it should give an informative message that an update is required.
---------

We should check out whether we can prevent the problem.

The file is uploaded to FTP as hp35.m4a.

user9

2007-07-30 08:21

  ~0009984

Fixed in build 1055 - QuickTime version must be greater or equal to 7.1.6.

jiri

2007-08-04 13:00

administrator   ~0010059

MM just asked me to install QT 7.1.6, although I had a pretty recent version (7.1.4). Do we know that only 7.1.6+ works well with MM? Or was this number chosen rather arbitrarily? Couldn't it be e.g. QT 7+?

user9

2007-08-10 09:37

  ~0010091

Fixed in build 1059 - MM just needed QuickTime version 7.0.0 or greater.

rusty

2007-08-22 14:49

administrator   ~0010237

Last edited: 2007-08-22 14:50

As discussed over email, ALAC playback fails (file is greyed out) in some cases. Pavel has indicated that this is related to multichannel support.

Posting 2 vivaldi files that fail to play to the ftp server.

user9

2007-08-27 12:30

  ~0010373

I have tested both ALAC tracks in QuickTime and definitely it is not MM bug.
It seems to be, that QuickTime fail to open and play very long named tracks (files). I recommend using short file names for fix this issue.

Fixed in build 1066.

rusty

2007-09-24 21:27

administrator   ~0010940

Users have sent in 1 new files (m4b) that plays fine in iTunes, but doesn't play at all in MM:

Harry Potter 4 Goblet of Fire V2 - Part I.m4b

rusty

2007-11-02 01:31

administrator   ~0011768

Last edited: 2007-11-02 02:01

Just another note:
As reported in the forums .m4p and .m4b files do not play in build 1098.

It appears that we'll have to launch without support for protected iTunes content.

Note: installing in_tunes.dll by Thomas Wiesehöfer resolves this problem (this is the m4p plugin that we've told MM2.x users to use). Also, interestingly, users have indicated that with this plugin, MM can convert from M4P to MP3 without a problem (I've yet to test this out).

jiri

2007-11-06 14:37

administrator   ~0011795

Fixed in build 1099.
 - Protected content should play well in MM now (I haven't tried it, since I don't have any such tracks, but the code should be working well).
 - Note that it has limitations given by the fact that we don't have access to the raw audio data, many things don't work, like: Visualization, Equalizer, Tagging while Playing causes skips, etc.

rusty

2007-11-09 20:45

administrator   ~0011865

Last edited: 2007-11-09 20:50

Tested build 1100.

m4p plays correctly. However:

1) m4b doesn't play at all (just gets greyed out).
2) the first time the user double-clicks an m4a track, MM doesn't play it and skips the next ~10 tracks (they get greyed out). This skipping of tracks occurs fairly often (about 20% of the time that the user clicks 'next', extra tracks are skpped), however, the problem seems to gradually go away as more m4a tracks are played.

jiri

2007-11-10 00:11

administrator   ~0011875

Fixed in build 1101.
 - I found a small problem, that will possibly fix at least some of your issues. If not, I also added several debug messages, so please create a debug log then.

rusty

2007-11-11 15:55

administrator   ~0011891

Tested build 1101:

Item 2 is completely fixed for m4a files -- they always play when double-click.

HOWEVER, neither m4b nor m4p files play successfully. Debug log with description at the beginning of which files failed to play is posted to the ftp server.

rusty

2007-11-11 20:09

administrator   ~0011895

To clarify re. m4b/m4p files:
The when the tracks are opened, then the seek bar quickly moves from left to right (about 2 seconds for the entire track) but no sound comes out. The same is occurring for both m4p and m4b.

note: m4b can be DRMed, though not necessarily.

rusty

2007-11-12 01:38

administrator   ~0011902

I've posted a new debug log using the f_aac debug dll provided. The log shows in order
-failed m4p playback
-failed m4b playback
-successful m4a playback

jiri

2007-11-12 12:59

administrator   ~0011914

Fixed in build 1102.

To clarify what exactly it currently does:
There are two methods of playback:
(A) Audio samples decoding, all MM functionality works (visualization, equalizer, etc.)
(B) Audio playback managed by QT - completely out of reach of MM.

MM uses (B) for:
1. Tracks with M4P extension.
2. Tracks with M4B extension that contain 'drms' (which seems to be an indication of a DRM protected track).
Method (A) is used for all other tracks.

Note: When a DRM protected track is played on an unauthorized machine, the following happens (automatically done by QT, we can't do anything about it):
1. A dialog asking user to authorize this PC using iTunes.
2. If canceled, playback continues, there just isn't any sound (but playback time is normally shown in MM).

rusty

2007-11-12 22:23

administrator   ~0011936

Verified 1102.