Commit graph

154 commits

Author SHA1 Message Date
Pierre-Louis Bossart
9b6c84ad6e AC3 passthrough support
Second version after Tanu's feedback

TODO:
    - notify client that volume control is disabled
    - change sink rate in passthrough mode if needed
    - automatic detection of passthrough mode instead of hard
    coded profile names

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
2010-08-12 18:20:27 +01:00
Lennart Poettering
dbdc666fb6 various modernizations 2010-02-23 01:23:41 +01:00
Lennart Poettering
b5e30764c4 native: improve logging for buffer_attrs 2010-02-22 04:57:21 +01:00
Lennart Poettering
66cfa72eb4 native: rework handling of seeks that depend on variables the client does not know anything about
All seeks/flushes that depend on the playback buffer read pointer cannot
be accounted for properly in the client since it does not know the
actual read pointer. Due to that the clients do not account for it at
all. We need do the same on the server side. And we did, but a little
bit too extreme. While we properly have not applied the changes to the
"request" counter we still do have to apply it to the "missing" counter.
This patch fixes that.
2010-02-09 22:45:59 +00:00
Lennart Poettering
699233fb47 native: fix request counter miscalculations
Do not subtract bytes the client sends us beyond what we requested from
our missing bytes counter.

This was mostly a thinko that caused servers asking for too little data
when the client initially sent more data than requested, because that
data sent too much was accounted for twice.

This commit fixes this miscalculation.

http://bugzilla.redhat.com/show_bug.cgi?id=534130
2010-02-09 22:29:20 +00:00
Wim Taymans
f3866f2635 protocol: use the right sample rate for sources
Use the correct sample rate for reporting about the timing.
2009-11-10 13:21:55 +01:00
Lennart Poettering
f27a50691c libpulse: introduce PA_STREAM_RELATIVE_VOLUME 2009-10-29 00:46:22 +01:00
Lennart Poettering
546bcf3f2f protocol-native: if a client set volume/mute/device store it since it is user input 2009-10-28 23:50:42 +01:00
Lennart Poettering
27c6a80ccb protocol-native: declare that user configured volumes are always absolute 2009-10-28 23:47:21 +01:00
Lennart Poettering
807f2a9923 native: send PA_COMMAND_PLAYBACK_BUFFER_ATTR_CHANGED messages only to clients that understand it 2009-09-10 02:15:12 +02:00
Lennart Poettering
31d1d9088e protocol-native: log explicitly when someone asks us to quit 2009-09-08 23:53:28 +02:00
Lennart Poettering
f5046759cd llvm-clang-analyzer: drop a few unnecessary assignments and other trivial fixes 2009-09-08 23:46:23 +02:00
Lennart Poettering
2970c11902 core: always allow volume setting with single-channel pa_cvolume 2009-08-31 21:40:59 +02:00
Lennart Poettering
e1ce365cd9 native: make sure clients cannot trigger an assert by sending us invalid volume info 2009-08-29 06:11:02 +02:00
Lennart Poettering
a7b3125206 protocol-native: replace use of pa_namereg_is_valid_name() by pa_namereg_is_valid_name_or_wildcard() where applicable to allow use of @@ wildcards 2009-08-29 03:57:53 +02:00
Lennart Poettering
84eb6614eb core: move 'flags' field into 'pa_sink_input_new_data' structure so that hooks can access it 2009-08-28 23:24:09 +02:00
Lennart Poettering
c372b52a77 protocol-native: print more volume change debug messages to easy tracking down of feedback loops 2009-08-27 00:05:54 +02:00
Lennart Poettering
cab48d48d1 protocol-native: compare uint64_t variable with (uint64_t) -1 instead of (size_t) -1 for compat with 32bit archs 2009-08-27 00:04:33 +02:00
Lennart Poettering
9abc010c93 object: speed up type verification by not relying on strcmp()
Instead of using string contents for type identification use the address
of a constant string array. This should speed up type verifications a
little sind we only need to compare one machine word instead of a full
string. Also, this saves a few strings.

To make clear that types must be compared via address and not string
contents 'type_name' is now called 'type_id'.

This also simplifies the macros for declaring and defining public and
private subclasses.
2009-08-21 21:27:44 +02:00
Lennart Poettering
8c31974f56 sink: volume handling rework, new flat volume logic
- We now implement a logic where the sink maintains two distinct
  volumes: the 'reference' volume which is shown to the users, and the
  'real' volume, which is configured to the hardware. The latter is
  configured to the max of all streams. Volume changes on sinks are
  propagated back to the streams proportional to the reference volume
  change. Volume changes on sink inputs are forwarded to the sink by
  'pushing' the volume if necessary.

  This renames the old 'virtual_volume' to 'real_volume'. The
  'reference_volume' is now the one exposed to users.

  By this logic the sink volume visible to the user, will always be the
  "upper" boundary for everything that is played. Saved/restored stream
  volumes are measured relative to this boundary, the factor here is
  always < 1.0.

- introduce accuracy for sink volumes, similar to the accuracy we
  already have for source volumes.

