aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cubeb_mixer.h
diff options
context:
space:
mode:
authorPaul Adenot <[email protected]>2017-04-25 15:02:32 +0200
committerGitHub <[email protected]>2017-04-25 15:02:32 +0200
commitaf965ff7bcafa9c4b1f79a2a297c72d763a77125 (patch)
tree726d490525eb117709529b3d1c1997380b4abdc0 /src/cubeb_mixer.h
parente5e8e812cd369018318ac282006cc3182b549a08 (diff)
downloadcubeb-af965ff7bcafa9c4b1f79a2a297c72d763a77125.tar.gz
cubeb-af965ff7bcafa9c4b1f79a2a297c72d763a77125.zip
Make cubeb work with high channel count devices (#288)
* Bail if the device has too many channels. If the device on the host where we're trying to open an audio stream has too many channels, just bail instead of trashing the memory in the loop just below. * Allow using audio output devices that have up to 256 channels. In particular, this allows using sound cards that have more than 8 channels (7.1), for musical purposes, and allows using the 64 output channels of SoundFlower, for testing and also advanced musical use-cases. If we are in a topology that has more than 8 channels, the other channels are considered unmapped, i.e. it's just a channel without a specific speaker assignation. This is useful for custom setups, such as wave field synthesis, or other creative applications. * Address chunmin and achronop comments.
Diffstat (limited to 'src/cubeb_mixer.h')
-rw-r--r--src/cubeb_mixer.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cubeb_mixer.h b/src/cubeb_mixer.h
index e9eab59..9b6d8c7 100644
--- a/src/cubeb_mixer.h
+++ b/src/cubeb_mixer.h
@@ -27,7 +27,8 @@ typedef enum {
CHANNEL_RCENTER,
CHANNEL_RRS,
CHANNEL_LFE,
- CHANNEL_MAX // Max number of supported channels.
+ CHANNEL_UNMAPPED,
+ CHANNEL_MAX = 256 // Max number of supported channels.
} cubeb_channel;
static cubeb_channel const CHANNEL_INDEX_TO_ORDER[CUBEB_LAYOUT_MAX][CHANNEL_MAX] = {
@@ -50,6 +51,8 @@ static cubeb_channel const CHANNEL_INDEX_TO_ORDER[CUBEB_LAYOUT_MAX][CHANNEL_MAX]
{ CHANNEL_LEFT, CHANNEL_RIGHT, CHANNEL_CENTER, CHANNEL_LFE, CHANNEL_LS, CHANNEL_RS }, // 3F2_LFE
{ CHANNEL_LEFT, CHANNEL_RIGHT, CHANNEL_CENTER, CHANNEL_LFE, CHANNEL_RCENTER, CHANNEL_LS, CHANNEL_RS }, // 3F3R_LFE
{ CHANNEL_LEFT, CHANNEL_RIGHT, CHANNEL_CENTER, CHANNEL_LFE, CHANNEL_RLS, CHANNEL_RRS, CHANNEL_LS, CHANNEL_RS } // 3F4_LFE
+ // When more channels are present, the stream is considered unmapped to a
+ // particular speaker set.
};
typedef struct {