
Show HN: LCC – Open-Source Spatial Audio from Stereo Speakers - roblkw-asu
https://github.com/MeteorStudioASU/lcc/
======
roblkw-asu
A lightweight implementation of real-time crosstalk cancellation

------
L2iL
Three great project ideas for LCC:

1\. Apply LCC to rear channel speakers to get it running on 4.0 channel
systems. The rear channel speaker distance can be digitally positioned with an
integrated millisecond delay control, which allows a user’s rear channels to
be digitally placed at various perceived physical distances if there is no way
to move rear speakers back physically (the speed of sound is roughly 1100
ft./second (depending on temperature and elevation); so, for example, if a
user has a rear head to speaker (H2S) distance of 2’0", when the frontal H2S
is 6’0", it may be desirable to delay the rear speakers by say 5’0" to avoid
erroneous localization to the rear). The system calculates this optimizing
distance, e.g., 5'0"/1100 = ~.0045 seconds or ~4.5 milliseconds, and thus
allows the user to experience the rear channel speakers optimally as if they
were at ~7’0" and not where they are physically located at 2’0". Could also
use a 4.0 Bluetooth speaker setup for your VR system. Better than headphones,
as you now use your own natural HRTFs in a free field space. Also, headphones
cause fatigue and contribute to disorientation. If that is of interest to you,
taking it one step further with head tracking would require additional access
to LCC's parameters.

2\. Rearrange car speakers (see white papers for guidance on placement
requirements) and apply LCC to the driver and each passenger. Not only a great
idea from an entertainment point of view but also as an auditory safety
function as well.

3\. Get LCC into a [https://www.hifiberry.com](https://www.hifiberry.com) and
purify your home theater's sound system with the most effective spatial audio
solution available.

~~~
L2iL
Bonus project idea: Get LCC to work on horizontal speaker array sound
emitters, e.g., soundbars with multiple speakers for each channel. You may
need to apply LCC to each driver and adjust LCC parameters accordingly.
Another variant is to build your own horizontal speaker array sound emitter
that is steerable, e.g., use computer vision to track many heads in a room and
send a L/R LCC image to each listener using beam forming speakers. Multiple
sweet spots!

------
stereo
This really sounds quite cool! It sounds like entering/exiting a bubble in
front of my MacBook when I turn it.

If, like me, you didn't turn the sound up enough, you can switch back to
'Internal Speakers', then raise the volume, then back to 'Soundflower (2ch)'.

~~~
L2iL
You got that right!

Thank you.

------
wfn
Will give this a shot later on, thanks for sharing :)

Any plans to make this work on other systems? RtAudio which you use here
appears to also support Linux and Windows.

~~~
roblkw-asu
Yeah, I'll plan to toy with this on Windows over the weekend.

------
CSSer
Is there any way to know if macOS is doing something like this natively
already? I ask because my late 2019 16 in. MPB has ridiculously amazing
speakers for its size and format. I’ve always wondered if it was more than
just the hardware.

~~~
nitrogen
I don't know what the Macbook does, but I do know that simply equalizing even
a cheap speaker to match a target response curve produces astonishing results.
I once used $$$$ audio hardware with many parametric filters to calibrate the
tinny, resonating built-in speakers in an old LCD monitor. It sounded
fantastic.

~~~
L2iL
Yes. Apple has added cross-talk cancelation to their macOS devices; albeit,
not as wide or flat as ours. See here: [http://patft.uspto.gov/netacgi/nph-
Parser?Sect1=PTO2&Sect2=H...](http://patft.uspto.gov/netacgi/nph-
Parser?Sect1=PTO2&Sect2=HITOFF&p=1&u=/netahtml/PTO/search-
bool.html&r=1&f=G&l=50&co1=AND&d=PTXT&s1=10524080&OS=10524080&RS=10524080).
Funny, we chatted with them ~1 year before they filed...

~~~
CSSer
Fascinating. Thank you for doing the leg work here! I never would've thought
to check patents.

~~~
L2iL
Also, unlike with LCC, Apple's implementation does not route through the
output. So, you cannot correct for crosstalk with it to external speaker
units.

------
haarts
For a layman: what does this do? How is this useful for me?

