Archive for December, 2008

Playing the best sound on PS3 – Without HDMI

The advent of HDMI brought to the digital arena all the bells and wistles of the high tech video and audio industry. Particularily in the audio sector, HDMI makes it possible to go a step closer to the original analog signal.

Wait! Analog!? Didn’t everybody say Digital was better?
Well, it is, in a way. See, technically, video is represented on screen pixel by pixel. Until LCDs came around, pixels weren’t quite squares on the screen but interpreted stuff from analog signals. So yes, in terms of visual accuracy, digital is better. Square for square, pixel for pixel, data for data, simply the pure stuff.

However, it is still argued whether a digital cinema camera can beat a film camera because of the natural grain on the various kinds of film, but that has nothing to do with our case. Why? Because DVD and Blu-ray, both digital formats, have visual data stored in pixels, 100% digital 1s and 0s. And since your LCD (HDTV or not) uses a physical grid to represent pixels, digital is better (no conversion, just pure video straight out from the DVD/Blu-ray player, provided you are using a digital output such as HDMI).

But the sound realm is something completely different. Sound is composed of waves. The way speakers and headphones, well, anything that makes sound actually, gets to output what you hear is by vibrating some membranes, a lot like your eardrum vibrates to the sound it receives, which is then transmitted to the brain for analysis.

So whatever you do, however sophisticated your system may be, the end of the line is always analog because the speakers are. Now, to represent sound in digital form, as analog signals cannot be stored on digital media like CDs and Blu-rays, you have to interpret them into bytes. This is where it gets geeky. But basically, all you have to know is that no digital audio format is able to interpret at 100% the analog signal. This is negligeable though because an analog signal degrades over distance and what not. Digital on the other hand still has the benifit of being lossless, even if carried accross multiple devices. The closer you can bring your digital stream to the speakers without converting it, the better, which is just what HDMI does.

There are, in general, two big different ways to interpret audio digitally: PCM (Pulse-Code Modulation) and DSD (Direct Stream Digital). Here is an image from Wikipedia, explanations afterwards.

Hmm, fancy graphics…
So, the white line you see is the famous audio wave, more specifically called Waveform in this case because it is the form the audio wave makes, clever. The green lines are how the data is represented digitally.

PCM is fairly easy to understand. Just looking at its graphic provides basic understanding. Common flavors of PCM come in 16 bit resolution. Each bit represents either a 1 or 0, this is why the total amount of possibilities is 2 and X number of bits (2X bit). This means that for each sample, there are 65′536 steps, represented from top to bottom. Think of a sample as a frame in video, it’s multiple images stringed together to make video, but in this case, it’s multiple bits of different sound frequency values stringed together to make sound!

PCM is also defined by its Hz. This is how many samples there is per second. Common flavors of PCM come in 44.1 kHz (k = 1000). So, 44′100 samples per second at 16 bit resolution.

The PCM graphic shown above shows a largely imprecise drawing of how PCM works. Here is a more accurate representation in 4 bit.

While looking at a PCM graphic though, its weakness jumps to the eyes. Sinusoidal equations (the waveform) represented by steps that can be thought as a bar graph, means that some precision is ultimately lost and some frequencies, especially pulses, can only barely be represented by the highest audio resolution and sample rate, which is where DSD comes in.

Oh, another fancy graph (brought you by an analysis from Merging Technologies). As you can see, PCM, the three bars in the middle, is not very good at representing impulses. Whether this really helps DSD attain better quality is highly debated. But the theory is DSD is closer to the original analog signal than PCM. Why is that so?

Ok, if we remember correctly what we were going over, audio or Waveforms are mathematical sinusoidal calculations. Well, in reality, much more complex audio is a combination of those or other basic functions. But that is not the point.

DSD is represented over only 1 bit and is sampled at a much higher rate at 64 times that of 44.1 kHz stereo audio: 2.8224 mHz (m = 1′000′000) or 2′822′400 samples per second. The single bit per sample represents either a 1 or 0, or positive or negative value in this case. Along with an algorithm to interpret it, the mix match of positive and negative values makes it is possible to store the audio data as shown above. The advantage of DSD is that audio data is made back from algorithms that more closely represent the amalgamy of sinusoidal equations that form an audio wave. This less visual and more mathematical way to store information makes it possible to convert the digital data back to a signal closer to the original signal that came from the microphones.

