pulseaudio: module.c: module-detect is deprecated: Please use module-udev-detect instead of module-detect!

Andriy Gapon avg at freebsd.org
Thu Mar 3 10:58:56 UTC 2011

on 03/03/2011 01:41 Koop Mast said the following:
> Could you give this patch a try? It should get rid of the message. Just
> put it in audio/pulseaudio/files.
> http://people.freebsd.org/~kwm/patch-src_modules_module-detect.c

The patch works as expected.  Thank you!

BTW, I also found the following change necessary in my environment.
Without it I can not record from full-duplex devices, only play through them.

The problem seems to be that FreeBSD doesn't support the following usage pattern:
open(/dev/dsp, O_RDWR);
mmap(fd, PROT_READ);
mmap(fd, PROT_WRITE);

FreeBSD will only support writing in this case.
FreeBSD requires two separate file descriptors to be opened:
open(/dev/dsp, O_RDONLY);
open(/dev/dsp, O_WRONLY);
mmap(fd1, PROT_READ);
mmap(fd2, PROT_WRITE);

But implementing this approach would be a bigger change to the code.
So it's easier to just disable mmap on FreeBSD.

The obvious diff:
--- src/modules/oss/module-oss.c.orig	2010-11-26 02:45:23.000000000 +0200
+++ src/modules/oss/module-oss.c	2011-03-03 12:35:33.578266715 +0200
@@ -1164,7 +1164,7 @@
     int fd = -1;
     int nfrags, orig_frag_size, frag_size;
     int mode, caps;
-    pa_bool_t record = TRUE, playback = TRUE, use_mmap = TRUE;
+    pa_bool_t record = TRUE, playback = TRUE, use_mmap = FALSE;
     pa_sample_spec ss;
     pa_channel_map map;
     pa_modargs *ma = NULL;

Last note.  Each time I log into a KDE session I get the following message:
pulseaudio[NNNN]: pid.c: Daemon already running.
Looks like possibly some (minor) issue in automatic pulseaudio daemon startup?

Thank you again!
Andriy Gapon

More information about the freebsd-gnome mailing list