~~~
si1entstill
It attempts to makes the left ear only hear what is coming out of the left
channel and the right ear only hear what is coming out of the right - as if
you are using headphones. Normally with speakers, both ears are going to hear
both.

~~~
nijaru
Exactly this. One example would be the difference in how pronounced reverb and
delay effects are on headphones versus most speaker setups. Each ear is much
more isolated, so the separate audio tracks for each ear don’t blend.

------
L2iL
Curated playlist to run through LCC:
[https://open.spotify.com/playlist/0XrqQ8tIVGMKuVIC5mIrNN?si=...](https://open.spotify.com/playlist/0XrqQ8tIVGMKuVIC5mIrNN?si=lTEax4fiQ3GwX73XpYHJBQ)

Curated videos (worth finding higher quality versions) to test LCC out with:
[https://www.youtube.com/playlist?list=PL-
lzMEaJTl3p39jZC0iSD...](https://www.youtube.com/playlist?list=PL-
lzMEaJTl3p39jZC0iSDzr_RxTCY2Wvy)

------
wigl
Wish I still had a mac. I remember Bang and Olufsen doing some spatial audio
research a few years back:

[https://www.en.tech.aau.dk/news-events/news/new-lab-
mimics-t...](https://www.en.tech.aau.dk/news-events/news/new-lab-mimics-the-
sound-of-any-room.cid285484)

It's nice to see it being rolled out into their products too!

------
odomojuli
For anyone having difficulty installing Soundflower, I used:

[https://github.com/ExistentialAudio/BlackHole](https://github.com/ExistentialAudio/BlackHole)

It works exactly the same.

------
audioperson
Would lcc work with ambisonic audio?

~~~
L2iL
If you are referring to the ambisonic recording technique to capture audio
content, we generally do not recommend these methodologies. We prefer binaural
microphones with removed pinnae, the Schoeps ORTF-3D, and the Blumlein
technique. The short answer is that ambisonic audio will playback better with
LCC than it will over other systems, e.g., stereo.

------
aidenn0
Is there a good open-source tool to convert multichannel audio to binaural?
That, combined with LCC, would be nice for watching movies on my desktop
setup.

~~~
L2iL
That does not sound like it will end well.

That said, LCC is only concerned in solving psychoacoustic playback issues for
loudspeakers.

~~~
roblkw-asu
Actually, we've been using Resonance Audio to convert fully spatialized sound
in game engines to binaural and then pumping that through LCC. That seems to
work well as a pipeline.

~~~
L2iL
Rob and I going back-and-forth. :)

Not sure we tried this with channel-based audio though...

Prerecorded material not recorded binaurally is not binaural content. I am a
purest though. Note: LCC enables all loudspeaker listening experiences to be
experienced binaurally, in the free field, acoustically speaking, regardless
of the content (unless it is mono content).

~~~
aidenn0
Surely you could simulate a theater with N speakers, then convert that to
binaural. It would be nice if Blu-ray had spatial audio, but it has channels,
so I work with what I got.

------
fulafel
Nice work. Does it use some kind of audio abstraction layer so ports to non
Mac platforms might be easy?

~~~
roblkw-asu
Yeah, RtAudio. So it should be easy to port it to Windows and Linux. I'll work
on that soon, hopefully this weekend.

~~~
dithered_djinn
It already compiles on Linux without any modifications whatsoever:

    
    
      g++ -O2 -march=native -mtune=native -D__LINUX_PULSE__ -D__LINUX_ALSA__ -D__UNIX_JACK__ \
          lcc_rtaudio.cpp RtAudio.cpp -o lcc -pthread -ljack -lasound  -lpulse-simple -lpulse
    

The above will give you a binary with the Jack, ALSA and PulseAudio backends
baked in.

~~~
dithered_djinn
[https://github.com/MeteorStudioASU/lcc/pull/5](https://github.com/MeteorStudioASU/lcc/pull/5)

------
yodaarjun
Just tried it out. It's really good Would love to see how you build this out!

------
ngcc_hk
Wonder whether two home pod would do the same?

~~~
L2iL
Maybe. If not, space them close apart and use with LCC!

