Chris Robinson
051195a991
Avoid failing if ALSA can't set a buffer or period time near to our request
...
These functions should not fail, but there seem to be bugs that cause them to
sometimes. We're flexible enough to handle almost anything it throws back at us
though, so anything is better than nothing here.
2012-06-16 23:02:59 -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
46840ee787
Add DEVPKEY_Device_FriendlyName declaration for mingw-w64 compatibility
2012-06-14 18:10:10 -07:00
Chris Robinson
259e4f5b38
Rename AllDevice -> AllDevices
2012-05-09 16:28:16 -07:00
Chris Robinson
e44229c74e
Clamp the ALSA period time between min and max if setting near fails
2012-05-08 01:23:53 -07:00
Chris Robinson
92827cc467
Clamp the ALSA buffer time between min and max if setting near fails
...
It seems there's some bugs with snd_pcm_hw_params_set_buffer_time_near that
cause it to return "invalid argument" despite a valid nearby buffer time being
available. Clamping the buffer time seems to mitigate the issue a bit.
2012-05-07 11:42:59 -07:00
Chris Robinson
dd3d5bc2d4
Look for libsndio.so.2 instead of libsndio.so
2012-05-05 16:19:51 -07:00
Chris Robinson
648464a2da
Check the right playback device file with OSS
2012-04-22 05:06:44 -07:00
Chris Robinson
511b4790d0
Remove hungarian notation from dsound and mmdevapi
2012-04-19 23:42:02 -07:00
Chris Robinson
cff0f938e5
Remove hungarian notation from the winmm backend
2012-04-19 23:22:11 -07:00
Chris Robinson
5418519637
Remove some more hungarian notation
2012-04-19 23:00:58 -07:00
Chris Robinson
b023dbe7b8
Remove hungarian notation from the device and context structs
2012-04-19 22:50:11 -07:00
Chris Robinson
a08080bd82
Avoid modifying the ALCdevice in portaudio's open method
2012-03-13 22:18:51 -07:00
Chris Robinson
415bf58a06
Store the portaudio stream parameters with the device
2012-03-13 21:52:47 -07:00
Chris Robinson
3b165809cc
Minor coreaudio fix, and make sure to set the device name
2012-03-13 13:48:42 -07:00
Chris Robinson
5c59e6e704
Try to ensure the full mmdevapi buffer is used
2012-03-13 01:39:57 -07:00
Chris Robinson
ef2f237276
Try to ensure at least 2 mmdevapi updates
2012-03-13 01:35:31 -07:00
Chris Robinson
0af14c7a11
Try to find a multiple of mmdevapi's period size nearest to the wanted update size
2012-03-13 01:32:15 -07:00
Chris Robinson
663b43f4f1
Attempted fix for the coreaudio backend
2012-03-12 21:58:40 -07:00
Chris Robinson
dddacc25a5
Store a duplicate of the mmdevapi device ID
2012-03-06 13:15:55 -08:00
Chris Robinson
2ba2da467c
Add a comment explaining the pulseaudio prop_filter
2012-03-06 12:01:15 -08:00
Chris Robinson
f2b64fd111
Update the ALCdevice in winmm's reset method instead of open
2012-03-06 10:14:05 -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
49433c2074
Slight correction for handling the wave writer backend's timer wrapping
2012-03-03 08:50:15 -08:00
Chris Robinson
a93ff6ef3c
Slight correction for handling the null backend's timer wrapping
2012-03-03 08:47:23 -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
b571926a6d
Avoid a leak if PortAudio fails to give a usable channel count
2012-03-02 02:14:04 -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
e5d365a3d9
Avoid an unnecessary doCapture check
2012-03-01 20:47:49 -08:00
Chris Robinson
06debb153d
Fix a memory leak
2012-03-01 09:56:25 -08:00
Chris Robinson
51e6786f31
Set the func list after successfully connecting to PulseAudio
2012-03-01 09:22:37 -08:00
Chris Robinson
8d24bd720f
Don't use GUIDs to ID mmdevapi devices, and don't enumerate if not needed
2012-03-01 06:07:00 -08:00
Chris Robinson
55556f0e6c
Avoid enumerating when opening the default ALSA device
2012-03-01 04:58:28 -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