From 83b181f92af6a06ad5f127fea36323d7277ad6cf Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 4 Nov 2009 00:15:47 +0100 Subject: [PATCH 01/13] alsa: cover 'Analog Output' control http://pulseaudio.org/ticket/702 --- .../alsa/mixer/paths/analog-output.conf.common | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/modules/alsa/mixer/paths/analog-output.conf.common b/src/modules/alsa/mixer/paths/analog-output.conf.common index 3c6ce8036..fd7f0cfb1 100644 --- a/src/modules/alsa/mixer/paths/analog-output.conf.common +++ b/src/modules/alsa/mixer/paths/analog-output.conf.common @@ -109,3 +109,20 @@ priority = 10 [Option External Amplifier:off] name = output-amplifier-off priority = 0 + +;;; 'Analog Output' + +[Element Analog Output] +enumeration = select + +[Option Analog Output:Speakers] +name = output-speaker +priority = 10 + +[Option Analog Output:Headphones] +name = output-headphones +priority = 9 + +[Option Analog Output:FP Headphones] +name = output-headphones +priority = 8 From 19516d4e7f4b6db205681931ad1c4bc1b6bef363 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 5 Nov 2009 03:21:10 +0100 Subject: [PATCH 02/13] alsa: introduce more standard path names --- src/modules/alsa/alsa-mixer.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c index f3ce681f5..8b13239ca 100644 --- a/src/modules/alsa/alsa-mixer.c +++ b/src/modules/alsa/alsa-mixer.c @@ -1712,7 +1712,9 @@ static int option_verify(pa_alsa_option *o) { { "input-boost-on", N_("Boost") }, { "input-boost-off", N_("No Boost") }, { "output-amplifier-on", N_("Amplifier") }, - { "output-amplifier-off", N_("No Amplifier") } + { "output-amplifier-off", N_("No Amplifier") }, + { "output-speaker", N_("Speaker") }, + { "output-headphones", N_("Headphones") } }; pa_assert(o); @@ -1770,15 +1772,17 @@ static int element_verify(pa_alsa_element *e) { static int path_verify(pa_alsa_path *p) { static const struct description_map well_known_descriptions[] = { - { "analog-input", N_("Analog Input") }, - { "analog-input-microphone", N_("Analog Microphone") }, - { "analog-input-linein", N_("Analog Line-In") }, - { "analog-input-radio", N_("Analog Radio") }, - { "analog-input-video", N_("Analog Video") }, - { "analog-output", N_("Analog Output") }, - { "analog-output-headphones", N_("Analog Headphones") }, - { "analog-output-lfe-on-mono", N_("Analog Output (LFE)") }, - { "analog-output-mono", N_("Analog Mono Output") } + { "analog-input", N_("Analog Input") }, + { "analog-input-microphone", N_("Analog Microphone") }, + { "analog-input-linein", N_("Analog Line-In") }, + { "analog-input-radio", N_("Analog Radio") }, + { "analog-input-video", N_("Analog Video") }, + { "analog-output", N_("Analog Output") }, + { "analog-output-headphones", N_("Analog Headphones") }, + { "analog-output-lfe-on-mono", N_("Analog Output (LFE)") }, + { "analog-output-mono", N_("Analog Mono Output") }, + { "analog-output-headphones-2", N_("Analog Headphones 2") }, + { "analog-output-speaker", N_("Analog Speaker") } }; pa_alsa_element *e; From 642c69bed85ce7c0be57bd08af0cf7243228f08b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 5 Nov 2009 03:22:15 +0100 Subject: [PATCH 03/13] core-util: add call to detect if we are called from within a VM --- src/pulsecore/core-util.c | 89 +++++++++++++++++++++++++++++++++++++++ src/pulsecore/core-util.h | 3 ++ 2 files changed, 92 insertions(+) diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index 2b0a60a80..93ddf3011 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -2944,6 +2944,7 @@ int pa_pipe_cloexec(int pipefd[2]) { if (errno != EINVAL && errno != ENOSYS) return r; + #endif if ((r = pipe(pipefd)) < 0) @@ -2965,6 +2966,7 @@ int pa_accept_cloexec(int sockfd, struct sockaddr *addr, socklen_t *addrlen) { if (errno != EINVAL && errno != ENOSYS) return fd; + #endif if ((fd = accept(sockfd, addr, addrlen)) < 0) @@ -3015,3 +3017,90 @@ void pa_nullify_stdfds(void) { #endif } + +char *pa_read_line_from_file(const char *fn) { + FILE *f; + char ln[256] = "", *r; + + if (!(f = pa_fopen_cloexec(fn, "r"))) + return NULL; + + r = fgets(ln, sizeof(ln)-1, f); + fclose(f); + + if (!r) { + errno = EIO; + return NULL; + } + + pa_strip_nl(ln); + return pa_xstrdup(ln); +} + +pa_bool_t pa_running_in_vm(void) { + +#if defined(__i386__) || defined(__x86_64__) + + /* Both CPUID and DMI are x86 specific interfaces... */ + + uint32_t eax = 0x40000000; + union { + uint32_t sig32[3]; + char text[13]; + } sig; + +#ifdef __linux__ + const char *const dmi_vendors[] = { + "/sys/class/dmi/id/sys_vendor", + "/sys/class/dmi/id/board_vendor", + "/sys/class/dmi/id/bios_vendor" + }; + + unsigned i; + + for (i = 0; i < PA_ELEMENTSOF(dmi_vendors); i++) { + char *s; + + if ((s = pa_read_line_from_file(dmi_vendors[i]))) { + + if (pa_startswith(s, "QEMU") || + /* http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1009458 */ + pa_startswith(s, "VMware") || + pa_startswith(s, "VMW") || + pa_startswith(s, "Microsoft Corporation") || + pa_startswith(s, "innotek GmbH") || + pa_startswith(s, "Xen")) { + + pa_xfree(s); + return TRUE; + } + + pa_xfree(s); + } + } + +#endif + + /* http://lwn.net/Articles/301888/ */ + pa_zero(sig); + + __asm__ __volatile__ ( + " xor %%ebx, %%ebx \n\t" + " cpuid \n\t" + + : "=a" (eax), "=b" (sig.sig32[0]), "=c" (sig.sig32[1]), "=d" (sig.sig32[2]) + : "0" (eax) + ); + + if (pa_streq(sig.text, "XenVMMXenVMM") || + pa_streq(sig.text, "KVMKVMKVM") || + /* http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1009458 */ + pa_streq(sig.text, "VMwareVMware") || + /* http://msdn.microsoft.com/en-us/library/bb969719.aspx */ + pa_streq(sig.text, "Microsoft Hv")) + return TRUE; + +#endif + + return FALSE; +} diff --git a/src/pulsecore/core-util.h b/src/pulsecore/core-util.h index 9c9cf78ab..31a83bcc2 100644 --- a/src/pulsecore/core-util.h +++ b/src/pulsecore/core-util.h @@ -267,4 +267,7 @@ FILE* pa_fopen_cloexec(const char *path, const char *mode); void pa_nullify_stdfds(void); +char *pa_read_line_from_file(const char *fn); +pa_bool_t pa_running_in_vm(void); + #endif From c079ceeba00c77a93c613ecf4a3f2cb516db0753 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 5 Nov 2009 03:22:48 +0100 Subject: [PATCH 04/13] daemon: during startup say whether we run in a VM --- src/daemon/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/daemon/main.c b/src/daemon/main.c index cc6f24bdc..489118273 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -648,7 +648,6 @@ int main(int argc, char *argv[]) { if (conf->daemonize) { pid_t child; - int tty_fd; if (pa_stdio_acquire() < 0) { pa_log(_("Failed to acquire stdio.")); @@ -781,6 +780,8 @@ int main(int argc, char *argv[]) { pa_log_debug(_("Running in valgrind mode: %s"), pa_yes_no(pa_in_valgrind())); + pa_log_debug(_("Running in VM: %s"), pa_yes_no(pa_running_in_vm())); + #ifdef __OPTIMIZE__ pa_log_debug(_("Optimized build: yes")); #else From 53b046d5c9593d848270e85017c2999a61256e0e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 5 Nov 2009 03:23:08 +0100 Subject: [PATCH 05/13] alsa: disable timer-based scheduling inside a VM In virtual machines sound card clocks and OS scheduling tend to become unreliable, adding various 'uneven' latencies. The adaptive algorithm that handles drop-outs does not handle it this well: in contrast to drop-outs on real machines that are evenly distributed, small and can easily be encountered via the adpative algorithms, drop-outs in VMs tend to happen abruptly, and massively, which is not easy to counter. This patch simply disables timer based scheduling in VMs reverting to classic IO based scheduling. This should help make PA perform better in VMs. https://bugzilla.redhat.com/show_bug.cgi?id=532775 --- src/modules/alsa/alsa-sink.c | 5 +---- src/modules/alsa/alsa-source.c | 5 +---- src/modules/alsa/alsa-util.c | 24 ++++++++++++++++++++++++ src/modules/alsa/alsa-util.h | 2 ++ 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c index 37419d98c..856adb144 100644 --- a/src/modules/alsa/alsa-sink.c +++ b/src/modules/alsa/alsa-sink.c @@ -1698,10 +1698,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca goto fail; } - if (use_tsched && !pa_rtclock_hrtimer()) { - pa_log_notice("Disabling timer-based scheduling because high-resolution timers are not available from the kernel."); - use_tsched = FALSE; - } + use_tsched = pa_alsa_may_tsched(use_tsched); u = pa_xnew0(struct userdata, 1); u->core = m->core; diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c index 37dd64765..e775b20c6 100644 --- a/src/modules/alsa/alsa-source.c +++ b/src/modules/alsa/alsa-source.c @@ -1541,10 +1541,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p goto fail; } - if (use_tsched && !pa_rtclock_hrtimer()) { - pa_log_notice("Disabling timer-based scheduling because high-resolution timers are not available from the kernel."); - use_tsched = FALSE; - } + use_tsched = pa_alsa_may_tsched(use_tsched); u = pa_xnew0(struct userdata, 1); u->core = m->core; diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c index 0e22d17e4..b8d135758 100644 --- a/src/modules/alsa/alsa-util.c +++ b/src/modules/alsa/alsa-util.c @@ -43,6 +43,7 @@ #include #include #include +#include #include "alsa-util.h" #include "alsa-mixer.h" @@ -1308,3 +1309,26 @@ const char* pa_alsa_strerror(int errnum) { return translated; } + +pa_bool_t pa_alsa_may_tsched(pa_bool_t want) { + + if (!want) + return FALSE; + + if (!pa_rtclock_hrtimer()) { + /* We cannot depend on being woken up in time when the timers + are inaccurate, so let's fallback to classic IO based playback + then. */ + pa_log_notice("Disabling timer-based scheduling because high-resolution timers are not available from the kernel."); + return FALSE; } + + if (pa_running_in_vm()) { + /* We cannot depend on being woken up when we ask for in a VM, + * so let's fallback to classic IO based playback then. */ + pa_log_notice("Disabling timer-based scheduling because running inside a VM."); + return FALSE; + } + + + return TRUE; +} diff --git a/src/modules/alsa/alsa-util.h b/src/modules/alsa/alsa-util.h index f6206fe23..1d1256bd3 100644 --- a/src/modules/alsa/alsa-util.h +++ b/src/modules/alsa/alsa-util.h @@ -142,4 +142,6 @@ pa_bool_t pa_alsa_pcm_is_modem(snd_pcm_t *pcm); const char* pa_alsa_strerror(int errnum); +pa_bool_t pa_alsa_may_tsched(pa_bool_t want); + #endif From d2c59354d554f136739be7bbcd326f1d254f778e Mon Sep 17 00:00:00 2001 From: Vladimir Kokarev Date: Sat, 19 Sep 2009 19:43:24 +0400 Subject: [PATCH 06/13] volume: add pa_cvolume_inc_clamp function added function to increase volume not exceeding specified limit simply changed PA_VOLUME_MAX to 'limit' in pa_cvolume_inc pa_cvolume_inc now calls pa_cvolume_inc_clamp with PA_VOLUME_MAX limit --- src/map-file | 1 + src/pulse/volume.c | 10 +++++++--- src/pulse/volume.h | 4 ++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/map-file b/src/map-file index 50111224c..1fffaff98 100644 --- a/src/map-file +++ b/src/map-file @@ -130,6 +130,7 @@ pa_cvolume_get_balance; pa_cvolume_get_fade; pa_cvolume_get_position; pa_cvolume_inc; +pa_cvolume_inc_clamp; pa_cvolume_init; pa_cvolume_max; pa_cvolume_max_mask; diff --git a/src/pulse/volume.c b/src/pulse/volume.c index 2d2bba250..59e9a1890 100644 --- a/src/pulse/volume.c +++ b/src/pulse/volume.c @@ -885,7 +885,7 @@ pa_cvolume* pa_cvolume_merge(pa_cvolume *dest, const pa_cvolume *a, const pa_cvo return dest; } -pa_cvolume* pa_cvolume_inc(pa_cvolume *v, pa_volume_t inc) { +pa_cvolume* pa_cvolume_inc_clamp(pa_cvolume *v, pa_volume_t inc, pa_volume_t limit) { pa_volume_t m; pa_assert(v); @@ -895,14 +895,18 @@ pa_cvolume* pa_cvolume_inc(pa_cvolume *v, pa_volume_t inc) { m = pa_cvolume_max(v); - if (m >= PA_VOLUME_MAX - inc) - m = PA_VOLUME_MAX; + if (m >= limit - inc) + m = limit; else m += inc; return pa_cvolume_scale(v, m); } +pa_cvolume* pa_cvolume_inc(pa_cvolume *v, pa_volume_t inc){ + return pa_cvolume_inc_clamp(v, inc, PA_VOLUME_MAX); +} + pa_cvolume* pa_cvolume_dec(pa_cvolume *v, pa_volume_t dec) { pa_volume_t m; diff --git a/src/pulse/volume.h b/src/pulse/volume.h index c964020ac..ded4422e8 100644 --- a/src/pulse/volume.h +++ b/src/pulse/volume.h @@ -348,6 +348,10 @@ pa_volume_t pa_cvolume_get_position(pa_cvolume *cv, const pa_channel_map *map, p * and dest may point to the same structure. \since 0.9.16 */ pa_cvolume* pa_cvolume_merge(pa_cvolume *dest, const pa_cvolume *a, const pa_cvolume *b); +/** Increase the volume passed in by 'inc', but not exceeding 'limit'. + * The proportions between the channels are kept. \since 0.9.19 */ +pa_cvolume* pa_cvolume_inc_clamp(pa_cvolume *v, pa_volume_t inc, pa_volume_t limit); + /** Increase the volume passed in by 'inc'. The proportions between * the channels are kept. \since 0.9.16 */ pa_cvolume* pa_cvolume_inc(pa_cvolume *v, pa_volume_t inc); From 7793da371bbf70e23c0b45de1e188f5dd58f3324 Mon Sep 17 00:00:00 2001 From: Vladimir Kokarev Date: Thu, 5 Nov 2009 04:55:21 +0100 Subject: [PATCH 07/13] lirc,mmkvd: added module parameters volume_limit, volume_step volume_limit sets maximum volume that can be set from the module default is PA_VOLUME_NORM*3/2 (150%) volume_step sets step in volume changing default is PA_VOLUME_NORM/20 values are of raw pa_volume_t type --- src/modules/module-lirc.c | 26 +++++++++++++++++++++----- src/modules/module-mmkbd-evdev.c | 26 +++++++++++++++++++++----- 2 files changed, 42 insertions(+), 10 deletions(-) diff --git a/src/modules/module-lirc.c b/src/modules/module-lirc.c index d0e902f69..e97786206 100644 --- a/src/modules/module-lirc.c +++ b/src/modules/module-lirc.c @@ -45,12 +45,14 @@ PA_MODULE_AUTHOR("Lennart Poettering"); PA_MODULE_DESCRIPTION("LIRC volume control"); PA_MODULE_VERSION(PACKAGE_VERSION); PA_MODULE_LOAD_ONCE(TRUE); -PA_MODULE_USAGE("config= sink= appname="); +PA_MODULE_USAGE("config= sink= appname= volume_limit= volume_step="); static const char* const valid_modargs[] = { "config", "sink", "appname", + "volume_limit", + "volume_step", NULL, }; @@ -61,10 +63,10 @@ struct userdata { char *sink_name; pa_module *module; float mute_toggle_save; + pa_volume_t volume_limit; + pa_volume_t volume_step; }; -#define DELTA (PA_VOLUME_NORM/20) - static void io_callback(pa_mainloop_api *io, pa_io_event *e, int fd, pa_io_event_flags_t events, void*userdata) { struct userdata *u = userdata; char *name = NULL, *code = NULL; @@ -125,12 +127,12 @@ static void io_callback(pa_mainloop_api *io, pa_io_event *e, int fd, pa_io_event switch (volchange) { case UP: - pa_cvolume_inc(&cv, DELTA); + pa_cvolume_inc_clamp(&cv, u->volume_step, u->volume_limit); pa_sink_set_volume(s, &cv, TRUE, TRUE); break; case DOWN: - pa_cvolume_dec(&cv, DELTA); + pa_cvolume_dec(&cv, u->volume_step); pa_sink_set_volume(s, &cv, TRUE, TRUE); break; @@ -170,6 +172,8 @@ fail: int pa__init(pa_module*m) { pa_modargs *ma = NULL; struct userdata *u; + pa_volume_t volume_limit = PA_VOLUME_NORM*3/2; + pa_volume_t volume_step = PA_VOLUME_NORM/20; pa_assert(m); @@ -178,6 +182,16 @@ int pa__init(pa_module*m) { goto fail; } + if (pa_modargs_get_value_u32(ma, "volume_limit", &volume_limit) < 0) { + pa_log("Failed to parse volume limit"); + goto fail; + } + + if (pa_modargs_get_value_u32(ma, "volume_step", &volume_step) < 0) { + pa_log("Failed to parse volume step"); + goto fail; + } + m->userdata = u = pa_xnew(struct userdata, 1); u->module = m; u->io = NULL; @@ -185,6 +199,8 @@ int pa__init(pa_module*m) { u->sink_name = pa_xstrdup(pa_modargs_get_value(ma, "sink", NULL)); u->lirc_fd = -1; u->mute_toggle_save = 0; + u->volume_limit = volume_limit; + u->volume_step = volume_step; if ((u->lirc_fd = lirc_init((char*) pa_modargs_get_value(ma, "appname", "pulseaudio"), 1)) < 0) { pa_log("lirc_init() failed."); diff --git a/src/modules/module-mmkbd-evdev.c b/src/modules/module-mmkbd-evdev.c index 14a9dd3d5..193c1f40a 100644 --- a/src/modules/module-mmkbd-evdev.c +++ b/src/modules/module-mmkbd-evdev.c @@ -48,13 +48,15 @@ PA_MODULE_AUTHOR("Lennart Poettering"); PA_MODULE_DESCRIPTION("Multimedia keyboard support via Linux evdev"); PA_MODULE_VERSION(PACKAGE_VERSION); PA_MODULE_LOAD_ONCE(FALSE); -PA_MODULE_USAGE("device= sink="); +PA_MODULE_USAGE("device= sink= volume_limit= volume_step="); #define DEFAULT_DEVICE "/dev/input/event0" static const char* const valid_modargs[] = { "device", "sink", + "volume_limit", + "volume_step", NULL, }; @@ -63,10 +65,10 @@ struct userdata { pa_io_event *io; char *sink_name; pa_module *module; + pa_volume_t volume_limit; + pa_volume_t volume_step; }; -#define DELTA (PA_VOLUME_NORM/20) - static void io_callback(pa_mainloop_api *io, pa_io_event *e, int fd, pa_io_event_flags_t events, void*userdata) { struct userdata *u = userdata; @@ -120,12 +122,12 @@ static void io_callback(pa_mainloop_api *io, pa_io_event *e, int fd, pa_io_event switch (volchange) { case UP: - pa_cvolume_inc(&cv, DELTA); + pa_cvolume_inc_clamp(&cv, u->volume_step, u->volume_limit); pa_sink_set_volume(s, &cv, TRUE, TRUE); break; case DOWN: - pa_cvolume_dec(&cv, DELTA); + pa_cvolume_dec(&cv, u->volume_step); pa_sink_set_volume(s, &cv, TRUE, TRUE); break; @@ -160,6 +162,8 @@ int pa__init(pa_module*m) { struct input_id input_id; char name[256]; uint8_t evtype_bitmask[EV_MAX/8 + 1]; + pa_volume_t volume_limit = PA_VOLUME_NORM*3/2; + pa_volume_t volume_step = PA_VOLUME_NORM/20; pa_assert(m); @@ -168,12 +172,24 @@ int pa__init(pa_module*m) { goto fail; } + if (pa_modargs_get_value_u32(ma, "volume_limit", &volume_limit) < 0) { + pa_log("Failed to parse volume limit"); + goto fail; + } + + if (pa_modargs_get_value_u32(ma, "volume_step", &volume_step) < 0) { + pa_log("Failed to parse volume step"); + goto fail; + } + m->userdata = u = pa_xnew(struct userdata, 1); u->module = m; u->io = NULL; u->sink_name = pa_xstrdup(pa_modargs_get_value(ma, "sink", NULL)); u->fd = -1; u->fd_type = 0; + u->volume_limit = volume_limit; + u->volume_step = volume_step; if ((u->fd = pa_open_cloexec(pa_modargs_get_value(ma, "device", DEFAULT_DEVICE), O_RDONLY, 0)) < 0) { pa_log("Failed to open evdev device: %s", pa_cstrerror(errno)); From 38a03c1e4f14ad6edfd0b7d95c8d7440c3a950e2 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 5 Nov 2009 05:08:50 +0100 Subject: [PATCH 08/13] man: fix build with --disable-manpages http://pulseaudio.org/ticket/698 --- man/Makefile.am | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/man/Makefile.am b/man/Makefile.am index 9b229f52a..7793fe7d4 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -20,21 +20,6 @@ pulseconfdir=$(sysconfdir)/pulse CLEANFILES = \ $(noinst_DATA) -dist_man_MANS = \ - pulseaudio.1 \ - esdcompat.1 \ - pax11publish.1 \ - paplay.1 \ - pacat.1 \ - pacmd.1 \ - pactl.1 \ - pasuspender.1 \ - padsp.1 \ - pabrowse.1 \ - pulse-daemon.conf.5 \ - pulse-client.conf.5 \ - default.pa.5 - noinst_DATA = \ pulseaudio.1.xml \ esdcompat.1.xml \ @@ -50,24 +35,39 @@ noinst_DATA = \ pulse-client.conf.5.xml \ default.pa.5.xml -if BUILD_MANPAGES - -CLEANFILES += \ - $(dist_man_MANS) - %.xml: %.xml.in Makefile sed -e 's,@pulseconfdir\@,$(pulseconfdir),g' \ -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \ -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' $< > $@ -%: %.xml Makefile - perl $(srcdir)/xmltoman $< > $@ || rm -f $@ - xmllint: $(noinst_DATA) for f in $(noinst_DATA) ; do \ xmllint --noout --valid "$$f" || exit 1 ; \ done +if BUILD_MANPAGES + +dist_man_MANS = \ + pulseaudio.1 \ + esdcompat.1 \ + pax11publish.1 \ + paplay.1 \ + pacat.1 \ + pacmd.1 \ + pactl.1 \ + pasuspender.1 \ + padsp.1 \ + pabrowse.1 \ + pulse-daemon.conf.5 \ + pulse-client.conf.5 \ + default.pa.5 + +CLEANFILES += \ + $(dist_man_MANS) + +%: %.xml Makefile + perl $(srcdir)/xmltoman $< > $@ || rm -f $@ + endif EXTRA_DIST = \ From 721e32b473ca821d5551a3d93ac04f84c5988c8f Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 5 Nov 2009 05:18:10 +0100 Subject: [PATCH 09/13] jack: never try to autoconnect to MIDI ports Original patch supplied by 'adi' http://pulseaudio.org/ticket/669 --- src/modules/jack/module-jack-sink.c | 2 +- src/modules/jack/module-jack-source.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/jack/module-jack-sink.c b/src/modules/jack/module-jack-sink.c index fc976fa72..9f3e071fd 100644 --- a/src/modules/jack/module-jack-sink.c +++ b/src/modules/jack/module-jack-sink.c @@ -334,7 +334,7 @@ int pa__init(pa_module*m) { goto fail; } - ports = jack_get_ports(u->client, NULL, NULL, JackPortIsPhysical|JackPortIsInput); + ports = jack_get_ports(u->client, NULL, JACK_DEFAULT_AUDIO_TYPE, JackPortIsPhysical|JackPortIsInput); channels = 0; for (p = ports; *p; p++) diff --git a/src/modules/jack/module-jack-source.c b/src/modules/jack/module-jack-source.c index a898e0e5a..6c68527b6 100644 --- a/src/modules/jack/module-jack-source.c +++ b/src/modules/jack/module-jack-source.c @@ -286,7 +286,7 @@ int pa__init(pa_module*m) { goto fail; } - ports = jack_get_ports(u->client, NULL, NULL, JackPortIsPhysical|JackPortIsOutput); + ports = jack_get_ports(u->client, NULL, JACK_DEFAULT_AUDIO_TYPE, JackPortIsPhysical|JackPortIsOutput); channels = 0; for (p = ports; *p; p++) From 9e45f198d00591714f100431c5e7832b46ff4abd Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Mon, 9 Nov 2009 21:56:33 +0000 Subject: [PATCH 10/13] device-manager: Update docs version -> 0.9.20 --- src/pulse/ext-device-manager.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/pulse/ext-device-manager.h b/src/pulse/ext-device-manager.h index 1442a1a9e..8264b8f7a 100644 --- a/src/pulse/ext-device-manager.h +++ b/src/pulse/ext-device-manager.h @@ -39,7 +39,7 @@ typedef struct pa_ext_device_manager_role_priority_info { } pa_ext_device_manager_role_priority_info; /** Stores information about one device in the device database that is - * maintained by module-device-manager. \since 0.9.19 */ + * maintained by module-device-manager. \since 0.9.20 */ typedef struct pa_ext_device_manager_info { const char *name; /**< Identifier string of the device. A string like "sink:" or similar followed by the name of the device. */ const char *description; /**< The description of the device when it was last seen, if applicable and saved */ @@ -49,32 +49,32 @@ typedef struct pa_ext_device_manager_info { pa_ext_device_manager_role_priority_info *role_priorities; /**< An array of role priority structures or NULL */ } pa_ext_device_manager_info; -/** Callback prototype for pa_ext_device_manager_test(). \since 0.9.19 */ +/** Callback prototype for pa_ext_device_manager_test(). \since 0.9.20 */ typedef void (*pa_ext_device_manager_test_cb_t)( pa_context *c, uint32_t version, void *userdata); -/** Test if this extension module is available in the server. \since 0.9.19 */ +/** Test if this extension module is available in the server. \since 0.9.20 */ pa_operation *pa_ext_device_manager_test( pa_context *c, pa_ext_device_manager_test_cb_t cb, void *userdata); -/** Callback prototype for pa_ext_device_manager_read(). \since 0.9.19 */ +/** Callback prototype for pa_ext_device_manager_read(). \since 0.9.20 */ typedef void (*pa_ext_device_manager_read_cb_t)( pa_context *c, const pa_ext_device_manager_info *info, int eol, void *userdata); -/** Read all entries from the device database. \since 0.9.19 */ +/** Read all entries from the device database. \since 0.9.20 */ pa_operation *pa_ext_device_manager_read( pa_context *c, pa_ext_device_manager_read_cb_t cb, void *userdata); -/** Sets the description for a device. \since 0.9.19 */ +/** Sets the description for a device. \since 0.9.20 */ pa_operation *pa_ext_device_manager_set_device_description( pa_context *c, const char* device, @@ -82,21 +82,21 @@ pa_operation *pa_ext_device_manager_set_device_description( pa_context_success_cb_t cb, void *userdata); -/** Delete entries from the device database. \since 0.9.19 */ +/** Delete entries from the device database. \since 0.9.20 */ pa_operation *pa_ext_device_manager_delete( pa_context *c, const char *const s[], pa_context_success_cb_t cb, void *userdata); -/** Enable the role-based device-priority routing mode. \since 0.9.19 */ +/** Enable the role-based device-priority routing mode. \since 0.9.20 */ pa_operation *pa_ext_device_manager_enable_role_device_priority_routing( pa_context *c, int enable, pa_context_success_cb_t cb, void *userdata); -/** Prefer a given device in the priority list. \since 0.9.19 */ +/** Prefer a given device in the priority list. \since 0.9.20 */ pa_operation *pa_ext_device_manager_reorder_devices_for_role( pa_context *c, const char* role, @@ -104,20 +104,20 @@ pa_operation *pa_ext_device_manager_reorder_devices_for_role( pa_context_success_cb_t cb, void *userdata); -/** Subscribe to changes in the device database. \since 0.9.19 */ +/** Subscribe to changes in the device database. \since 0.9.20 */ pa_operation *pa_ext_device_manager_subscribe( pa_context *c, int enable, pa_context_success_cb_t cb, void *userdata); -/** Callback prototype for pa_ext_device_manager_set_subscribe_cb(). \since 0.9.19 */ +/** Callback prototype for pa_ext_device_manager_set_subscribe_cb(). \since 0.9.20 */ typedef void (*pa_ext_device_manager_subscribe_cb_t)( pa_context *c, void *userdata); /** Set the subscription callback that is called when - * pa_ext_device_manager_subscribe() was called. \since 0.9.19 */ + * pa_ext_device_manager_subscribe() was called. \since 0.9.20 */ void pa_ext_device_manager_set_subscribe_cb( pa_context *c, pa_ext_device_manager_subscribe_cb_t cb, From f3866f263539578517ef36a670e04ca48fa2d1d3 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 10 Nov 2009 13:21:55 +0100 Subject: [PATCH 11/13] protocol: use the right sample rate for sources Use the correct sample rate for reporting about the timing. --- src/pulsecore/protocol-native.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c index bb29a196d..d49a78e5d 100644 --- a/src/pulsecore/protocol-native.c +++ b/src/pulsecore/protocol-native.c @@ -2631,7 +2631,7 @@ static void command_get_record_latency(pa_pdispatch *pd, uint32_t command, uint3 pa_tagstruct_put_usec(reply, s->current_monitor_latency); pa_tagstruct_put_usec(reply, s->current_source_latency + - pa_bytes_to_usec(s->on_the_fly_snapshot, &s->source_output->sample_spec)); + pa_bytes_to_usec(s->on_the_fly_snapshot, &s->source_output->source->sample_spec)); pa_tagstruct_put_boolean(reply, pa_source_get_state(s->source_output->source) == PA_SOURCE_RUNNING && pa_source_output_get_state(s->source_output) == PA_SOURCE_OUTPUT_RUNNING); From d9b5bbca017a8e578434e62ab6daeec24f2c11e1 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 11 Nov 2009 04:18:10 +0100 Subject: [PATCH 12/13] core: adjust volume only when there is actually a memory block Fixes an assert that is hit in somne niche cases: https://bugzilla.redhat.com/show_bug.cgi?id=533482 --- src/pulsecore/sink-input.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c index 1af2823f9..aa84ccb1e 100644 --- a/src/pulsecore/sink-input.c +++ b/src/pulsecore/sink-input.c @@ -717,14 +717,15 @@ void pa_sink_input_peek(pa_sink_input *i, size_t slength /* in sink frames */, p pa_memchunk rchunk; pa_resampler_run(i->thread_info.resampler, &wchunk, &rchunk); - if (nvfs) { - pa_memchunk_make_writable(&rchunk, 0); - pa_volume_memchunk(&rchunk, &i->sink->sample_spec, &i->volume_factor_sink); - } - /* pa_log_debug("pushing %lu", (unsigned long) rchunk.length); */ if (rchunk.memblock) { + + if (nvfs) { + pa_memchunk_make_writable(&rchunk, 0); + pa_volume_memchunk(&rchunk, &i->sink->sample_spec, &i->volume_factor_sink); + } + pa_memblockq_push_align(i->thread_info.render_memblockq, &rchunk); pa_memblock_unref(rchunk.memblock); } From 22946427624afde1d53973fa5a2e9e2041ffc5b7 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 11 Nov 2009 04:50:32 +0100 Subject: [PATCH 13/13] core: make cpuid code compile cleanly with 32bit PIC --- src/pulsecore/core-util.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index 93ddf3011..d596c481a 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -117,6 +117,7 @@ #include #include #include +#include #include "core-util.h" @@ -3085,10 +3086,13 @@ pa_bool_t pa_running_in_vm(void) { pa_zero(sig); __asm__ __volatile__ ( - " xor %%ebx, %%ebx \n\t" + /* ebx/rbx is being used for PIC! */ + " push %%"PA_REG_b" \n\t" " cpuid \n\t" + " mov %%ebx, %1 \n\t" + " pop %%"PA_REG_b" \n\t" - : "=a" (eax), "=b" (sig.sig32[0]), "=c" (sig.sig32[1]), "=d" (sig.sig32[2]) + : "=a" (eax), "=r" (sig.sig32[0]), "=c" (sig.sig32[1]), "=d" (sig.sig32[2]) : "0" (eax) );