Play can't handle Flac 24/192

Discuss Play, an open source multi-format audio player.
Post Reply
bfn
Posts: 25
Joined: Sat Feb 07, 2009 2:45 pm

Play can't handle Flac 24/192

Post by bfn » Sat Feb 07, 2009 3:05 pm

Play freezes up when trying to play a flac 24/192. After that, I even have a hard time trying to remove that file from the play list.
Up to 24/96 everything works fine.
I also tried Cog and was able to run my 24/192 files without problem. Is there something I can do about this? Is this a known problem?
If you want to try out yourself, here's a link for testfiles: http://www.linnrecords.com/linn-downloa ... files.aspx
BTW: I'm using a Mac mini, OS X 10.5.x, Play 0.3 latest stable build.

tbattley
Posts: 3
Joined: Sat Aug 16, 2008 4:36 pm

Re: Play can't handle Flac 24/192

Post by tbattley » Thu Mar 05, 2009 3:47 pm

maybe that's my problem?

I am on a dual core 3 ghz iMac running (or trying to run) Version 0.3 (1071).
I think that I recognize your symptom: for no apparent reason Play will only play one song in the current playlist. It will not play a song when I double-click it (these are not 24/192 rips, but I may have several of these in the overall library).

I cannot delete songs from the current playlist. I am basically up a creek. So I have to delete Library/application support/Play/Library.sqlite3
This eliminates everything that have added to the library in the past few weeks. Sometimes I even have to reinstall Play. I add in a backed-up verion of Library.sqlite from a back-up and I end up back two months ago with my library.

This is such a bummer. It seems so unlikely that there cannot be a Macintosh equivalent of Foobar2000, but there isn't. When you load Foobar2000 all you have to do is point it at every single drive and location where music lives, and it imports it all, without hiccup, without crashing, and it plays it all too! No lock-ups! No crashes! No reinstalling anything... ever!

Play is so close, but these mysterious hiccups and lock-ups are a nagging disappointment. What can we do to help make Play the standard against which all other Mac players are judged?

User avatar
sbooth
Site Admin
Posts: 2445
Joined: Fri Dec 23, 2005 7:45 am
Location: USA
Contact:

Re: Play can't handle Flac 24/192

Post by sbooth » Fri Mar 06, 2009 3:08 pm

I've confirmed that this is a problem with WAV files at 192 KHz as well, so it seems the issue is outside the scope of FLAC. I've spent some time debugging but I still haven't determined the cause.

rsdio
Posts: 7
Joined: Mon Jun 23, 2008 10:27 pm

Re: Play can't handle Flac 24/192

Post by rsdio » Tue Jan 12, 2010 12:33 pm

I recently obtained a 24/192 FLAC (also from Linn Records) and noticed this same problem. However, after decoding to AIFF the problem persisted, even in iTunes. I could not get anything to play the file under Tiger, not even AULab 1.0.3, which should be capable of anything that CoreAudio supports. I searched the CoreAudio ML archives and found a warning from Apple that the default buffer sizes may be too large for some AudioUnits when running at 192 kHz. They recommending setting a lower latency to keep the buffer size small. Unfortunately, that did not help.

The only way I was able to get this to work was under Leopard. There, AULab 2.0.0 worked, as did iTunes. I don't think I tried Play.app again at that point.

I am curious to know how Cog is able to get this to work when iTunes cannot (192k in general, that is). I have my own FLAC PlayAudio software, but I haven't compiled it in years, and the FLAC headers have changed since I last touched it. This could be a lot of work, and I've already lost steam because the particular 192 kHz file didn't have much besides noise above 40 kHz anyway, and there was apparently some aliasing mirrored around that frequency. i.e. I don't know if it's worth the effort!

User avatar
sbooth
Site Admin
Posts: 2445
Joined: Fri Dec 23, 2005 7:45 am
Location: USA
Contact:

Re: Play can't handle Flac 24/192

Post by sbooth » Tue Jan 12, 2010 4:41 pm

I know the cause of this problem, and it will be fixed in the next release.

I can't really release a quick bug-fix version because I am in the middle of swapping out the backend of Play using a new C++ audio engine I wrote and the changes are quite large.

The problem is that 192 KHz files are resampled to the output device's sample rate. Here is a comment from my fixed source code that I hope explains the problem:

Code: Select all

// ========================================
// Output units perform sample rate conversion if the input sample rate is not equal to
// the output sample rate. For high sample rates, the sample rate conversion can require 
// more rendered frames than are available by default in kAudioUnitProperty_MaximumFramesPerSlice (512)
// For example, 192 KHz audio converted to 44.1 HHz requires approximately (192 / 44.1) * 512 = 2229 frames
// So if the input and output sample rates on the output device don't match, adjust 
// kAudioUnitProperty_MaximumFramesPerSlice to ensure enough audio data is passed per render cycle
As you said, it's a buffer sizing issue.

User avatar
ye
Posts: 20
Joined: Thu May 11, 2006 7:43 pm

Re: Play can't handle Flac 24/192

Post by ye » Sat Jan 23, 2010 9:40 am

That 192kHz files are resampled to the output device's sample rate can not be the (only) problem. The issue also occurs if the output device's sample rate is 192kHz.
Cog plays 192kHz files well (also if I switch the output device's sample rate to something smaller than 192kHz).

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest