Commit graph

6156 commits

Author SHA1 Message Date
Colin Guthrie
47c9d8cf92 device-restore: Simplify the migration of data to per-port keys.
Rather than write all the keys out for each port, simply write a 'null'
port entry and modify the read code to 'fallback' to this when it cannot
find a key. This is needed as the code used when writing the key may not
actually have the sink ports available at the time it uses them,
and thus can cause a segv. This approach adds some degree of overhead
but it's relatively minimal and it can be mitigated by compiling
without support for legacy database formats if so desired.

Thanks to David Henningsson for pointing out the problem.
2011-09-03 12:47:10 +02:00
Maarten Bosmans
9133c6c935 Make gcc --std=c99 happy
We're now more or less C99 compliant
2011-09-03 12:17:28 +02:00
Maarten Bosmans
dfd706da71 Squash the last gcc warnings 2011-09-03 12:17:13 +02:00
Maarten Bosmans
647048ebc4 module-equalizer-sink: Use correct limit in loop 2011-09-03 12:16:54 +02:00
Maarten Bosmans
3d04a05736 bluetooth/sbc: Use __asm__ keyword 2011-09-03 12:16:49 +02:00
Maarten Bosmans
918f168c15 module-equalizer-sink: Use = in initialising variables
This makes the compiler in C99 mode happy
2011-09-03 12:15:51 +02:00
Maarten Bosmans
fc3ddfb7f5 module-equalizer-sink: Use %z for printf of size_t variables 2011-09-03 12:15:36 +02:00
David Henningsson
96369919e5 alsa-mixer: Set "Front" control to 0 dB on headphone path
I've seen more than one system where the volume control named
"Front" is a part of audio path for headphones. This is somewhat
of a compromise: While we don't merge it into the path, as that
would be regressing machines where "Front" isn't a part of the
audio path, it would still enable sound on these machines.

BugLink: http://bugs.launchpad.net/bugs/804178
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-09-03 12:14:54 +02:00
David Henningsson
c7bba2464d module-switch-on-connect: Don't switch unlinked sink input and source outputs
Unlinked streams can not be moved, so don't try.

BugLink: http://bugs.launchpad.net/bugs/837386
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-08-31 18:49:44 +05:30
Arun Raghavan
fb107fc770 vala: Add has_type_id=false to all enums, structs and classes
Since none of our types is derived from GType, explicitly signal this.
The default value for this attribute changed at some point, breaking our
bindings.
2011-08-31 11:35:35 +05:30
Colin Guthrie
b68336870f build-sys: bump soname 2011-08-29 18:07:02 +01:00
Arun Raghavan
3fd07a33ee equalizer: Comment out unused function
Gets rid of a compiler warning
2011-08-29 22:14:04 +05:30
Arun Raghavan
394d8a6b6b echo-cancel: Get rid of annoying compiler warnings 2011-08-29 22:13:44 +05:30
Arun Raghavan
837ac4c225 echo-cancel: Don't allow streams to attach while unloading
When unloading, some module may end up trin to move a sink-input or
source-output back onto our virtual sink/source, causing an infinite
loop of us moving the stream away and having it moved back.

We prevent this from happening by preventing any stream from being
attached during unload.
2011-08-29 21:42:57 +05:30
Arun Raghavan
fe52c351c3 echo-cancel: Make save_aec modarg a bool instead of an int 2011-08-29 21:42:57 +05:30
Lu Guanqun
cef16430d0 pacat: make pacat respond to cork/uncork events
Pacat remembers the number of cork requests, and then cork/uncork the stream
accordingly.

With this change, it makes below test script work correctly:

	pacat -p --property=media.role="music" <long-sound> &
	sleep 2
	pacat -p --property=media.role="phone" <short-sound>
	wait

Initial idea by Lu Guanqun, but modified by Colin Guthrie (so blame
me if it's broken)
2011-08-29 10:31:46 +01:00
David Henningsson
c862c5caa4 Set better priorities on input paths
The priorities should be set in the approximately likeliness that someone
would like to use them. This is hard to guess of course, but this is
a better guess compared to the existing configuration.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-08-29 10:05:24 +01:00
Arun Raghavan
ed4a4480dc passthrough: Fix setting volume to unamplified again
Thanks to Tanu for pointing out the (possibly pathological?) case that
base_volume might be >0dB.
2011-08-29 14:32:27 +05:30
Colin Guthrie
a13a402ed3 device-restore: Restore volumes on port change.
This will allow for volumes to be saved separately for e.g. Headphones vs. Speakers.

At present it is possible that no volume will be saved for the device prior to the port
switch. In this case the volume will not change from the value set under the other port.
In an ideal world we would save the volume before switching port, but that would require
a new hook.
2011-08-29 09:59:47 +01:00
Colin Guthrie
1ee97e57ca device-restore: Split device restore database into two parts.
The device restore saves both the current port for a device, and the volume/mute/formats.
The latter three are really related to the device+port, not the device on it's own.

Thus we store just the port for a device in one key and the volume/mute/formats
under a different key that includes both the device and the port.
2011-08-29 09:59:47 +01:00
Arun Raghavan
af8d0a12e9 passthrough: Fix what volume we set sinks/sources to
Devices' 0 dB is base_volume not PA_VOLUME_NORM.
2011-08-25 21:19:31 +05:30
Maarten Bosmans
e04d592a47 sndfile-util: Check return value of sf_command for errors
It's better to show a message what the error is,
instead of just asserting that no errors happen in an external library call.
2011-08-25 18:21:49 +05:30
Maarten Bosmans
55fdb0162c Remove extra ; s where they are not allowed in strict C99 2011-08-25 18:21:49 +05:30
Maarten Bosmans
168254f3bf echo-cancel: Use stream index in debug message
instead of the less useful stream pointer.
2011-08-25 18:19:41 +05:30
Maarten Bosmans
35bafe06e7 gitignore: Add Orc autogenerated files 2011-08-25 18:19:40 +05:30
Arun Raghavan
7dfb166dba echo-cancel: Move speex preprocessing out of the main module
I initially included put the Speex preprocessing assuming that we'd want
to use the digital gain control and noise suppression from Speex for all
echo cancelling implementations. In practice, we're probably going to
get entire implementations all processing in one package (WebRTC, custom
modules from various vendors, etc.).

This moves out this preprocessing and related knobs into the speex
implementation, which serves to clean out all implementation-specific
details from the module-echo-cancel core.
2011-08-25 18:08:42 +05:30
Arun Raghavan
af6229cbe1 echo-cancel: Use pa_streq instead of strcmp 2011-08-25 17:53:37 +05:30
Arun Raghavan
ba69d66c33 echo-cancel: Add multiple include protection for header 2011-08-25 17:53:37 +05:30
Maarten Bosmans
c5dca7cf2b More spelling fixes 2011-08-25 11:27:47 +01:00
Maarten Bosmans
231645d4fc Spelling fixes in public headers 2011-08-25 11:27:35 +01:00
Arun Raghavan
460a24778b build-sys: Fix some LDFLAGS vs. LDADD usage
Thanks to Stefan Kost for pointing these out.
2011-08-24 17:56:34 +05:30
David Henningsson
112c300ae1 Fix spelling sucess -> success
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-08-24 17:38:16 +05:30
David Henningsson
b746e09448 switch-on-connect: Don't switch to a monitor source
Buglink: http://bugs.launchpad.net/bugs/831675
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-08-24 17:38:05 +05:30
Colin Guthrie
d6b9e61b90 device-restore: Change the API to include type information (sink vs. source)
This changes the API, but as we have not released yet, this is OK.
2011-08-18 17:33:08 +01:00
Colin Guthrie
9600d0c4b1 dbus: Use pa_device_type_t rather than an internal equivalent 2011-08-18 17:10:51 +01:00
Colin Guthrie
cc117be62b def: Add a new enum to allow differntiation between sinks and sources.
This is for bits of code or API where the concepts and constructs are
extensibly the same for sinks and sources. To avoid duplication we can
simply define our structure/API and then use this enum to differentiate
the two.
2011-08-18 17:10:13 +01:00
Arun Raghavan
a6ad2d860a sink: Add PA_SINK_SET_FORMATS macro
Required for testing the existence of the flag
2011-08-18 14:56:41 +05:30
Arun Raghavan
9083a8f667 sample-util: Fix off-by-one in error check
Patch by jk.illwinter on http://www.pulseaudio.org/ticket/951
2011-08-18 14:19:00 +05:30
Arun Raghavan
2568542b18 Revert "device-restore: Make bools not be bit fields"
This reverts commit ba163b8b23.

After discussion with Colin, decided that we don't want to do this
piecemeal -- need some discussion on the mailing-list and then we should
do this across the tree in one fell swoop post 1.0.

Conflicts:

	src/modules/module-device-restore.c
2011-08-18 13:34:48 +05:30
Arun Raghavan
f0be9c4004 source-output: Ensure no volumes are applied for passthrough streams
This forces passthrough source-outputs and their corresponding sources
to 0dB gain so that the data is sent unaltered to the receiver.
2011-08-18 12:46:46 +05:30
Arun Raghavan
0dea35a818 sink-input: Ensure no volumes are applied for passthrough streams
This forces passthrough sink-inputs and their corresponding sinks to 0dB
gain so that the data is sent unaltered to the receiver.
2011-08-18 12:46:46 +05:30
Arun Raghavan
b08237b6c6 passthrough: We must not plug in a resampler on stream move 2011-08-18 12:45:58 +05:30
Arun Raghavan
3c854fc00c daemon: Fix compiler warning about missing function prototype 2011-08-18 12:45:55 +05:30
Arun Raghavan
3179ed71c5 alsa: Fix bad function name
I've no idea how that slipped by.
2011-08-18 10:23:55 +05:30
Arun Raghavan
358d92170a formats: Fix bad passsthrough check
Fixes breakage from commit adbdb6259b
2011-08-18 10:10:22 +05:30
Arun Raghavan
814c0371a4 alsa: Open iec958 device with NONAUDIO bit set in passthrough mode
This is required for E-AC3 streams, as well as to let receivers we're
sending non-PCM data (which avoids playing noise if the data is
incorrect for some reason).
2011-08-17 23:08:45 +05:30
Arun Raghavan
adbdb6259b formats: Use correct API to check for passthrough streams 2011-08-17 23:08:37 +05:30
Arun Raghavan
dde09c7fac alsa: Don't always suspend/unsuspend on sink-input removal
If the sink was already suspended, this avoids and assert when calling
suspend() again, and prevents an unnecessary unsuspend.
2011-08-17 13:33:50 +05:30
Arun Raghavan
2677911e92 source: Remove the PA_SOURCE_PASSTHROUGH flag
This isn't actually used anywhere, and PA_SINK_PASSTHROUGH was also
removed.
2011-08-17 09:00:47 +05:30
Jonny Lamb
7ed177dc29 introspect: fix typo in default sink/source docs
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
2011-08-16 21:01:37 +05:30