Monday, July 17, 2006

Universal binary update, sound woes...

I am still busily working on the universal binary beta. So far the beta feedback has been very sparse (probably because penetration of Intel machines is still low), with half the complaints being around sound playback. The good news is that we can fix it for the Intel binary, the PowerPC binary will still fail in certain situations as we are uncomfortable changing the PowerPC binary too much at this point.

What situations? Well, until now the Flash Player was using the Carbon Sound Manager to output sound. It turns out if you change some system settings which some audio application like to do it breaks that API. It seems that the QuickTime player is also using the Sound Manager, so you do not get any sound playback there either when playing back a .mov.

To reproduce the bug in the universal binary beta (9.0r18 or earlier) go to Applications->Utilities->Audio MIDI Setup and change the properties for the 'Build-in Output', changing the format from 44100.0 Hz to f.ex. 96000.0 Hz. I used OS X 10.4.7 with QuickTime 7.1.1. Now, you'll notice that there is suddenly no audio anymore with any Flash content.

A user reported that Audacity is a source of this issue and indeed, if you just launch Audacity it always changes the system wide setting to 96000.0 Hz without reverting it to the old value when you quit. So when using older applications, use Audacity and suddenly have no sound output make sure to double check this setting.

What's the fix? Well, the easy way for me would be to fault the Sound Manager, it should support any sampling rate or have Audacity not change this setting unless asked for. On the other hand I know that the Sound Manager is some extremely old API which is basically there to support legacy applications only. Therefore I switched the whole sound output to use Core Audio which is probably the Right Thing to do at this point. Although as I said, we are uncomfortable with drastic changes like this, so we will not touch the PowerPC binary for now.

Udpate: QE has informed me that is is apparently not an issue with native PowerPC G4 and G5 machines as their sound hardware does not support anything higher than 48000.0 Hz with which Sound Manager has an issue. This seems to be the reason this only happens on Intel hardware. Well, except if you have a special sound card which supports 96000.0 Hz.

14 Comments:

Blogger gandalf said...

It makes sense to use Core Audio - there are a bunch of Core packages now for developers - hope it works out. My guess is that PPC (classic) use has got to be dwindling.

Monday, July 17, 2006 2:41:00 PM  
Blogger tom said...

Had no idea there was a beta... Is it available from Adobe labs? I couldn't find it over there. Otherwise, I'd be happy to put it on my MacTel.

Tuesday, July 18, 2006 10:30:00 AM  
Blogger Tinic Uro said...

tom,

the beta is here:

http://www.adobe.com/products/flashplayer/public_beta

emmy has also blogged about this:

http://weblogs.macromedia.com/emmy/archives/2006/06/get_your_intel.cfm

Tuesday, July 18, 2006 11:14:00 AM  
Anonymous Bazard said...

Hello Tinic,

As you are working on the universal binaries for Flash Player 9, I guess that all major developments of the player are considered as over.

Nevertheless, there are still some problems with smoothing images. From your previous post http://www.kaourantin.net/2005/12/dynamically-loading-bitmaps-with.html people still complain about it.

I also had a look at it and it is true that if you rotate an image, the image is not antialiased.

To achieve this in Flash 9 beta I use this:
--------------------------------
import flash.display.*;
import flash.net.URLRequest;
import flash.events.Event;
var container:Sprite = new Sprite();
addChild(container);

var pictLdr:Loader = new Loader();
var pictURL:String = "image.jpg"
var pictURLReq:URLRequest = new URLRequest(pictURL);
pictLdr.load(pictURLReq);
pictLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoaded);
function imgLoaded(e:Event):void {
container.addChild(pictLdr.content);
container.rotation=20
}

(Yeah, all this code just to replace MovieClip.loadMovie() in AS3...)
--------------------------------

Did I miss anything?
From the documentation http://livedocs.macromedia.com/flex/2/langref/flash/display/DisplayObject.html there is still no smoothing option. As you mentioned this option would be available in Flash Player 9, doesn't it mean it has been canceled or will it come in the final release of Flash 9 (although the development of the flash player is supposed to be over now...)

Any new information will be much appreciated.