However, DSD has less hardware capable of transferring it over digital streams. The reason is simple. While the industry was finding ways to digitize audio transport to lose less quality over the multiple devices required for surround home theater technology with efforts like optical audio over Toslink (SPDIF, Sony/Philips Digital Interconnect Format), Sony (ironically the same company who co-developed SPDIF) introduced the SACD with DSD technology (DSD was also co-developed by Sony and Philips) in an analog fashion.

The motive to make SACD a primarily analog media was simple: make it compatible with current receivers. In 1999, a time where DVD was just starting out, next to no-one had a digital-capable receiver, it wasn’t quite around yet. This and the fact SACD requires new hardware to convert into an analog signal is why even multi-channel SACD was being outputted on analog. Additionaly, SACD doesn’t allow unencrypted streams to be played back digitally, so only i.Link and HDMI can transport DSD streams.

Today, the HDMI specification allows the transport of SACD streams but even Sony’s only SACD stand-alone player still sold in America doesn’t support passing SACD streams through HDMI (some higher end models from Pioneer, Onkyo and others do support it). Instead, DSD streams are converted and then passed as Stereo CD quality content (16 bit @ 44.1 kHz), far from SACD’s potential. SACD fans hoping to pass DSD streams through the Playstation 3’s HDMI port are probably out for luck for ever.

But, luckily somehow, SACD is a primarily analog format. Theoretically, any SACD-capable player can output DSD through analog, which, simply put, is outputing the signal only, not the actualy digital stream.

Since we’re talking analog, the PS3 can output the full signal of any of its audio formats, including SACD and Dolby TrueHD. However, one of your devices (either the player or the receiver) must provide bass management if you’re using a satellite + sub system. The PS3 does not provide bass management. But the PS3 can output your video through HDMI, so you have full 1080p HD quality and full audio quality through analog.

Keep in mind the PS3 is limited to Dolby Pro Logic II when outputting surround through analog. I couldn’t find out whether Dolby Pro Logic IIx is available on the PS3 (for 6.1 and 7.1 surround sound) but one thing’s for sure, no matter how far from discrete channels Pro Logic is, you’ll still get the full audio signal from stuff like Dolby TrueHD Audio, which is interesting to know for Blu-ray playback on older non-HDMI equipped systems.

And yes, the PS3 really outputs all of its audio formats in full audio resolution on the analog outputs (the signal is directly converted by the PS3 from source), Dolby TrueHD Audio included. The quality is nothing short of amazing if you have the proper receiver, cables and speakers of course.

Tags: , , , , , , , , , , , ,

Why is my camera offering 48 bit imagery when the eye only sees 24 bit?

If you’re new to all the media editing stuff and have recently started playing around with high quality photography, movie editing or digital music, you’re bound to come across a certain dilema.

So, why are RAW image files 48 bit when our computer screens can’t even display more than 24 bit, why is audio mastered in 24 bit and crazy sample rates when the final format is a 16 bit CD?

The very simple reason, editability. Take a RAW image file for example. It boast 48 bit color. A regular computer screen, provided you have a display capable of displaying real colors (TN LCD displays can’t for example, while IPS LCDs can), has 24 bit color, or, 8 bit per channel (Red, Green, Blue). Color depth is exponential, meaning 24 bit has 16.8 million colors while 48 bit has 281.5 trillion, about 16.7 million times the amount of color. Well, applying effects on those colors is years ahead of 24 bit color in terms of precision. Even though the eye can’t see it, the photo mastering software’s algorithm sure can.

The same applies to sound. Sound is mastered in higher formats to allow more modifications and corrections without altering the clearness of the sound when downconverted to its published medium.

But not all industries have the luck of dealing with small size technolgies. Video (without audio) is multiple images and it would take too much space to store video in 48 bit. The video realm is much more about how much you can keep of the original source intact while editing it with the most efficient yet fast to decode codec (making the codec less efficient since it’s fast) than about mastering it with the highest quality possible.

Mastering HD video in an uncompressed format would be killer. HD-SDI runs at ~ 1.5 gbps (or 1500 mbps) while the highest possible audio recording format available today (DXD, Digital eXtreme Definition) runs at ~ 8.5 mbps per channel. In 8 discrete channel surround sound, ~ 67.6 mbps, a bit-rate that already rivals some of the bitrate used for the highest quality 1080p mastering solution, and since digital cinema is even higher than that, I wouldn’t want to imagine the quantity of hard-drive space required to edit that.

