Provide a way to disable various (linux-compatible) sound drivers, in case we need to hunt for dodgy drivers on dodgy distros.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5296 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
5886f59d76
commit
ffd726eb50
4 changed files with 25 additions and 2 deletions
|
@ -972,6 +972,9 @@ static qboolean OpenAL_InitLibrary(void)
|
||||||
firefoxstaticsounds = !!strstr(emscripten_run_script_string("navigator.userAgent"), "Firefox");
|
firefoxstaticsounds = !!strstr(emscripten_run_script_string("navigator.userAgent"), "Firefox");
|
||||||
if (firefoxstaticsounds)
|
if (firefoxstaticsounds)
|
||||||
Con_DPrintf("Firefox detected - disabling static sounds to avoid SORRY, I CAN'T HEAR YOU\n");
|
Con_DPrintf("Firefox detected - disabling static sounds to avoid SORRY, I CAN'T HEAR YOU\n");
|
||||||
|
#else
|
||||||
|
if (COM_CheckParm("-noopenal"))
|
||||||
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef OPENAL_STATIC
|
#ifdef OPENAL_STATIC
|
||||||
|
|
|
@ -205,6 +205,10 @@ static qboolean Alsa_InitAlsa(void)
|
||||||
return alsaworks;
|
return alsaworks;
|
||||||
tried = true;
|
tried = true;
|
||||||
|
|
||||||
|
//pulseaudio's wrapper library fucks with alsa in bad ways, making it unusable on some systems.
|
||||||
|
if (COM_CheckParm("-noalsa"))
|
||||||
|
return false;
|
||||||
|
|
||||||
// Try alternative names of libasound, sometimes it is not linked correctly.
|
// Try alternative names of libasound, sometimes it is not linked correctly.
|
||||||
alsasharedobject = dlopen("libasound.so.2", RTLD_LAZY|RTLD_LOCAL);
|
alsasharedobject = dlopen("libasound.so.2", RTLD_LAZY|RTLD_LOCAL);
|
||||||
if (!alsasharedobject)
|
if (!alsasharedobject)
|
||||||
|
|
|
@ -140,6 +140,9 @@ static qboolean OSS_InitCard(soundcardinfo_t *sc, const char *snddev)
|
||||||
alsadetected = true;
|
alsadetected = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (COM_CheckParm("-nooss"))
|
||||||
|
return false;
|
||||||
|
|
||||||
if (!snddev || !*snddev)
|
if (!snddev || !*snddev)
|
||||||
snddev = "/dev/dsp";
|
snddev = "/dev/dsp";
|
||||||
else if (strncmp(snddev, "/dev/dsp", 8))
|
else if (strncmp(snddev, "/dev/dsp", 8))
|
||||||
|
@ -453,8 +456,13 @@ static qboolean QDECL OSS_Enumerate(void (QDECL *cb) (const char *drivername, co
|
||||||
{
|
{
|
||||||
#if defined(SNDCTL_SYSINFO) && defined(SNDCTL_AUDIOINFO)
|
#if defined(SNDCTL_SYSINFO) && defined(SNDCTL_AUDIOINFO)
|
||||||
int i;
|
int i;
|
||||||
int fd = open("/dev/mixer", O_RDWR, 0);
|
int fd;
|
||||||
oss_sysinfo si;
|
oss_sysinfo si;
|
||||||
|
|
||||||
|
if (COM_CheckParm("-nooss"))
|
||||||
|
return true;
|
||||||
|
fd = open("/dev/mixer", O_RDWR, 0);
|
||||||
|
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
return true; //oss not supported. don't list any devices.
|
return true; //oss not supported. don't list any devices.
|
||||||
|
|
||||||
|
@ -479,7 +487,7 @@ static qboolean QDECL OSS_Enumerate(void (QDECL *cb) (const char *drivername, co
|
||||||
printf("OSS driver is too old to support device enumeration.\n");
|
printf("OSS driver is too old to support device enumeration.\n");
|
||||||
close(fd);
|
close(fd);
|
||||||
#endif
|
#endif
|
||||||
return false; //enumeration failed.
|
return false; //enumeration failed, will show only a default device.
|
||||||
}
|
}
|
||||||
|
|
||||||
sounddriver_t OSS_Output =
|
sounddriver_t OSS_Output =
|
||||||
|
@ -497,6 +505,9 @@ sounddriver_t OSS_Output =
|
||||||
|
|
||||||
static qboolean QDECL OSS_Capture_Enumerate (void (QDECL *callback) (const char *drivername, const char *devicecode, const char *readablename))
|
static qboolean QDECL OSS_Capture_Enumerate (void (QDECL *callback) (const char *drivername, const char *devicecode, const char *readablename))
|
||||||
{
|
{
|
||||||
|
if (COM_CheckParm("-nooss"))
|
||||||
|
return true; //no default devices or anything
|
||||||
|
|
||||||
//open /dev/dsp or /dev/mixer or env("OSS_MIXERDEV") or something
|
//open /dev/dsp or /dev/mixer or env("OSS_MIXERDEV") or something
|
||||||
//SNDCTL_SYSINFO to get sysinfo.numcards
|
//SNDCTL_SYSINFO to get sysinfo.numcards
|
||||||
//for i=0; i<sysinfo.numcards
|
//for i=0; i<sysinfo.numcards
|
||||||
|
@ -509,6 +520,8 @@ void *OSS_Capture_Init(int rate, const char *snddev)
|
||||||
intptr_t fd;
|
intptr_t fd;
|
||||||
if (!snddev || !*snddev)
|
if (!snddev || !*snddev)
|
||||||
snddev = "/dev/dsp";
|
snddev = "/dev/dsp";
|
||||||
|
if (COM_CheckParm("-nooss"))
|
||||||
|
return NULL;
|
||||||
fd = open(snddev, O_RDONLY | O_NONBLOCK); //try the primary device
|
fd = open(snddev, O_RDONLY | O_NONBLOCK); //try the primary device
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -120,6 +120,9 @@ static qboolean SSDL_InitAudio(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (COM_CheckParm("-nosndsnd"))
|
||||||
|
return false;
|
||||||
|
|
||||||
if (!inited)
|
if (!inited)
|
||||||
if(SDL_InitSubSystem(SDL_INIT_AUDIO | SDL_INIT_NOPARACHUTE))
|
if(SDL_InitSubSystem(SDL_INIT_AUDIO | SDL_INIT_NOPARACHUTE))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue