6

Is there any way to configure the Pi3's audio jack to automatically produce balanced mono output? i.e. act as a "balanced mono jack" as described here, where the regular sound wave is on one channel, and an equal-but-opposite signal is on the other channel?

I'm currently using this mono amplifier to power a small speaker from the Pi. Since it's mono, I have its "In+" pin wired to the Pi's right audio channel, and I leave the left channel wire disconnected. However, I'm experiencing a lot of ground noise. Even with no sound actively being played, the speaker emit what seems like white noise, which seems to increase with pops and periodic pulses when the Pi is under load.

The amplifier supports a "In-" pin for cancelling out this noise by using an inverted signal, so I'm trying to see if I can convert the jack's output to produce this signal. However, I'm not sure how to do that, short of creating some sort of middleware audio system that accepts normal dual-channel wav data, merges into one channel, then produces the inverted signal and places that on the opposite channel, and then sends that to the actual sound server to play.

Has this been done before? Are there easier ways to reduce ground noise on the speaker?

Edit: A user asked a similar question, but involving input, with converting an unbalanced stereo input to a balanced mono input, and was presented with a potential solution through an ALSA configuration. I'm not well-versed in ALSA configs, but would something similar be possible with output?

Cerin
  • 2,291
  • 8
  • 33
  • 49

3 Answers3

3

Sadly, I don't think this is going to work the way you think it's going to work.

Balanced cabling is effective at minimising noise induced along the length of the cable. If there's an almighty tsunami of white noise produced by the source (here, a Pi's 3.5mm audio output), a balanced cable will endeavour to transmit that noise faithfully from source to destination without introducing further noise itself. Balanced cabling isn't a noise removal strategy, it's a noise prevention strategy.

The Pi's 3.5mm audio output is an abomination, and appears to reproduce every glitch, crackle and hum possible. It should be avoided if there's any other feasible option. Whenever I've had to get audio out of a Pi in the past I've ended up using a cheap adapter into its HDMI output. This still isn't perfect, but it's a lot cleaner than the 3.5mm jack.

goobering
  • 10,750
  • 4
  • 40
  • 64
3

Exactly the same device definition works for playback:

pcm.fake_balanced {
    type route
    slave.pcm "hw:0"    # or whatever
    ttable [ [ 1 -1 ] ]
}

Put it into your ~/.asoundrc or into the global /etc/asound.conf, and use the device name fake_balanced to play mono sounds:

aplay -D fake_balanced some_mono_file.wav

(Use plug:fake_balanced to automatically convert sample formats not supported by the hardware.)

CL.
  • 571
  • 5
  • 9
1

run alsamixer. type F6 and select your soundcard. select the tabsheet "DAC Mono" and turn stereo to mono.This will produce mixed mono on both channels.

bbd 666
  • 109
  • 6