Browse Happy – Why you should think twice before blaming IE

BrowseHappy.com is a website I’ve already seen before but haven’t took the time to ridicule yet.

Browse Happy is a site pushing users to stop using Microsoft’s Internet Explorer because it is supposedly unsafe. I quote “Internet Explorer can make your computer unsafe. Why not switch to a browser that’s more secure?”.

If you clicked on the previous link, you can see that the only facts they give are actually outdated quotes (XP SP2 anyone?), blames on IE6 (The US government warning about IE dates back to 2004, two years before IE7 launched) which are yes, valid, don’t use IE6, upgrade, and opinions, I quote “Ms. Sandlin is so devoted to Firefox that she has taped a note to her monitor warning guests not to click on the desktop shortcut to Internet Explorer. Do not touch the blue ‘E!’ the note says.”

Now, it’s even funnier  when it comes to the browsers it recommends. Apparently the people who made this website haven’t been there in years. Their Firefox link still points to Mozilla.org, since then, Mozilla downloads are on the .com site (their link redirects you) and they forgot to include Google Chrome, now out since more than three months! But hey, the worse is the Mozilla link. Click on it and you’ll land on a page that’ll explain you how this browser is basically discontinued. They (Mozilla themselves) even recommend you don’t use it for daily usages.

Now, the realiy is Internet Explorer 7 is not bad at all and Internet Explorer 8 kicks ass (at least, will, still in beta (beta 2) as I write this). Before trusting anything you read on the net, look at the date and then face the facts. Please, stop this IE hate, and if you’re an IE user, stay with it and make sure you have the latest updates.

On today’s computers, you should worry more about having an adequate antivirus solution that does more than simply scanning viruses (anti-spyware, rootkit detection, IM encryption).

And for the skeptics, I’m on a Mac on Firefox.

Japan – The Most Secure Online Country

I just happened to stumble across a very surprising research result at Microsoft’s while browsing their computer-initiate (not to say newb or dinosaur) oriented pages (as I often do to make better educated guess as to how to explain stuff to people on my sites).

Well, look at that.

This surprising picture demonstrates infection rates by country. What is really baffling is that Japan has a significant gap against the rest of the world, getting almost no report of security incidents.

I don’t know how this should be interpreted really, but I’d have to point at the Japanese’s society. Their strict law enforcement system probably compels Japanese people to do less pirating than Americans or other countries, making people a lot less prone to viruses. Apart from maybe being more aware security-wise, another factor is that a lot of Japanese people spend significant amounts if not the majority of their Internet time on a cell phone, a platform that has yet to see the requirement for an antivirus.

(Note: this last statement is absolutely baseless, I just picked that out from what I know, don’t take it for granted)
More surprising though is that China has less incidents than North America. Looks like the ones who make malware don’t get cought by their own stuff.

Google Chrome – How did it fare in 2008?

Statistics based on W3Schools

The answer is, surprisingly better than Safari and Opera. Yup, right at its launch, Chrome gained a stronger usage rate than Safari or Opera.

However, Chrome’s usage rate has largely remained stagnant betwen September and now. What’s interesting is how the statistics translate.

Firefox rates go up 2% and Safari, IE7 and Opera didn’t bulge (minor 0.X% changes). The only major browser to have lost something is IE6, where as its usage came down 2%. What tells us that 2% of IE6 users got Google Chrome is that Firefox lost roughly 2% of its users as Chrome launched, so we can guess some 2% of Firefox users switched to Chrome for a month or so and then came back.

It makes a lot of sense this way, Chrome is zippy and really fast and the Firefox alternative may have been just a bit too big for those aging computers still equipped with IE6. Chrome, however, made the deal.

What do you think about these statistics.
Will Chrome ever escalate from a niche product to the people’s favorite?

Why JavaFX Sucks… for now

Warning: Ranting Ahead
This article was written around the launch of JavaFX.com, it may prove untrue in future version of JavaFX, first version mistakes happen.

No Graphic Design Environment Intergration
Being able to code designs in XAML for Silverlight is great. But RIAs (Rich Internet Applications) are all about graphics. Fortunatly, both Flex and Silverlight are backed by companies that produce fully integrated graphic design solutions.

Sun, on the other hand, doesn’t make graphic design tools. This means JavaFX will never attain the integration level of Flex or Silverlight, simply because the graphic tools required to produce JavaFX content belong to its competitors.

Poor Media Support

Silverlight is backed by Microsoft’s array of video encoding and distribution tools. Everything is very well integrated and Silverlight 3.0 will bring support for H.264. Microsoft has long been serving streaming markets with tools that work. Flex has everything Adobe does, including Flash. Just the fact that Flex runs on Flash, which gives it access to Flash’s proven video solutions, makes it better.

JavaFX on the other hand is stuck with a subset of Adobe Flash’s FLV format, called FXM, to display video. JavaFX does support a bit more than that, but the cross platform framework is limited to VP6 and Mp3. Even though JavaFX may be capable of communicating with Mac’s Core Video or Windows’ Direct Show because it runs on Java, we’re still talking about web apps here, a place where dependancy on the OS is not welcome.

Heavy Plugin

The plugin part is even more boggling. Unlike Flash and Silverlight, JavaFX relies on the whole Java plugin to run. Installing Java is far from being a light experience. Even more problematic is Java on the Mac platform. Java on Mac is distributed through Apple’s own Software Updates on Mac OS X. And if that latest update did not include something very new from Sun, you’ll be surprised that you won’t have access to some JavaFX content, even though you have the latest version (as is the case right now as I type this).

Edit: Developers can download the latest Java SE for developer stuff at apple.com/java/download/

Edit 2: I did some tests on JavaFX formats for interpreting vector graphics. the FXZ came in very close to the SWF rendered from Flash while an SVG came in at around 5 times the size. However, when it came to performance, the same heavy vector graphic on the SWF would perform twice as fast as the SVG in most browsers while the FXZ would nearly crash Netbeans, but is at least very performant on the desktop viewer in the JavaFX Production Suite. It would be a good thing to note though that the FXZ viewer seemed to cache a bitmap version in RAM everytime I would resize the vector art, something that was done dynamically on the SWF with acceptable performance albeit the complex vector. As Netbeans was resizing dynamically with a true vector display and nearly crashed, we could safely say that FXZ is far from fast. SVG is much faster to interpret and SWF simply puts both on the floor. I have yet to try XAML.

It’s Slow

What do you want me to tell you? This RIA platform is simply broken. The poor demos aren’t even real full page RIAs, they seem more like turtle-speed Flash-like embedded apps than an actual worthful demo.

On my older Pentium 4 hardware, the JavaFX samples from JavaFX.com loaded, slowly, but they did load and run, although far from as smooth as Flex or Silverlight demos. Although JavaFX apps took longer to start than Silverlight or Flex apps on my 2.66ghz Pentium 4 PC, this behavior is identical on any processor (Java libraries are to blame). Performance-wize, the apps tested in my previous entry weren’t on the same level and when it comes down to it, they are all more or less the same just acceptable speed on older hardware.

On my Mac, every single demo app nearly made the browser crash (by which I mean Firefox would stop responding for a while, under a minute). In fact, only Firefox survived. Both the latest versions of Safari and Opera would crash badly. And all of that on a Intel Core 2 Extreme 2.8Ghz.

Edit : I’ve tested JavaFX on a few other PCs and it turns out it runs perfectly well (better than earlier releases of Silverlight in fact). Sure, JavaFX still takes a lot of time loading the applications because of the way Java apps run, so it cannot replace embeded Flash, but if Sun succeeds at making it performant on all platforms (say, fixing a few quirks), it does have a place amongst RIA frameworks.

Conclusion

If you’re looking at making RIAs, I’d place my bets on Microsoft’s offers because of Silverlight’s intergration with ASP.net and the Visual Studio IDE, IMO one of the best IDEs that exists and Adobe’s offers because of its platform’s capacity (superior video, Air, Flash animations, Flash’s popularity, vector graphics speed, etc.), but certainly not on JavaFX, at least, not for now.

JavaFX still needs a bit of polishing and a lot of luck to gather market interest. I’d have to say that unless something inovative is brought by JavaFX, it’s not really going to catch on. Let’s face it, most developers that would do something like an RIA are on Adobe stuff already and if it wasn’t for Microsoft’s sites using Silverlight, it wouldn’t have gathered much attention.

However, JavaFX runs on Java, and there’s a lot of Java developers. This is sure to help.