diff --git a/docs/README.pod b/docs/README.pod index a77dbfc..75f443f 100644 --- a/docs/README.pod +++ b/docs/README.pod @@ -121,9 +121,9 @@ Stop GFE from changing the graphical settings of the requested game or applicati Play the audio on the host computer instead of this device. -=item B<-surround> +=item B<-surround> [I<5.1/7.1>] -Enable 5.1 surround sound instead of stereo. +Enable surround sound instead of stereo. =item B<-keydir> [I] diff --git a/moonlight.conf b/moonlight.conf index 0dd5e98..63e5ad1 100644 --- a/moonlight.conf +++ b/moonlight.conf @@ -67,8 +67,8 @@ ## Enable QOS settings to optimize for internet instead of local network #remote = false -## Enable 5.1 surround sound -#surround = false +## Enable 5.1/7.1 surround sound +#surround = 5.1 ## Load additional configuration files #config = /path/to/config diff --git a/src/audio/audio.h b/src/audio/audio.h index 91776ca..4d39519 100644 --- a/src/audio/audio.h +++ b/src/audio/audio.h @@ -21,7 +21,7 @@ #include -#define MAX_CHANNEL_COUNT 6 +#define MAX_CHANNEL_COUNT 8 #define FRAME_SIZE 240 #define FRAME_BUFFER 12 diff --git a/src/config.c b/src/config.c index 071a88c..ec57888 100644 --- a/src/config.c +++ b/src/config.c @@ -61,7 +61,7 @@ static struct option long_options[] = { {"keydir", required_argument, NULL, 'r'}, {"remote", no_argument, NULL, 's'}, {"windowed", no_argument, NULL, 't'}, - {"surround", no_argument, NULL, 'u'}, + {"surround", required_argument, NULL, 'u'}, {"fps", required_argument, NULL, 'v'}, {"codec", required_argument, NULL, 'x'}, {"nounsupported", no_argument, NULL, 'y'}, @@ -199,7 +199,10 @@ static void parse_argument(int c, char* value, PCONFIGURATION config) { config->fullscreen = false; break; case 'u': - config->stream.audioConfiguration = AUDIO_CONFIGURATION_51_SURROUND; + if (strcasecmp(value, "5.1") == 0) + config->stream.audioConfiguration = AUDIO_CONFIGURATION_51_SURROUND; + else if (strcasecmp(value, "7.1") == 0) + config->stream.audioConfiguration = AUDIO_CONFIGURATION_71_SURROUND; break; case 'v': config->stream.fps = atoi(value); @@ -352,7 +355,7 @@ void config_parse(int argc, char* argv[], PCONFIGURATION config) { } else { int option_index = 0; int c; - while ((c = getopt_long_only(argc, argv, "-abc:d:efg:h:i:j:k:lm:no:p:q:r:stuv:w:xy", long_options, &option_index)) != -1) { + while ((c = getopt_long_only(argc, argv, "-abc:d:efg:h:i:j:k:lm:no:p:q:r:stu:v:w:xy", long_options, &option_index)) != -1) { parse_argument(c, optarg, config); } } diff --git a/src/main.c b/src/main.c index 3b12272..9d8c52f 100644 --- a/src/main.c +++ b/src/main.c @@ -202,7 +202,7 @@ static void help() { printf("\t-app \t\tName of app to stream\n"); printf("\t-nosops\t\t\tDon't allow GFE to modify game settings\n"); printf("\t-localaudio\t\tPlay audio locally on the host computer\n"); - printf("\t-surround\t\tStream 5.1 surround sound (requires GFE 2.7)\n"); + printf("\t-surround <5.1/7.1>\t\tStream 5.1 or 7.1 surround sound\n"); printf("\t-keydir \tLoad encryption keys from directory\n"); printf("\t-mapping \t\tUse as gamepad mappings configuration file\n"); printf("\t-platform \tSpecify system used for audio, video and input: pi/imx/aml/rk/x11/x11_vdpau/sdl/fake (default auto)\n");