Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Audio is generally handed over to the OS via a format called Pulse Code Modulation. This is a series of audio "samples", which in the Windows case are individual signed 16-bit integers. Typically each second of audio is broken into about 44,100 of these integers. Each integer represents the sound amplitude during a particular 1/44,100th of a second, with a large negative number (-32,768) being a small amplitude and a large positive number (32,767) being a big amplitude.

You can view PCM sample amplitude as telling the sound card how much power to apply to the circuit driving the speaker. A large amplitude means the speaker cone should move a lot, and small amplitude means it should stay nearly at rest.

So that means that the sound card has to interpret each of the signed 16-bit values and determine what kind of electrical signal it should output to the speakers to get the desired effect (sound). A sample with the highest signed 16-bit value (32,767) tells the sound card to produce its most powerful signal.

Now, in a laptop, the sound card and speakers are chosen by the manufacturer. Different sound cards can produce varying amounts of output power, and different speakers can handle varying amounts of input power. Obviously the speakers need to be chosen such that the sound card cannot produce more power than the speakers are rated to handle. (It sounds like Dell made a design error here.)

If the sound card and speaker choice is such that the speakers cannot handle the sound card's output power, then any audio software that produces signed 16 bit samples above some threshold (let's say 32,000) could damage the speakers.

So what audio software could produce such large amplitudes? ANY SOFTWARE AT ALL. Not just VLC. I could create a .wav file that was just a bunch of loud noise with amplitudes above 32,000, and it would destroy your speakers.

In fact, most well-mixed sound files will have at least one sample at the maximum amplitude. This is called normalization -- to provide the highest fidelity sound, you want to use the entire dynamic range of the PCM sound format, and thus ideally the loudest bit of the track should be exactly at 32,767. Lots of modern music uses a technique called compression ("dynamic compression," not to be confused with data compression) to make good use of the full dynamic range of PCM, which results in LOTS of samples at or near the maximum level.

On a correctly designed audio system, this is great! You get to hear audio with the fullest dynamic range that your equipment can produce. If your system has been designed incorrectly, though, you'll blow out your speakers. But that could happen due to ANY SOFTWARE AT ALL, not just VLC.

If you really want to buy crappy Dell hardware and not blow out the incorrectly designed audio system, you should permanently decrease your global Windows volume level. That will put a hard cap on the PCM amplitude levels sent to the sound card, and thus will cap how much power is sent to the speakers.

Blame Dell. VLC has exactly nothing to do with your problems. The "volume above 100%" feature is not dangerous on a properly designed audio system (like 99.99% of computers out there).



It is not that simple. The speaker is a dynamic system whose response to signals is not memoryless. A speaker that can easily handle a pure 4kHz tone at the maximum amplitude cannot necessarily also handle a 4kHz square wave at the maximum amplitude (a square wave distributes much of its power into harmonics). It is well known that you can destroy speakers just as easily by overdriving the output stage of the power amplifier (which leads to clipping) than by overdriving the speakers themselves.

Of course, Dell could include analogue filtering circuitry to filter out the excess power in inaudible frequencies if they wanted to.


>Of course, Dell could include analogue filtering circuitry to filter out the excess power in inaudible frequencies if they wanted to.

It likely isn't necessary as it is probably built into the output amplifier. I have no clue what audio amplifier dell used but here is an example of a typical headphone amplifier IC http://www.ti.com/lit/ds/symlink/lm4881.pdf

If you look on page 9 of the datasheet you'll see its frequency response. The attenuation is > -20dB past 15kHz at best. You aren't going to get much of a square wave above 1.5 kHz, and probably not below if you look at the response of the speaker.


The lack of response of the speaker is the problem. If the power at those frequencies isn't being efficiently converted into sound, it's being converted into heat instead.


But those frequencies don't get to the speaker 'cause the amplifier doesn't send them...


I do blame Dell for my blown speakers. I also do like VLC's feature to boost audio in quiet movies. What I don't like is is the sound of digital clipping, how VLC makes it easy to clip, and how VLC remembers these terrible settings.


It's exactly as easy to decrease VLC's audio level back to normal as it is to increase it.

Anyway if you don't like it remembering the last audio level, go to Tools > Preferences > Audio, check the "Always reset audio start level to" box, and set it to 100%. Voila!


No, VLC should remember the last audio level, just not when it's over 100%. If I leave it at 50%. On next restart it should be 50%. If I'm watching a movie and finish on 200%, on next restart it should be 100%.

Clipping sucks. VLC shouldn't remember these options unless the user changes an optional setting.


I have to be honest, setting "do not remember audio" sounds like a decent compromise between not getting anything that you want and getting exactly what you want. It is especially appealing since you get VLC and this compromise solution for free. However if you are still not satisfied:

  $ git clone git://git.videolan.org/vlc.git
  $ cd vlc
  $ ack-grep -r  resetVolumeCheckbox ./
  $ emacs modules/gui/qt4/components/simple_preferences.cpp 
  $ git format-patch -o patches origin
  $ git send-email --to vlc-devel@videolan.org patches


