# Presentation: 542639

## Advanced Audio Tutorial: Part 3Speakers, Codecs, And the Rest

## Quality Challenges

- Echo Canceller

- Echo Canceller

- Echo Canceller

- Mixer

- Network Audio
- Codec / Computer

## Room speakers

- (Easiest part)
- Several equipment choices
- Professional loudspeakers (Genelec, etc)
- Consumer stereo receiver
- Surround sound system
- Preinstalled audio system

## Professional-quality Loudspeakers

- Very good audio quality
- Speech-optimized models available (e.g. JBL Venue series)
- Self-amplified models available (e.g. Genelec monitors)
- Balanced inputs
- Pair of Genelecs easily filled large hotel ballroom
- Non-amplified speakers require external amplifier
- XAP400 & AP400 have internal 10W amp
- No easy-to-munge settings
- System stays as it was configured and tested

## Consumer Stereo System

- Potentially less expensive
- Unbalanced inputs
- Custom cable or level balancing device required
- Potentially confusing
- Non-obvious input needs to be used (CD means AG)
- Easy to get in a state where settings different from those configured during setup (someone turned the radio on and adjusted the volume)

## Surround sound system

- Similar to consumer stereo
- Actual surround processing can confuse echo cancellation
- Usually must disable
- Disabling may disable multiple speaker (>2) output
- Advantage is widespread sound with the multiple speakers
- Beware potential phase-related comb filtering effects

## Preinstalled Audio System

- Auditorium, hotel meeting room, etc.
- (SC Global)
- Issues include
- Proper connectors for patching to house sound system
- Interfacing with the local A/V engineering staff
- Overhead speakers in use
- Beware PCC/PZM microphones! Feedback risk with local reinforcement
- Potential for very good sound with a high-quality installed system
- Acoustic engineers have designed reproduction system for the specifics of the space

## Quality Challenges

- Echo Canceller

- Echo Canceller

- Echo Canceller

- Mixer

- Network Audio
- Codec / Computer

## Audio capture computer

- General-purpose computer with one or more audio hardware codecs
- PCI adapter
- Onboard
- USB adapter
- Software-based encoding, packetization, network transmission

## Audio Hardware Codecs

- Currently use commodity PC audio cards
- Creative Ensoniq AudioPCI
- Cheap! $30
- Good quality
- Multiple inputs require multiple cards
- And slots
- Future: pro audio cards
- Midiman Delta: 4 or 6 or 10 I/O
- Single PCI slot
- Balanced audio connector (no MM100)
- Digital I/O available (digital direct to/from Gentner matrix??)
- Or USB devices (haven’t tested here yet)

## PC audio cards

- Internal input mixer feeds A/D converter
- D/A converter feeds internal output mixer
- Level adjustment for output has two controls: PCM level (output of D/A) and main output level (all sources)
- Input has one or two controls, depending on card
- Different cards may have different mixer semantics
- Rat tries to accommodate this
- Implications
- Possible (easy) to cause local feedback with looped back line in to line out audio path
- Possible (easy) to cause remote echo with looped back digital output to digital input path
- Output level depends on two separate settings

## Sampling

- Sampling rates affect sound quality
- CD audio 44kHz
- Standard AG audio 16 kHz
- Telco audio 8 kHz
- Nyquist says highest frequency representable is half the sampling rate
- 16 kHz sampling gets us 8kHz audio resolution
- Generally good enough for speech

## Some numbers

|  | Sample rate
(kHz) | Bandwidth
(Kbps) |
| --- | --- | --- |
| Standard AG audio (uncompressed) | 16 | 256 |
| 8 kHz GSM | 8 | 13 |
| CD audio (uncompressed) | 44 | 704 |
| CD audio (G726-16 ADPCM) | 48 | 96 |

## Sampling rate tradeoffs

- Compression
- Lowers bandwidth requirement
- Raises CPU use
- Possible increase in sensitivity to packet loss
- Stability of software?
- Higher rates
- Better quality
- But audible better quality? (Speech range tops out 10-12 kHz)

## Audio card, type 1

- Mic

- Line

- in

- Vol

- Vol

- Input

- Mixer

- D/A

- Output

- Vol

- Line

- out

- Output

- Mixer

- A/D

- Input

- Mute

- Mute

- Mute

- Mute

- Mute

- Mute

## Audio card, type 2

## Default commonly wrong

## PC card microphone connections(digression)

|  | Soundblaster | Ensoniq soundscape, audiotrix, some others |
| --- | --- | --- |
| Input type | Unbalanced low impedance | Unbalanced low impedance |
| Input sensitivity | Approx. -20dBV (100mV or 0.1Volt) | Approx. -50dBV (3mV or 0.003Volt) |
| Input Impedance | 600 to 1500 (Ohms) | <600 (Ohms) |
| Input wiring | Audio on Tip, Ground on Sleeve, 5Volts DC Bias on Ring | Audio on the Tip, Ground on the Sleeve, DC Bias not supplied |

- http://www.shure.com/support/technotes/apps-shurecomputer.html

## For the EE geek

## Cabling

- Standard PC audio cards use 1/8” stereo miniplug connections
- Unbalanced
- Standard 1/8” to dual RCA works great
- To plug into bal/unbal conversion box
- (Stereo? Discussed in a bit)
- For mono setups, for capture to work properly sometimes a L/R swap required on the line-in side

## Pro-audio cards

- Multiple high-quality inputs and outputs
- Balanced I/O
- Typically 24-bit 96 kHz sampling
- What would we do with these?
- Network audio stream per microphone (use EC device for gain adjust & cancel, route each mic to its own output)
- Advanced signal processing
- Localization
- Beamforming

## Quality Challenges

- Echo Canceller

- Echo Canceller

- Echo Canceller

- Mixer

- Network Audio
- Codec / Computer

## Network quality

- We’ll address this more in the network part of the tutorial

## Overall System Issues

- We’ve addressed the individual components, now on to system-level issues
- Variations in audio system configuration
- Level balancing
- Runtime level control

## Other System Requirements

- Hear audio from the display computer
- Record audio to the display computer
- Stereo output from codec
- Stereo output from display computer
- Attach other audio devices (DVD, VCR, etc)
- Bridge in an H.323 codec

## Attaching the Display Computer

- Cable display computer audio card to the Gentner in the same manner as the audio capture computer (using extra inputs & outputs)
- Configure matrix .. options include:
- All audio (network & local mic) to display
- Display to network and local
- Subsets of these
- Depending on what you actually want

## Stereo

- Especially when attaching display computer or VCR, might want stereo
- Requires cabling changes: L and R speakers get separate matrix outputs
- While we’re doing this, can attach audio computer using stereo connection as well
- (Support stereo capture software if it becomes available)

## Using XAP processing blocks

- Unlike AP, XAP has no separate subbus
- Instead, use a processing block without any processing defined
- Compression
- Limit output to speakers to a given level
- Limit input from external devices or microphones to a given level
- Filtering
- High-pass filters to remove rumble
- Notch filters to remove specific frequency background noise

## Matrix for all of this	

- Stereo connections to and from display and audio computer
- Microphones aggregated into microphone bus
- All output routed through an output compressor
- Configured for Telco bridging (telco hears all local & remote & display audio, local & network & display audio sent to telco)

## Filter

- Highpass filter, threshold about 300 Hz
- Notch filter at 2000 Hz

## Compressor

- Limit output to 0 dBu
- Otherwise, pass input to output unmodified
- Good for clipping loud transients (dropped mic, badly misconfigured site, etc)

## Level Balancing: the Problem

- Local audio settings differ
- Different microphones
- Different room setup / acoustics
- Different Gentner / PC mixer settings
- But, we want consistent levels from site to site
- Solution: well-defined common audio levels

## System Audio Levels

- Source room: dB SPL at microphone
- Voltage on wire (dBu)
- Level within Gentner matrix (dBu)
- (Verified with voltmeter that Gentner values match on-the-wire values)
- Voltage on wire into capture machine
- via MM100 level matcher
- Level within PC audio mixer

## Mode Transitions

- Each transition implemented by a transducer of some sort
- Microphone
- Amplifier
- A/D converter
- D/A converter
- Speaker
- Each state transition is accompanied by a knob that changes values

## Transitions

- Air

- Mic cable

- Mic characteristics

- Gentner
- Matrix

- Gentner input gain

- Audio card
- Line in

- PC mixer level
- settings