- other cleanups.
2009-08-19 02:55:02 +02:00
Lennart Poettering
d7d86e32dd native-protocol: downgrade volume change log messages 2009-08-15 00:54:51 +02:00
Lennart Poettering
58d441f7ea log: place more rate limit invocations 2009-08-15 00:16:25 +02:00
Lennart Poettering
e4db56bf07 core: split of FAIL_ON_SUSPEND into KILL_ON_SUSPEND and NO_CREATE_ON_SUSPEND 2009-08-15 00:12:53 +02:00
Lennart Poettering
e53d2fc6b5 native: handle moving() callback with NULL destination properly 2009-08-15 00:05:17 +02:00
Lennart Poettering
72d2540e8d protocol-native: log explicitly each time a client triggers a volume change 2009-08-14 19:31:05 +02:00
Wim Taymans
3b01d3a53f protocol-native: use the right samplerate
The render_memblockq is expressed in the sample_spec of the sink, not of the
particular stream before resampling.
2009-07-23 13:57:42 +02:00
Lennart Poettering
a10b7cda4e native: don't hit assert when user uploads zero-sized sample 2009-07-01 14:25:13 +02:00
Marc-André Lureau
0955e3d45b Base mainloop on pa_rtclock_now()
Move the mainloop to monotonic based time events.

Introduces 4 helper functions:
pa_{context,core}_rttime_{new,restart}(), that fill correctly a
timeval with the rtclock flag set if the mainloop supports it.

Both mainloop-test and mainloop-test-glib works with rt and timeval
based time events. PulseAudio and clients should be fully functional.

This patch has received several iterations, and this one as been
largely untested.

Signed-off-by: Marc-André Lureau <marca-andre.lureau@nokia.com>
2009-06-20 17:29:31 +03:00
Lennart Poettering
46b8ca21d1 native-protocol: allow enumerating ports 2009-06-17 23:17:37 +02:00
Lennart Poettering
6d7cf14dbf native: implement command to change sink/source port 2009-06-17 04:52:41 +02:00
Lennart Poettering
31575f7766 alsa: rework mixer logic
Completely rework mixer logic. This now allows controlling a full set of
elements from a single sink's volume slider/mute button.

This also introduces sink and source "ports" that can be used to choose
different input or output ports with the UI. (i.e. "mic"/"line-in" or
"speaker"/"headphones".

The mixer paths and device maps are now configered in external
configuration files and can be tweaked as necessary.
2009-06-17 03:45:14 +02:00
Lennart Poettering
00797b8b6e core: add a suspend cause flags field 2009-06-05 19:05:07 +02:00
Lennart Poettering
ad5a1f312a protocol-native,proplist-util: port to pa_get_{user|host}_name_malloc() 2009-04-29 01:56:02 +02:00
Lennart Poettering
fe8b10cc05 core: introduce new 'reference' volume for sinks
The reference volume is to be used as reference volume for stored stream
volumes. Previously if a new stream was created the relative volume was
taken relatively to the virtual device volume. Due to the flat volume
logic this could then be fed back to the virtual device volume.
Repeating the whole story over and over would result in a device volume
that would go lower, and lower and lower.

This patch introduces a 'reference' volume for each sink which stays
unmodified by stream volume changes even if flat volumes are used. It is
only modified if the sink volumes are modified directly by the user.

For further explanations see http://pulseaudio.org/wiki/InternalVolumes
2009-04-13 22:56:25 +02:00
Lennart Poettering
f8ebe8571c protocol-native: downgrade message if we receive pcm block for dead stream 2009-04-10 01:16:59 +02:00
Lennart Poettering
5b871966ab protocol-native: print underrun message only once for each underrun 2009-04-10 01:16:24 +02:00
Lennart Poettering
e61728e67a Make sure we don't get stuck when prebuf is too high
If prebuf is greater than tlength minus minreq we might end up waiting
for the buffer to fill up further however without ever asking for more
data from the client since less minreq bytes might be missing.

This fixes bug #440
2009-04-06 22:13:41 +02:00
Lennart Poettering
14e11e4533 Fix a couple of races in native protocol
Also make sure we account for recording memblock that are currently 'on
the fly' between the main and the IO thread.

Also makes a couple of timing calls that were done in different calls
in a single inter-thread call. That way there is a better guarantee that
they match up.
2009-04-05 02:59:02 +02:00
Lennart Poettering
373b5efe51 properly account for seeks in the requested_bytes counter 2009-04-01 23:05:09 +02:00
Lennart Poettering
75a8d18285 pass destination source/sink when moving streams so that we can access them 2009-04-01 03:04:39 +02:00
Lennart Poettering
76c44d104d be a bit more verbose about max_request changes 2009-03-31 21:36:45 +02:00
Lennart Poettering
cebaa98b38 Log underruns 2009-03-31 21:36:09 +02:00
Lennart Poettering
65b787d000 notify clients about tlength changes 2009-03-30 18:46:12 +02:00
Lennart Poettering
7c37c37fff document more often the context certain functions are called in 2009-03-30 18:26:23 +02:00
Lennart Poettering
d04f3e1aef Trigger move callback a little bit earlier so that no IO thread is running 2009-03-30 18:21:34 +02:00
Lennart Poettering
08154554b0 only store card profile if flagged for that 2009-03-23 19:31:36 +01:00
Lennart Poettering
fe3709c5c7 fix a comment 2009-03-19 19:38:30 +01:00
Lennart Poettering
ff38eaf677 Merge commit 'coling/lgpl21' 2009-03-03 21:44:56 +01:00
Colin Guthrie
86dee05aec Use LGPL 2.1 on all files previously using LGPL 2 2009-03-03 20:23:02 +00:00
Lennart Poettering
297515a39e pass profile priority value to clients 2009-03-03 00:32:10 +01:00