Chris Robinson
f1b0f67553
Build an appropriate channel map for PulseAudio
2013-02-08 18:59:48 -08:00
Chris Robinson
209d09ae13
Avoid locking PulseAudio's mainloop when starting and stopping capture
...
The mainloop is already locked by the caller, and double-locking interferes
with the subsequent wait.
2012-11-19 16:50:03 -08:00
Chris Robinson
84f4afa5f2
Lock the device using the pulseaudio main loop
2012-10-07 02:25:59 -07:00
Chris Robinson
468759e6ab
Scale and round NumUpdates when PulseAudio changes the sample rate
2012-10-04 23:36:59 -07:00
Chris Robinson
b5d9d8e005
Reset maxlength if PulseAudio updates the playback rate
2012-10-02 17:01:35 -07:00
Chris Robinson
012e61b105
Round when calculating NumUpdates from PulseAudio's minreq
2012-09-25 11:32:49 -07:00
Chris Robinson
52d403b0d1
Make sure PulseAudio sets an update size that's a multiple of 4 samples with SSE
2012-09-20 15:01:49 -07:00
Chris Robinson
0f3a575a09
Don't include alu.h in alMain.h
2012-09-14 02:14:29 -07:00
Chris Robinson
f5e0500df4
Add a macro to help make a 64-bit value
2012-08-19 22:31:55 -07:00
Chris Robinson
0db7c4131b
Hold the device lock with PulseAudio between mixing and writing
2012-08-18 17:20:20 -07:00
Chris Robinson
0865db564f
Move the device lock into the backend function table
...
For backend-specific implementations: this should hold the audio mixer loop for
playback devices, and provide recursive mutex behavior.
2012-08-18 15:58:04 -07:00
Chris Robinson
ac4fc4026c
Add a device method to retrieve the active latency
...
This is effectively the time until the next update will be heard by the user,
or the closest approximation thereof, in nanoseconds.
2012-08-17 13:38:52 -07:00
Chris Robinson
f42f655ea9
Don't unlock the pulseaudio mainloop when mixing
...
Lock contention could cause a lengthy delay between mixing and writing the
audio. There shouldn't be any risk of dead-locking as the device lock should
never be held when the mainloop gets locked.
2012-08-12 03:52:38 -07:00
Chris Robinson
8001d86751
Add missing include
2012-06-19 22:15:19 -07:00
Chris Robinson
acca3e5a21
Use a proper method to wait for a PulseAudio operation
2012-06-19 10:37:09 -07:00
Chris Robinson
90ca6675c2
Allow PulseAudio to spawn a server by default
...
Since only one backend is used at a time now, the issues with device ownership
aren't really prevelant anymore. An application that tries to open all
enumerated devices won't run into the problem of spawning a server and end up
preventing other backend devices from working.
2012-06-16 22:37:45 -07:00
Chris Robinson
0db9730a50
Add an option to allow PulseAudio to move streams
...
This could be made the default, if there's a safe way to update the AL device
specifier.
2012-06-16 22:32:19 -07:00
Chris Robinson
259e4f5b38
Rename AllDevice -> AllDevices
2012-05-09 16:28:16 -07:00
Chris Robinson
b023dbe7b8
Remove hungarian notation from the device and context structs
2012-04-19 22:50:11 -07:00
Chris Robinson
2ba2da467c
Add a comment explaining the pulseaudio prop_filter
2012-03-06 12:01:15 -08:00
Chris Robinson
3131104595
Filter out a couple pulseaudio stream properties by setting them to 0-length data
...
It seems Qt/Phonon will globally set media.role and phonon.streamid properties,
causing them to apply even to our streams if they happen to be loaded in the
same process. This is particularly a problem because media.role gets set to
"event", preventing the streams from showing in pavucontrol.
2012-03-05 13:00:51 -08:00
Chris Robinson
f64bdc4bd4
Returned pa_operations can be NULL
2012-03-05 08:37:50 -08:00
Chris Robinson
fe6e532c87
Use a separate backend callback to start playback of the device
...
This allows us to properly update the ALCdevice and its resources with the new
parameters before starting playback, instead of expecting the mixer to block
and wait after it has begun.
This also lets us avoid holding the device lock while resetting and starting
the device, which helps prevent lock inversion on some backends (ie, one thread
locking A then B, and another thread locking B then A), ultimately allowing
certain backends to asynchronously update the ALCdevice without risk of lockup.
Capture still has issues here, however.
2012-03-05 07:11:09 -08:00
Chris Robinson
bc1bb7f90f
Print and handle errors from pa_stream_readable_size
2012-03-05 00:11:28 -08:00
Chris Robinson
0f0141b9dd
Set prebuf to 0 since we're handling the stream start manually
2012-03-04 09:24:07 -08:00
Chris Robinson
b643f13a6e
Make sure the pulse stream is properly started and better handle buffer size changes
2012-03-04 05:30:42 -08:00
Chris Robinson
44e10c4f69
Remove some unneeded pulseaudio calls
2012-03-02 09:46:36 -08:00
Chris Robinson
7a832c4522
Don't unload libpulse
...
This sometimes spawns esoteric errors in dlclose
2012-03-02 09:27:30 -08:00
Chris Robinson
7d0faba424
Remove some unneeded markers
2012-03-02 09:08:17 -08:00
Chris Robinson
01d942628b
Set prebuf to the expected buffer size
...
This is to make sure the stream starts even if PulseAudio increases tlength.
2012-03-02 05:38:11 -08:00
Chris Robinson
2a9012c94d
Don't rely on PulseAudio to wake us up using early requests
2012-03-02 04:51:29 -08:00
Chris Robinson
153affac12
Recalculate the new update size using the device's UpdateSize
2012-03-02 00:08:56 -08:00
Chris Robinson
51e6786f31
Set the func list after successfully connecting to PulseAudio
2012-03-01 09:22:37 -08:00
Chris Robinson
7d9cabebff
Use NULL to open the default PulseAudio device, and get the actual device name from the stream
2012-03-01 04:37:40 -08:00
Chris Robinson
9602c46809
Move some function definitions down
2012-03-01 04:12:47 -08:00
Chris Robinson
85daab0d5e
Don't define lib handles when dynamic loading is disabled
2012-03-01 03:46:45 -08:00
Chris Robinson
105faa1935
Only support PA_API_VERSION 12
2012-03-01 03:29:28 -08:00
Chris Robinson
b299b90964
Update the stored buffer attributes if PulseAudio changes it
2012-03-01 03:09:15 -08:00
Chris Robinson
346f1ac293
Don't allow the PulseAudio stream to move
...
Since the device specifier isn't updated to reflect the change, it's best to
not allow it to move. This should be fixed eventually.
2012-03-01 02:52:32 -08:00
Chris Robinson
6e113eea89
Don't force a sample spec when looking for the default device
2012-03-01 01:34:49 -08:00
Chris Robinson
54f906b347
Don't check if the pulseaudio sink is suspended when opening
2012-03-01 01:19:07 -08:00
Chris Robinson
4b252bc494
Constify a couple string pointers
2012-03-01 01:03:37 -08:00
Chris Robinson
b192165fb4
Look for and enumerate the default PulseAudio source first
2012-02-29 23:52:10 -08:00
Chris Robinson
f887f4efdd
Use a separate function to create and connect a PulseAudio record stream
2012-02-29 23:46:30 -08:00
Chris Robinson
b37e54eead
Look for and enumerate the default PulseAudio sink first
2012-02-29 23:35:01 -08:00
Chris Robinson
ea4f458c1d
Avoid enumerating multiple devices with the same name
2012-02-29 23:21:38 -08:00
Chris Robinson
394c76d64f
Avoid passing the ALCdevice to connect_playback_stream
2012-02-29 23:13:09 -08:00
Chris Robinson
d34fc21a50
Print the enumerated devices from PulseAudio
2012-02-29 22:31:51 -08:00
Chris Robinson
fe897f291b
Don't store the frame size with pulse_data
2012-02-29 06:51:21 -08:00
Chris Robinson
fbb6239299
Read capture data from pulseaudio as needed, avoiding a ring buffer
2012-02-29 05:57:54 -08:00