- Digital audio
- in rat and on net

- Gentner output gain +
- MM100 levelshift

- Audio card
- Line out

- PC mixer level
- settings

- Gentner
- Matrix

- Gentner input gain +
- MM100 levelshift

- Speaker
- input

- Gentner output gain

- Air

- Speaker gain

- G

- G

- G

- G

- G

- G

- G

- G

## Too many adjustment points!

- In a stable system, there is no need to change most of them
- Pick standard reference levels in the system
- Adjust levels into and out of these reference levels
- “Common Currency”
- Strawman reference levels:
- Within Gentner matrix (0 dBu nominal)
- On the network (-10 dB FS nominal)
- In the air (25+dB over ambient noise level)

## Configuration strategy

- Configure gains into and out of common-currency regions to maintain nominal level constraints
- Within a region, gains are fixed at 0 dB (no amplification, no attenuation)

## Fixed values

- Air

- Mic cable

- Mic characteristics

- Gentner
- Matrix

- Gentner input gain

- Audio card
- Line in

- PC mixer level
- settings

- Digital audio
- in rat and on net

- Gentner output gain +
- MM100 levelshift

- Audio card
- Line out

- PC mixer level
- settings

- Gentner
- Matrix

- Gentner input gain +
- MM100 levelshift

- Speaker
- input

- Gentner output gain

- Air

- Speaker gain

- G

- G

- G

- G

- 0 dB

- 0 dB

- 0 dB

- G

## Common-currency boundary values

- Air

- Mic cable

- Mic characteristics

- Gentner
- Matrix

- Gentner input gain

- Audio card
- Line in

- PC mixer level
- settings

- Digital audio
- in rat and on net

- Gentner output gain +
- MM100 levelshift

- Audio card
- Line out

- PC mixer level
- settings

- Gentner
- Matrix

- Gentner input gain +
- MM100 levelshift

- Speaker
- input

- Gentner output gain

- Air

- Speaker gain

- C

- C

- C

- 0 dB

- 0 dB

- 0 dB

- C

- C

## So we must be done

- We’re not left with any adjustments!
- In a well-behaved room, you are indeed done (FL workshop node)
- More often, some points need dynamic adjustment
- Microphone levels, for adjusting to speakers
- Use AGC, especially in XAP or Vortex
- Overall input or output levels
- Balancing to ill-behaved situations (telco)

## Configuration procedure

- Definitions of common-currency regions and audio flow through the system allow us to define a configuration procedure:
- Inject known input level at some point in the system
- Make measurements and adjust levels to obtain proper levels

## Configuration 1: Microphones

- Configure each microphone in turn:
- Provide test signal in room.
- Person reading text
- Test signal playing from speaker at person’s location

- Monitor Gentner mic level meter
- Adjust Gentner input gain for that microphone to obtain nominal –10dB, peaking at 0dB

## Configuration 2: PC input

- Either use a person reading text, or a 0 dB test tone (XAP)
- Ensure signal sent to PC (check matrix)
- Start rat on audio capture machine

- Adjust input level so that level stays at the high part of green, peaking into yellow
- Optionally, monitor network level and adjust for good level

- Gentner
- Matrix

- Audio card
- Line in

- PC mixer level
- settings

- Digital audio
- in rat and on net

- C

- 0 dB

## Digression: PC loopback

- Defaults on opensound.com audio drivers with AC97-compliant codecs can easily generate remote echo
- Line in looped to line out
- Quick fix to try:	aumix –l 0
- If it works, make stick at boot with	/usr/lib/oss/savemixer
- Original PCI128 loopback fix in standard AG software (setup-mixer)

## Digression: netlevel

- Netlevel is a tool that listens to a multicast group and computes per-source levels
- High-water calculated as peak level in last 100 samples
- Target indicator for good high-water levels, clipping
- Currently Linux-only (gtk + libcommon)
- Love to get someone to port to Win32

## Configuration 3: PC output

- Enable rat test tone
- Monitor audio computer input level on Gentner
- Adjust rat output level for mid-level (C1)
- Bring up soundcard mixer app

- Adjust master output volume (C2) for 0dB level in Gentner matrix

- Digital audio
- in rat and on net

- Audio card
- Line out

- Gentner
- Matrix

- Gentner input gain +
- MM100 levelshift

