]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Get different playback modes working and update the configuration sample
authorMike Brady <mikebrady@eircom.net>
Thu, 15 Sep 2016 16:43:13 +0000 (17:43 +0100)
committerMike Brady <mikebrady@eircom.net>
Thu, 15 Sep 2016 16:43:13 +0000 (17:43 +0100)
scripts/shairport-sync.conf
shairport.c

index cd7688bbac1fe39df3768a4742c47153f04d51fc..dea8ba6f3704891b924e65d64e55f95f8a1a0aec 100644 (file)
@@ -25,7 +25,7 @@ general =
 //  ignore_volume_control = "no"; // set this to "yes" if you want the volume to be at 100% no matter what the source's volume control is set to.
 //  volume_range_db = 60 ; // use this to set the range, in dB, you want between the maximum volume and the minimum volume. Range is 30 to 150 dB. Leave it commented out to use mixer's native range.
 //     regtype = "_raop._tcp"; // Use this advanced setting to set the service type and transport to be advertised by Zeroconf/Bonjour. Default is "_raop._tcp".
-//  playback_mode = "stereo"; // This can be "stereo" or "mono". Default is "stereo".
+//  playback_mode = "stereo"; // This can be "stereo", "mono", "reverse stereo", "both left" or "both right". Default is "stereo".
 //  alac_decoder = "hammerton"; // This can be "hammerton" or "apple". This advanced setting allows you to choose
 //    the original Shairport decoder by David Hammerton or the Apple Lossless Audio Codec (ALAC) decoder written by Apple.
 };
index 4fec3541d023aa195118b8b810676791b658d92e..9356ff8cbfd51adf312da59e2470944349a36212 100644 (file)
@@ -431,8 +431,14 @@ int parse_options(int argc, char **argv) {
           config.playback_mode = ST_stereo;
         else if (strcasecmp(str, "mono") == 0)
           config.playback_mode = ST_mono;
+        else if (strcasecmp(str, "reverse stereo") == 0)
+          config.playback_mode = ST_reverse_stereo;
+        else if (strcasecmp(str, "both left") == 0)
+          config.playback_mode = ST_left_only;
+        else if (strcasecmp(str, "both right") == 0)
+          config.playback_mode = ST_right_only;
         else
-          die("Invalid playback_mode choice \"%s\". It should be \"stereo\" (default) or \"mono\"");
+          die("Invalid playback_mode choice \"%s\". It should be \"stereo\" (default), \"mono\", \"reverse stereo\", \"both left\", \"both right\"");
       }
 
       /* Get the regtype -- the service type and protocol, separated by a dot. Default is
@@ -1070,11 +1076,11 @@ int main(int argc, char **argv) {
   debug(1, "drift tolerance is %f seconds.", config.tolerance);
   debug(1, "password is \"%s\".", config.password);
   debug(1, "ignore_volume_control is %d.", config.ignore_volume_control);
-  debug(1, "playback_mode is %d (0-stereo, 1-mono).", config.playback_mode);
+  debug(1, "playback_mode is %d (0-stereo, 1-mono, 1-reverse_stereo, 2-both_left, 3-both_right).", config.playback_mode);
   debug(1, "disable_synchronization is %d.", config.no_sync);
   debug(1, "use_mmap_if_available is %d.", config.no_mmap ? 0 : 1);
-  debug(1, "output_rate is %d (0 means 44,100).", config.output_rate);
-  debug(1, "output_format is %d (3 is the default SPS_FORMAT_S16).", config.output_format);
+  debug(1, "output_rate is %d.", config.output_rate);
+  debug(1, "output_format is %d (0-unknown, 1-S8, 2-U8, 3-S16, 4-S24, 5-S32).", config.output_format);
   debug(1, "audio backend desired buffer length is %f seconds.",
         config.audio_backend_buffer_desired_length);
   debug(1, "audio backend latency offset is %f seconds.", config.audio_backend_latency_offset);