Thanks.

Wednesday, July 19, 2006 3:31:00 AM  
Blogger Tinic Uro said...

bazard,

you should be able to do this in AS3:

function imgLoaded(e:Event):void {
var b:Bitmap = pictLdr.content as Bitmap;
b.smoothing = true;
container.addChild(pictLdr.content);
container.rotation=20;
}

The Bitmap.smoothing flag is documented, although the usage here in this context might not be clear.

In AS3, dynamically loaded images are actually converted to bitmap objects unlike in AS2 where there are converted into an intermediate SWF file. That's why this works.

In AS2 you can set MovieClip.forceSmoothing=true; of your loading movie clip in the complete event.

Wednesday, July 19, 2006 4:09:00 AM  
Anonymous Bloody said...

Gandalf, I too though that, when they announced Mactels, Apple were dropping the PPC architecture. But it seems it is not the case; if you take a look at their website, you'll notice that only their lower-end models are using Intel chipsets. Their higher-end models are still using PPC chipsets. Makes sense though as the PPC is really the better architecture but the advantage of the Intel architecture is that:

1. It's cheaper.
2. It's better supported.

Wednesday, July 19, 2006 7:02:00 PM  
Anonymous Bazard said...

Hello Tinic,

Thanks for your explanation. I should have digged more into the documentation and bitmap.

Maybe you can also add your comment to your previous post http://www.kaourantin.net/2005/12/dynamically-loading-bitmaps-with.html as I guess some people might go and see this previous one to try to find the answer.

Many thanks again for the quickness of your response.

Wednesday, July 19, 2006 8:51:00 PM  
Blogger clt510 said...

For what it's worth, my 4 x 2.5GHz G5 has 2-channel, 24-bit, 96 kHz sound as well, which is also the default on that system. I suspect this is standard on any of their new hardware.

BTW, CoreAudio is definitely a huge step up in my opinion. Much more robust, a lot fewer drop-outs (even when you are slamming the system pretty heavily), and overall a much cleaner programming environment than any I had used previously. (The old NeXT computer was the closest I had gotten before with it's builtin DSP 56001 processor.)

Friday, August 11, 2006 3:11:00 PM  
Anonymous Anonymous said...

Would you happen to know why flash doesn't seem to work with an audio output other than internal audio? I've got a firewire audio interface that works with every app other than flash, and nothing I can find hints that anyone else has had this problem. I'm not sure if it's related to this issue, but you seem like the man who would know. :)

Sunday, January 07, 2007 1:13:00 AM  
Anonymous Anonymous said...

I lost sound in my flash player after using Audacity to make a pod cast. After hundreds of frustrating hours (trashing things - reinstalling the player, etc) I fixed it. How? I opened Garage Band, played a loop and it was all better. Viola. My flash player had sound. Running a Power PC Mac Mini. Spread the word.

Wednesday, March 28, 2007 10:03:00 PM  
Anonymous Anonymous said...

Yup, I had this issue too. Tried reinstalling various players, but to no avail. As a last resort I tried the GarageBand-trick (thank god for piracy), worked like a charm.
HW: 1.42 GHz PPC Mac Mini

Sunday, May 06, 2007 3:40:00 AM  
Blogger Mark Richmond said...

Tinic,

I'm using Flash CS3 and I can't find any reference to the MovieClip.forceSmoothing parameter. Did that get cancelled. Right now I'm using a proxy script and bitmapData to get external images (i.e. Flickr) to smooth in Flash 8 and bypass the security issues. This is NOT an effective solution. Is there a simpler way to smooth images loaded from other servers in CS3?

Thanks,

Mark

Monday, July 02, 2007 12:40:00 PM  
Anonymous <a href="http://drugscenterhere.com">ShopMan</a> said...

I like articles like this. Thanks!

Saturday, August 25, 2007 11:30:00 PM  
Anonymous <a href="http://courses.cvcc.vccs.edu/ENG112_GROSS/_Chat_Room/000008fd.htm">Anonimous</a> said...

Well done. Keep up the great work. Best regards!

Sunday, September 09, 2007 10:08:00 AM  

Post a Comment

<< Home