- C2

- 0 dB

- C1

- PC mixer level
- settings

## Configuration 4: Speaker level

- Inject test tone into Gentner matrix (either rat test tone or Gentner signal generator)
- Verify output level to speakers is 0 dB

- Monitor audible level of test tone
- Listen for audio-too-loud-for-comfort
- Use SPL meter
- Adjust speaker gain for desired level
- (What level? Still open for experimentation)

- Gentner
- Matrix

- Gentner output gain

- Air

- Speaker gain

- 0 dB

- C

- Speaker
- input

## Digression: Rat Receive Level vs. Room SPL

- XAP generates Pink Noise
- Transmitted by rat
- Received by rat
- Played into Bob’s office, and measured with SPL meter

## Next steps in configuration

- At this point, audio system should be fairly well tuned end-to-end (within the node)
- Rat reflector tests for local network-audio testing and verification of sound quality
- Use of headphones for local verification
- Test drives with groups of nodes
- Verify common-currency levels on the network

## Rat reflector testing

- UCL reflector bounces packets back to source after a delay
- “See yourself as others see you”
- Start reflector on video capture machine (or other host)
- reflector 20000 20001
- Configure delay on reflector GUI
- Start rat on audio machine
- rat –allowloopback <reflector-machine>/20000
- Start transmitting audio
- Speak normally at each microphone
- Listen to generated audio, tweaking individual mic levels as necessary

## Headphones

- Can be useful to attach headphones to a Gentner output
- (Gentner can drive enough level to not require external amplifier)
- Route microphones to headphones to debug local audio problems

## Group testing

- Now that the local node is in good shape, recruit a group of AG nodes to test
- Use netlevel to verify all sending reasonable & consistent levels
- (Or elect a reference point to listen to levels from everyone)
- Round-robin speech from each site
- Sustained talking (reading something is good) to ensure no weird cancellation effects
- Sometimes gets worse over time

## Balancing telco

- For a net/telco bridge
- Target getting 0 dB into and out of telco connections
- Get someone on phone to read text for test input
- Adjust telephone input gain for –10 dB nominal, 0 dB peak
- Generate 0 dB test tone, adjust output to telco for slightly too-loud level

- For verification, get someone on network connection to read text
- Ensure common levels between network, local room, and telco
- Can be tedious to get right, especially when crosspoint matrix adjustments not available

## A better way to do telco?

- AG-telcobot
- Audio capture machine + telephone hybrid (Gentner AP10 or TH1, Lectrosonics)
- No matrix mixer, no microphones, no speakers
- Remote controlled dialing
- Balancing issues much easier: just need to adjust for telco to network, network to telco
- Doesn’t exist yet, but should be fairly straightforward to assemble

## Troubleshooting 

- General level adjustment
- One site too loud
- Echo generated
- Garbled audio

## General level setting

- Use rat talk level slider to adjust for good network transmit levels

## General level setting

- Use rat listen level slider to adjust for good local room levels (network receive)

## One site too loud

- Click on offending site’s name in rat panel
- Select “Audio” from “Category” dropdown
- Adjust gain slider for good level
- Badger site to calibrate their node

## Echo generated

- General rule: if you don’t hear the echo, you’re likely to be the one generating it
- Can use netlevel to help detect echo (echo shows up visually)
- Potential causes
- EC reference set incorrectly
- Microphones too close to speakers
- D/A  A/D hardware loopback in sound card
- Gentner matrix has audio capture PC routed to its input
- Gentner powercycle needed on rare occasions
- Gentner failure

## Garbled audio

- Local reinforcement configured improperly
- Levels too high – clipping
- Check for rat levels in the red
- Check Gentner mic meters for overly high levels
- If you hear clipping but not a lot of background noise, likely a misset Gentner output gain or a rat level setting

## Other problems??

## References

*Ballou, G. M., Ed. (1998). *_*Handbook for Sound Engineers*_*, Butterworth-Heinemann.* P1285
- _[http://www.recordingwebsite.com/articles/phase.html](http://www.recordingwebsite.com/articles/phase.html)_
- http://www.shure.com/support/technotes/app-critical.html

## Acknowledgements

- This work was supported in part by U.S. Department of Energy, under Contract W-31-109-Eng-38
- The AG community