diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-07-22 21:27:47 +0200 |
|---|---|---|
| committer | cah <cah@ableton.com> | 2024-07-23 21:02:26 +0200 |
| commit | 36798b7f1ba93fa2fa8a153e2db122a593ff4a61 (patch) | |
| tree | 2b0e58bc408f141907455809b156ef8c6975d72d /RtAudio.cpp | |
| parent | 2bccd50959a73f3145abb36183b5b5ae866c1a46 (diff) | |
Hack pulseaudio channel map for 5.1 DCPs to see if it fixes multi-channel playback on Linux.
Diffstat (limited to 'RtAudio.cpp')
| -rw-r--r-- | RtAudio.cpp | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/RtAudio.cpp b/RtAudio.cpp index d17870d..1335a6b 100644 --- a/RtAudio.cpp +++ b/RtAudio.cpp @@ -9546,8 +9546,39 @@ bool RtApiPulse::probeDeviceOpen( unsigned int deviceId, StreamMode mode, attr_ptr = nullptr; } + /* XXX: hard-coded for DCP-o-matic */ + pa_channel_map map; + pa_channel_map_init(&map); + /* XXX: need to check 7.1 */ + map.channels = channels; + + if (channels > 0) { + map.map[0] = PA_CHANNEL_POSITION_FRONT_LEFT; + } + if (channels > 1) { + map.map[1] = PA_CHANNEL_POSITION_FRONT_RIGHT; + } + if (channels > 2) { + map.map[2] = PA_CHANNEL_POSITION_FRONT_CENTER; + } + if (channels > 3) { + map.map[3] = PA_CHANNEL_POSITION_LFE; + } + if (channels > 4) { + map.map[4] = PA_CHANNEL_POSITION_REAR_LEFT; + } + if (channels > 5) { + map.map[5] = PA_CHANNEL_POSITION_REAR_RIGHT; + } + if (channels > 6) { + map.map[6] = PA_CHANNEL_POSITION_SIDE_LEFT; + } + if (channels > 7) { + map.map[7] = PA_CHANNEL_POSITION_SIDE_RIGHT; + } + pah->s_play = pa_simple_new( NULL, streamName.c_str(), PA_STREAM_PLAYBACK, - dev_output, "Playback", &ss, NULL, attr_ptr, &error ); + dev_output, "Playback", &ss, &map, attr_ptr, &error ); if ( !pah->s_play ) { errorText_ = "RtApiPulse::probeDeviceOpen: error connecting output to PulseAudio server."; goto error; |
