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:
Spoike 2018-08-21 18:57:51 +00:00
parent 5886f59d76
commit ffd726eb50
4 changed files with 25 additions and 2 deletions

View File

@ -972,6 +972,9 @@ static qboolean OpenAL_InitLibrary(void)
firefoxstaticsounds = !!strstr(emscripten_run_script_string("navigator.userAgent"), "Firefox");
if (firefoxstaticsounds)
Con_DPrintf("Firefox detected - disabling static sounds to avoid SORRY, I CAN'T HEAR YOU\n");
#else
if (COM_CheckParm("-noopenal"))
return false;
#endif
#ifdef OPENAL_STATIC

View File

@ -205,6 +205,10 @@ static qboolean Alsa_InitAlsa(void)
return alsaworks;
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.
alsasharedobject = dlopen("libasound.so.2", RTLD_LAZY|RTLD_LOCAL);
if (!alsasharedobject)

View File

@ -140,6 +140,9 @@ static qboolean OSS_InitCard(soundcardinfo_t *sc, const char *snddev)
alsadetected = true;
#endif
if (COM_CheckParm("-nooss"))
return false;
if (!snddev || !*snddev)
snddev = "/dev/dsp";
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)
int i;
int fd = open("/dev/mixer", O_RDWR, 0);
int fd;
oss_sysinfo si;
if (COM_CheckParm("-nooss"))
return true;
fd = open("/dev/mixer", O_RDWR, 0);
if (fd == -1)
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");
close(fd);
#endif
return false; //enumeration failed.
return false; //enumeration failed, will show only a default device.
}
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))
{
if (COM_CheckParm("-nooss"))
return true; //no default devices or anything
//open /dev/dsp or /dev/mixer or env("OSS_MIXERDEV") or something
//SNDCTL_SYSINFO to get sysinfo.numcards
//for i=0; i<sysinfo.numcards
@ -509,6 +520,8 @@ void *OSS_Capture_Init(int rate, const char *snddev)
intptr_t fd;
if (!snddev || !*snddev)
snddev = "/dev/dsp";
if (COM_CheckParm("-nooss"))
return NULL;
fd = open(snddev, O_RDONLY | O_NONBLOCK); //try the primary device
if (fd == -1)
return NULL;

View File

@ -120,6 +120,9 @@ static qboolean SSDL_InitAudio(void)
}
#endif
if (COM_CheckParm("-nosndsnd"))
return false;
if (!inited)
if(SDL_InitSubSystem(SDL_INIT_AUDIO | SDL_INIT_NOPARACHUTE))
{