Make sure native drivers are loaded first, by openning the /dev directories to let devfs scan them. Also make sure oss is loaded so we can open /dev/sndstat.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36761 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol 2010-05-08 22:36:37 +00:00
parent ee9a07fc52
commit 7a2f989819

View File

@ -204,9 +204,19 @@ OpenSoundAddOn::RecursiveScan(char* rootPath, BEntry *rootEntry)
CALLED(); CALLED();
// make sure directories are scanned in this order
BDirectory("/dev/audio/hmulti");
BDirectory("/dev/audio/old");
// OSS last, to give precedence to native drivers.
// If other addons are loaded first it's ok as well.
// Also, we must open it to make sure oss_loader is here,
// else we don't get /dev/sndstat since we don't have a symlink in dev/.
BDirectory("/dev/oss");
mixer = open(OSS_MIXER_DEV, O_RDWR); mixer = open(OSS_MIXER_DEV, O_RDWR);
if (mixer < 0) { if (mixer < 0) {
// try to rescan // try to rescan
// only works in BeOS
BFile fDevFS("/dev/.", B_WRITE_ONLY); BFile fDevFS("/dev/.", B_WRITE_ONLY);
const char *drv = "oss_loader"; const char *drv = "oss_loader";
fDevFS.Write(drv, strlen(drv)); fDevFS.Write(drv, strlen(drv));