Default to corect audio device on Raspberry Pi

This commit is contained in:
Iwan Timmer 2016-03-25 11:12:20 +01:00
parent 8de4fe1cf3
commit 68e18a2067
5 changed files with 13 additions and 7 deletions

View File

@ -137,7 +137,7 @@ To use a different gamepad mapping then the default the B<-mapping> should be sp
=item B<-audio> [I<DEVICE>]
Use <DEVICE> as audio output device.
The default value is 'sysdefault'
The default value is 'sysdefault' for ALSA and 'hdmi' for OMX on the Raspberry Pi.
=back

View File

@ -1,7 +1,7 @@
/*
* This file is part of Moonlight Embedded.
*
* Copyright (C) 2015 Iwan Timmer
* Copyright (C) 2015, 2016 Iwan Timmer
*
* Moonlight is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -62,6 +62,9 @@ static void alsa_renderer_init(int audioConfiguration, POPUS_MULTISTREAM_CONFIGU
snd_pcm_uframes_t buffer_size = 12 * period_size;
unsigned int sampleRate = opusConfig->sampleRate;
if (audio_device == NULL)
audio_device = "sysdefault";
/* Open PCM device for playback. */
CHECK_RETURN(snd_pcm_open(&handle, audio_device, SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK))

View File

@ -1,7 +1,7 @@
/*
* This file is part of Moonlight Embedded.
*
* Copyright (C) 2015 Iwan Timmer
* Copyright (C) 2015, 2016 Iwan Timmer
*
* Moonlight is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -131,6 +131,9 @@ static void omx_renderer_init(int audioConfiguration, POPUS_MULTISTREAM_CONFIGUR
}
OMX_CONFIG_BRCMAUDIODESTINATIONTYPE arDest;
if (audio_device == NULL)
audio_device = "hdmi";
if (audio_device && strlen(audio_device) < sizeof(arDest.sName)) {
memset(&arDest, 0, sizeof(OMX_CONFIG_BRCMAUDIODESTINATIONTYPE));
arDest.nSize = sizeof(OMX_CONFIG_BRCMAUDIODESTINATIONTYPE);

View File

@ -1,7 +1,7 @@
/*
* This file is part of Moonlight Embedded.
*
* Copyright (C) 2015 Iwan Timmer
* Copyright (C) 2015, 2016 Iwan Timmer
*
* Moonlight is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -38,7 +38,7 @@
bool inputAdded = false;
static bool mapped = true;
const char* audio_device = "sysdefault";
const char* audio_device = NULL;
static struct option long_options[] = {
{"720", no_argument, NULL, 'a'},

View File

@ -1,7 +1,7 @@
/*
* This file is part of Moonlight Embedded.
*
* Copyright (C) 2015 Iwan Timmer
* Copyright (C) 2015, 2016 Iwan Timmer
*
* Moonlight is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -152,7 +152,7 @@ static void help() {
printf("\n I/O options\n\n");
printf("\t-mapping <file>\t\tUse <file> as gamepad mapping configuration file (use before -input)\n");
printf("\t-input <device>\t\tUse <device> as input. Can be used multiple times\n");
printf("\t-audio <device>\t\tUse <device> as audio output device (default sysdefault)\n");
printf("\t-audio <device>\t\tUse <device> as audio output device\n");
printf("\t-forcehw \t\tTry to use video hardware acceleration\n");
#endif
printf("\nUse Ctrl+Alt+Shift+Q to exit streaming session\n\n");