View | Details | Raw Unified | Return to bug 211684 | Differences between
and this patch

Collapse All | Expand All

(-)files/patch-src_modules_module-detect.c (-1 / +30 lines)
Lines 10-16 Link Here
10
 
10
 
11
 static const char* const valid_modargs[] = {
11
 static const char* const valid_modargs[] = {
12
     "just-one",
12
     "just-one",
13
@@ -157,8 +159,7 @@ static int detect_oss(pa_core *c, int ju
13
@@ -130,7 +132,18 @@ static int detect_oss(pa_core *c, int ju
14
         return -1;
15
     }
16
 
17
-    while (!feof(f)) {
18
+    /* On FreeBSD we load an OSS module instance first that uses the
19
+     * default audio device /dev/dsp before all the others.  This way
20
+     * PulseAudio defaults to using it instead of /dev/dsp0 i.e. it
21
+     * actually respect the default sound unit set with sysctl
22
+     * hw.snd.default_unit.  The default device will appear again in
23
+     * /dev/sndstat and thus will be duplicated in PulseAudio but that
24
+     * should not matter much for the benefit gained (a sane default
25
+     * user experience). */
26
+    pa_module_load(c, "module-oss", "device=/dev/dsp");
27
+    n++;
28
+
29
+    while (!just_one && !feof(f)) {
30
         char line[256], args[64];
31
         unsigned device;
32
 
33
@@ -157,17 +170,13 @@ static int detect_oss(pa_core *c, int ju
14
                 continue;
34
                 continue;
15
 
35
 
16
         } else if (sscanf(line, "pcm%u: ", &device) == 1) {
36
         } else if (sscanf(line, "pcm%u: ", &device) == 1) {
Lines 20-22 Link Here
20
 
40
 
21
             if (!pa_module_load(c, "module-oss", args))
41
             if (!pa_module_load(c, "module-oss", args))
22
                 continue;
42
                 continue;
43
         }
44
 
45
         n++;
46
-
47
-        if (just_one)
48
-            break;
49
     }
50
 
51
     fclose(f);

Return to bug 211684