summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-04-15 12:44:27 +0100
committercah <cah@ableton.com>2019-12-03 11:16:07 +0100
commit8459de8ca29bcf3248191f49fb06637107888722 (patch)
tree61eaa409874c3e71730ff93841b1e8fc409f8af3
parent8b9951729c312893e88dcc80f546fb531fc9928c (diff)
Hack pulseaudio channel map for 5.1 DCPs to see if it fixes multi-channel playback on Linux.
-rw-r--r--RtAudio.cpp33
1 files changed, 32 insertions, 1 deletions
diff --git a/RtAudio.cpp b/RtAudio.cpp
index bea68a8..64b1577 100644
--- a/RtAudio.cpp
+++ b/RtAudio.cpp
@@ -8974,7 +8974,38 @@ bool RtApiPulse::probeDeviceOpen( unsigned int device, StreamMode mode,
}
break;
case OUTPUT:
- pah->s_play = pa_simple_new( NULL, streamName.c_str(), PA_STREAM_PLAYBACK, NULL, "Playback", &ss, NULL, NULL, &error );
+ /* 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, NULL, "Playback", &ss, &map, NULL, &error );
if ( !pah->s_play ) {
errorText_ = "RtApiPulse::probeDeviceOpen: error connecting output to PulseAudio server.";
goto error;