Jeez, start VLC with an alias if it bothers you that much.


While any software that accesses an audio interface using integer formats, VLC is to my knowledge the only average user-oriented program that can end up in such situations.

I would suggest VLC disables this feature for new installs and move it to an easily discoverable preference.

Or if they really care enough to allow their users to boost the volume levels of quiet movies to replace the gain multiplication with a proper dynamic range compressor activated when the volume goes above 100%.


If Dell isn't going to honor the warranty if I listen to my favorite square-wave music, they should state "ONLY SINE WAVES ALLOWED" clearly in the advertising material.


Well physically speaking, sine waves ARE the only thing you can put through dell speakers, or any speakers.

Dell would have to set an upper limit on the wave superposition, or set a top frequency.


> VLC is to my knowledge the only average user-oriented program that can end up in such situations

Windows Media Player, Firefox, iTunes, ...

VLC makes it easier (you can boost a quiet song or movie until it fills the OS-defined dynamic range) but a loud song in any other piece of music playing software would have the same effect. Depending on the genres of music you listen to, it's not uncommon to come across songs that have been boosted until they clip.

As for hiding the option in preferences, volume boosting is one of VLC's key value propositions to laypeople (in my experience). Making it undiscoverable would be a disaster. Maybe add a 1-off warning dialog for users on Dell computers?


>Windows Media Player, Firefox, iTunes, ...

None of these drive the signal to digital clipping.


Yes they can if you play the right "music".


Actually it's not that a simple matter as simple output voltage clipping. Most audio amplifiers are AC coupled and only the AC parts of a signal actually carry power. So it would be perfectly possible to have a sine signal with its samples all between 32000 and 32767 that would do no damage at all to the speakers, because the AC power it carries is low (-38.63dB(FS) to be specific in your case).

But it's not just the total AC power that matters, it's also the power density that matters. So for example a sine has a very high power density (in fact if you do the math, the power density for a pure sine is infinite). This is turn means, that whatever resonances the system has, that overlap with the frequency of the sine, they will get excited and can resonate toward mechanical breakdown (damaged speaker). A low power density signal, like noise, where the total output power is spread over the whole spectrum (or the spectral response of the system in question) and below the maximum rated power of the speaker is much less likely to do damage.

Now we have to look at clipping. Analog clipping is not just some random noise, it's in fact a harmonic distortion. And as such it can redistribute the power in the spectrum. And digital clipping actually causes an integer overflow, which in fact adds further power to the signal.

But it goes further: The output of a DAC is a voltage. A voltage by itself does not carry power, you need an amplifier to do that. So the first step after the DAC and after the reconstruction filter (which also acts as a DC block) is a transimpedance amplifier that turns the voltage into a power signal; what this means is, that for a signal of a certain power that's going into a certain load it gives rise to a specific RMS voltage on the load terminals. In audio the reference power level is usually 0dB(m), i.e. 1mW – on the typical load impedance of 1kOhm this corresponds to a RMS voltage of 1V at the load (and higher voltage at higher impedance, lower voltage on lower impedance loads).

In a perfect amplifier the impedance is independent from the input signal and its output load. In a real amplifier though the impedance can vary depending on the signal and the output load. And the impedance usually also depends on the frequency of the signal.The effect is, that an amplifier introduces further harmonic distortions, if the signal puts too much power onto its input. If this happens in the preamplifier stage this can drive an output stage outside the specifications of the connected loads.

You see, because distortion happens mostly if you drive an amplifier close to it's maximum capabilities the usual approach is to design the amplifier some comfortable margin to the needs for the connected load; typically you use a margin around 6dB, so for a 6W load you'd choose a 12W amplifier, so that no matter what input signal the amp gets, the total harmonic distortion stays within safe limits. To protect the load you then choose the amplification factor so, that for a reference power input signal the output power is lower than or equal to the power for which the load is rated.

Now say, you're a cheapskate engineer, maybe with little analogue electronic design experience. So you see your speakers have a maximum rating of 6W. So you do a parametric search and come up with amplifier ICs from the usual suspects (Maxim, TI, ST); they're rated a 5W, 10W, 15W...; obviously cannot drive those 6W speakers at maximum power (it will badly distort), but 10W should do the trick, right?

Well, now, because you forgot the total harmonic distortion: Which means that if you raise the input signal power by 6dB (i.e. double the power) the output of an amplifier may rise well over 6dB. So lets say you had first a signal output power of 2.5W for a -6dB(FS) signal, then you raise it to 0dB(FS) (which would be your volume slider in the control applet at 100%), theoretically the output signal should now be 5W. But because of the underrated amplifier the output distorts and the actual power going into the load rises well above their maximum 6W rating.

TL:DR; Dell did mess up their amplifier design, but not by overrating the amplifier, but by underrating it. If they had chosen a properly rated with margin (so that THD stays low) amplifier and chosen the gain so that a 0dB(m) line signal would have produced 6W output power (about 15dB gain) the speakers would have been safe.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: