Stories
Slash Boxes
Comments

SoylentNews is people

Journal by cafebabe

(This is the 16th of many promised articles which explain an idea in isolation. It is hoped that ideas may be adapted, linked together and implemented.)

Practical problems with a speaker array:-

Cable Losses

It is reasonable to assume that a computer or media player will be ajacent to a display and therefore much of the electronics will be in front of a user. If speakers are to be placed around one or more users then speakers at the rear require longer cables. With 4 Ohm speakers and cheap cable, energy loss within cables is significant to the extent that speakers at the front will be obviously louder.

The ideal solution is to use good cables and equal length cable. However, a workaround it to attentuate the volume of the front speakers. This is a horrible bodge because it is a software fix for a hardware problem. The preferred solution is to remedy hardware first then use software to trim values if strictly necessary.

Speed Of Sound

Speakers should be triggered such that sound arrives simultaneously at a user's ears. The speed of sound is relatively slow. Therefore, speakers should be placed at identical distances from a user or some kind of compensation mechanism is required. In a domenstic environment, the latter is required. Again, this is inappropriately pushed into software. While speakers are nomimally driven in unison, speakers which are nearer to a user should use historical inputs. This creates multiple problems. Historical inputs require a circular buffer which increases memory requirements. It also incurs a level of indirection which increases processing requirements. The memory requirements also determine at maximum difference in distances. How significant is this difference?

The speed of sound is approximately 343m/s. (This varies with air pressure and humidity. Some systems take this into account.) Divide by sample frequency to obtain distance travelled at each time-step. At 48kHz, the distance is approximately 7mm. That's about 1/4". At higher frequencies, this distance is proportionately shorter.

If we assume a budget of about 16KB to implement a 1024 element circular buffer then the maximum difference between speaker distances is about 7 metres at 48kHz. (Higher sampling frequencies require a smaller range of distances or proportionately larger buffers. Other parts of the system require larger buffers and therefore the circular buffer may similarly grow in proportion.)

The inverse square energy dissipation is another reason for attentuation of speaker volume. Specifically, the nearest speakers should be driven at lower volume to compensate for differences in speaker distance. This would not be required if all speakers were at a uniform distance.

DAC Skew

A sequential program which drops data sequentially into registers may incur a small amount of signal skew. In air, this probably incurs less than 7mm of skew but it bothers me greatly. Perhaps it is because it is akin to an analog off-by-one problem.

Host Latency

A host decodes one block of audio, sends data out, decodes one frame of video and displays it. However, audio and video triple buffering may not align. Specifically, audio and video may be half a frame or more out of phase. However, with video transit over PCI Express and audio transit over USB2.0 (and contention over both), audio is likely to lag behind video. This requires audio to be sent ahead.

Host Skew

It is envisioned that audio will be played in rotation from three buffers and that, in the general case, the three buffers will be equal size. (There may be transitions where this assumption is false.) There may be jitter over a contested bus when receiving audio and therefore, one buffer should be replaced when it directly opposes the pointer for data being played. If the pointer is either side of this value, then one sample should be skipped or played twice. This is a tacky method to synchronize input because it goes completely against all of the theory about linear reproduction and fundamental frequencies. However, it works and it is computationally cheap.

Crash Or Disconnection

If buffers are not replaced in a timely manner, three buffers may be played in a tight loop of 0.12 seconds or shorter. This case should be avoided. If the host crashes or disconnects, audio should be silenced. If the micro-controller crashes, recovery is likely within a very brief period. However, occasional host polling is required. State, such as matrix multiplication constants, and buffers may require two or more frames to recover.

Errors In Data

There may be insufficient time to re-send a block of data. Blocks with obvious errors should incur silence. Blocks with minor errors may be recovered. The rate of errors and the probability of mis-classification is an emperical exercise.

 

Post Comment

Edit Comment You are not logged in. You can log in now using the convenient form below, or Create an Account, or post as Anonymous Coward.

Public Terminal

Anonymous Coward [ Create an Account ]

Use the Preview Button! Check those URLs!


Logged-in users aren't forced to preview their comments. Create an Account!

Allowed HTML
<b|i|p|br|a|ol|ul|li|dl|dt|dd|em|strong|tt|blockquote|div|ecode|quote|sup|sub|abbr|sarc|sarcasm|user|spoiler|del>

URLs
<URL:http://example.com/> will auto-link a URL

Important Stuff

  • Please try to keep posts on topic.
  • Try to reply to other people's comments instead of starting new threads.
  • Read other people's messages before posting your own to avoid simply duplicating what has already been said.
  • Use a clear subject that describes what your message is about.
  • Offtopic, Inflammatory, Inappropriate, Illegal, or Offensive comments might be moderated. (You can read everything, even moderated posts, by adjusting your threshold on the User Preferences Page)
  • If you want replies to your comments sent to you, consider logging in or creating an account.

If you are having a problem with accounts or comment posting, please yell for help.