Bug 16319 - Some files won't play -- depends on name of file
: Some files won't play -- depends on name of file
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Misc
: 7.5.x
: Macintosh MacOS X 10.6
: P2 normal with 1 vote (vote)
: 7.9.x
Assigned To: Michael Herger
: charset_issues
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-24 10:36 UTC by fred goodman
Modified: 2018-01-15 04:35 UTC (History)
3 users (show)

See Also:
Category: Bug


Attachments
error log (23.01 KB, text/plain)
2010-07-11 13:50 UTC, fred goodman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fred goodman 2010-06-24 10:36:19 UTC
I have SBS 7.5.1 on Mac OS 10.6.4.  I find that some files won't play, but if I rename them, they will play.

This is not a scanner and database issue.  The result is the same if I try to play the files from the music folder browser, which apparently bypasses the database.  The problem is very subtle, as I will illustrate with an example:


Here is the name of a file, as seen from SBS music folder browser:

24 Rachmaninoff - Rhapsody On A Theme Of Paganini - Variation XXII - Un Poco Più Pivo (Alla Breve).m4a

The file would not play. I changed the name of the file (from within itunes, so I also changed the title tag) to 

24 Rachmaninoff - Rhapsody On A Theme Of Paganini - Variation XXII - Un Poco Più Pivo, Alla Breve.m4a

Then the file would play. If instead, the file name ended in

- Alla Breve

it would not play.

I changed back and forth between these variations on the name of the variation with consistent results. With the comma, it played, with parentheses or dash, no music.

Everything clear, right? Well, no. This file is sitting in a directory with 31 files. If I made a test
album with only one file in it, then the file would play with the original name, with parentheses, or with the dash.
Comment 1 Jim McAtee 2010-06-24 14:25:18 UTC
(In reply to comment #0).
> 
> This is not a scanner and database issue.  The result is the same if I try to
> play the files from the music folder browser, which apparently bypasses the
> database.

Browse Music Folder (BMF) uses the database just like all of the other browse modes.  The scanner places the directory paths into the database and BMF gives the illusion of browsing through the directories.
Comment 2 fred goodman 2010-06-24 14:50:04 UTC
> 
> Browse Music Folder (BMF) uses the database just like all of the other browse
> modes.  The scanner places the directory paths into the database and BMF gives
> the illusion of browsing through the directories.


The illusion is extremely effective!   Changes I made in the file names were reflected immediately
in BMF mode (upon refreshing the page in the web browser) without rescanning.

Anyway,  both the scanner + database and whatever mechanism BMF is using fail in the same way.
Comment 3 fred goodman 2010-06-24 15:05:41 UTC
(In reply to comment #2)
> > 
> > Browse Music Folder (BMF) uses the database just like all of the other browse
> > modes.  The scanner places the directory paths into the database and BMF gives
> > the illusion of browsing through the directories.
> 
> 
> The illusion is extremely effective!   Changes I made in the file names were
> reflected immediately
> in BMF mode (upon refreshing the page in the web browser) without rescanning.
> 
> Anyway,  both the scanner + database and whatever mechanism BMF is using fail
> in the same way.


I verified the following:  if I make a change in a file name, and then view the corresponding folder
via Browse Music Folder,  the change is then written to the database, so that I also see it in other browsing modes.
Comment 4 fred goodman 2010-06-24 19:24:06 UTC
I looked around and found whole CD's worth of my music that won't play in 7.5.1 (also in 7.5.0).
So, for me, this is not just a matter of a few oddball files.
Comment 5 fred goodman 2010-06-25 08:29:59 UTC
Some more observations.  

First of all,  7.4.2  works fine.

Second, there are effects of scale.  My library has about 30,000 tracks and 2000+  albums.
I chose from this library one album that will not play at all under 7.5.1 (but will play under 7.4.2).
I changed my music folder to an empty folder, and copied the one "bad" album to this folder.

From my new library of 29 tracks and 1 album,  the files do play under 7.5.1.
Comment 6 fred goodman 2010-07-11 13:50:20 UTC
Created attachment 6911 [details]
error log
Comment 7 fred goodman 2010-07-11 13:52:46 UTC
The error is occurring in transcoding from apple lossless.

I have attached an error log, see previous comment.

Note in particular at

[10-07-11 15:29:50.0396]

a "tokenized command" is formed with an o-umlaut changed to some other character.
Comment 8 fred goodman 2010-07-11 20:47:40 UTC
Faad is failing.   I tried running the command constructed by SBS to play the suspect file, from OS X terminal.  The file made by faad failed as input to sox.


[imac:~] fgoodman%  "/Library/PreferencePanes/Squeezebox.prefPane/Contents/server/Bin/darwin/faad" -q -w -f 1 "/Volumes/Media drive/media/Music/iTunes Music/Gardiner, John Eliot; Monteverdi Choir & English Baroque Soloists/Bach_ Matthaeus Passion (Disc 1_3), Gardiner, Monteverdi Choir,  English Baroque Soloists/01 1.Teil - Kommt, Ihr Töchter, Helft Mir Klagen - O Lamm Gottes, Unschuldig.m4a" | "/Library/PreferencePanes/Squeezebox.prefPane/Contents/server/Bin/darwin/sox" -q -t wav - -t flac -C 0 out.flac
/Library/PreferencePanes/Squeezebox.prefPane/Contents/server/Bin/darwin/sox FAIL formats: can't open input  `-': WAVE: RIFF header not found
Comment 9 fred goodman 2010-07-12 06:20:15 UTC
The failure of faad depends on the whole path (or the complexity of the path) to the M4A file.

I moved the file on which faad failed (comment 8) to a location with simpler path, and did the following:


[imac:~/SQUEEZEBOX] fgoodman% "/Library/PreferencePanes/Squeezebox.prefPane/Contents/server/Bin/darwin/faad" -q -w -f 1 /Users/fgoodman/SQUEEZEBOX/01\ 1.Teil\ -\ Kommt,\ Ihr\ Töchter,\ Helft\ Mir\ Klagen\ -\ O\ Lamm\ Gottes,\ Unschuldig.m4a > out.wav
[imac:~/SQUEEZEBOX] fgoodman% "/Library/PreferencePanes/Squeezebox.prefPane/Contents/server/Bin/darwin/sox" -q -t wav out.wav -t flac -C 0 out.flac

A good flac was produced.

Just to check that the failure in comment 8 was not dependent on the unix pipe, somehow, I did the experiment again with the file in its original location:


[imac:~/SQUEEZEBOX] fgoodman% "/Library/PreferencePanes/Squeezebox.prefPane/Contents/server/Bin/darwin/faad" -q -w -f 1 /Volumes/Media\ drive/media/Music/iTunes\ Music/Gardiner,\ John\ Eliot\;\ Monteverdi\ Choir\ \&\ English\ Baroque\ Soloists/Bach_\ Matthaeus\ Passion\ \(Disc\ 1_3\),\ Gardiner,\ Monteverdi\ Choir,\ \ English\ Baroque\ Soloists/01\ 1.Teil\ -\ Kommt,\ Ihr\ Töchter,\ Helft\ Mir\ Klagen\ -\ O\ Lamm\ Gottes,\ Unschuldig.m4a > out.wav
[imac:~/SQUEEZEBOX] fgoodman% "/Library/PreferencePanes/Squeezebox.prefPane/Contents/server/Bin/darwin/sox" -q -t wav out.wav -t flac -C 0 out.flac
/Library/PreferencePanes/Squeezebox.prefPane/Contents/server/Bin/darwin/sox FAIL formats: can't open input file `out.wav': WAVE: RIFF header not found
Comment 10 Alan Young 2011-01-20 00:24:35 UTC
I suspect that this is a duplicate of bug 10199, in which case it should be fixed in 7.6. It would be helpful if you could verify this.
Comment 11 fred goodman 2011-01-20 09:00:04 UTC
I reported a proposed fix to this bug  to Andy Gundman by private email  in early December 2010.  I don't know whether he ever had the chance to follow up.

The fix consists in changing the length of three file path character arrays in main() in the SBS version of faad from  [256]  to [512].

I have been running SBS 7.5.2 with this fix since early December without any repetition of the problem, so I do think this fixed it.

My hypothesis is that this has nothing to do with unicode, but rather with the length of the file path.

Probably very few users would experience this problem,  but I have long file paths because I pack a lot of information into the album title  for classical music (actual album title, composer, performer).
When, in addition, the track title is long and the path involves some unicode characters, which in OS X are multiple byte sequences, the file path length can get pushed over 256 characters.  Then the path gets truncated by faad and the file is not found.
Comment 12 Michael Herger 2011-05-19 04:18:39 UTC
could you please attach your patch to this bug report?
Comment 13 fred goodman 2011-05-20 20:37:41 UTC
(In reply to comment #12)
> could you please attach your patch to this bug report?

Sorry, I don't know how to use diff.

My changes consist in changing the following lines in faad2-2.7/frontend/main.c

 char aacFileName[255];
 char audioFileName[255];
 char adtsFileName[255];

In each line, I changed [255]  to [512].
Comment 14 fred goodman 2011-09-04 10:41:52 UTC
I wonder if this couldn't be fixed at some point.  It couldn't be take than a few minutes work.  The fix is  provided in the previous comment (comment 13).

 Thanks.
Comment 15 Michael Herger 2017-04-04 20:55:40 UTC
This should finally be resolved in 7.9.1. Thanks ralphy!
Comment 16 fred goodman 2018-01-15 04:35:32 UTC
Latest LMS 7.9.1-1515659378 broke playback for me on Mac OS X. 

Previous version 7.9.1 - 1515216179 from several days ago works.

Did FAAD get broken again? 

The behavior is similar to that which prompted this bug report 
but I haven't tried looking at server logs to work out what is happening.