I see a lot of confusion about getting the best audio from your gaming console, so wanted to clear up the different considerations needed when shopping for a bar. But I do want to warn you, this guide is about getting the best audio out of gaming, which will require a higher end bar; both Xbox, PCs, and Playstation have lower quality surround options that will work with many lower end bars. And all systems offer stereo as the non-surround option that will work with any bar. This is not a guide to media consumption (discs, streaming) on these platforms, although generally its the same advice.
First Consideration: Audio Types:
First we need to understand the types of audio you can get from systems and their quality.
Playstation 4/5:
Best: LPCM (Uncompressed surround sound)
Second: DTS (Compressed surround sound).
Last: Dolby Digital (Compressed surround sound that often has a slight delay).
Xbox and PC:
Best: ATMOS MAT (Uncompressed Atmos surround sound)
Second: LPCM (Uncompressed surround sound)
Third: DTS (Compressed surround sound).
Last: Dolby Digital (Compressed surround sound that often has a slight delay).
Nintendo Switch:
Soundbars are pretty notorious for skipping out of audio codec support, 5.1 LPCM support is pretty rare in soundbars but most of the higher end bars do support it. DTS is also another format that is losing support from both TV and bar manufacturers. Dolby is generally supported universally, however the process of encoding Dolby on the system is slow and can lead to a ~100ms or so delay in the audio leaving the system, meaning the audio will lag, this is unfixable. This isn't a huge deal at 30fps gaming on an older tv, but becomes noticeable at 60fps and now even more so at 120fps, especially on the newer low latency TVs. So making sure you shop for formats is important, read lots of people here who got a bar that only supports Dolby and have to drop to stereo to avoid the lag.
Second Consideration: Connection Types:
The type of connection from the TV to the bar dictates what type of audio you can get, usually theres four ways to setup audio between tv and the bar (your tv must support it too):
IF YOU WANT HDMI 2.1 Video Features (4k/120): HDMI eARC: As of today, there are ZERO soundbars that pass HDMI 2.1 video; both Klipsch and Sony have announced HDMI 2.1 passthrough soundbars, the Klipsch Cinema 1200 and Sony HT-A9 and Sony HT-A7000 which are releasing this year, but they are not available as of this update. The ONLY way to currently get highest quality video (HDMI 2.1's: 4k/120) and highest quality sound (LPCM or ATMOS MAT) is to use eARC. Normal ARC and Optical will not pass uncompressed surround sound.
Best tied (non-HDMI 2.1): HDMI eARC: plug system's HDMI into tv and use eARC to pass all audio untouched to the bar; supports passing all audio types. Your TV must support eARC (generally 2019 or newer TVs) and must also support passing audio formats via eARC (example: LG CX does not pass DTS, and it was almost a year before the C9 could pass LPCM, but does now, so having eARC alone doesnt mean its supported).
Best tied (non-HDMI 2.1): Direct input : plug the system into the soundbar and pass video to TV; supports all audio types. Video passthrough on bars can be limited as well, some bars cannot pass 4k, others cannot pass HDR. Generally bars that can pass all of HDMI 2.0 are advertised as supporting Dolby Vision or HDR10+.
Third: HDMI ARC: plug system into tv and pass compressed audio to the bar; only can support LPCM in stereo, will pass DTS and Dolby surround (plus compressed atmos from streaming apps, but not lossless TrueHD/DTS-MA audio from UHD discs). Again, TV's need to support this.
Last: Optical Cable: plug system into tv and pass compressed audio to the bar; only can support LPCM in stereo, will pass DTS and Dolby surround (no compressed atmos from streaming apps).
TL;DR: Want HDMI 2.1 Features? You need either 8k passthrough OR eARC and LPCM support, and optionally ATMOS for Xbox/PC.
TL:DR: For HDMI 2.0 Consoles/TVs: You need either eARC (links above) or direct inputs; and LPCM support (optionally ATMOS for Xbox/PC)
*Updated July 22, 2021 to include newly announced HDMI 2.1 devices from Klipsch and Sony.