summaryrefslogtreecommitdiff
path: root/src/modules/macosx
AgeCommit message (Collapse)AuthorFilesLines
2016-06-28card: move profile selection after pa_card_new()Tanu Kaskinen1-0/+2
I want module-alsa-card to set the availability of unavailable profiles before the initial card profile gets selected, so that the selection logic can use correct availability information. module-alsa-card initializes the jack state after calling pa_card_new(), however, and the profile selection happens in pa_card_new(). This patch solves that by moving parts of pa_card_new() to pa_card_choose_initial_profile() and pa_card_put(). pa_card_choose_initial_profile() applies the profile selection policy, so module-alsa-card can first call pa_card_new(), then initialize the jack state, and then call pa_card_choose_initial_profile(). After that module-alsa-card can still override the profile selection policy, in case module-alsa-card was loaded with the "profile" argument. Finally, pa_card_put() finalizes the card creation. An alternative solution would have been to move the jack initialization to happen before pa_card_new() and use pa_card_new_data instead of pa_card in the jack initialization code, but I disliked that idea (I want to get rid of the "new data" pattern eventually). The order in which the initial profile policy is applied is reversed in this patch. Previously the first one to set it won, now the last one to set it wins. I think this is better, because if you have N parties that want to set the profile, we avoid checking N times whether someone else has already set the profile.
2016-02-12coreaudio: Catch devices with more channels than we supportArun Raghavan1-0/+10
2016-02-12coreaudio: Dynamically allocate C string when converting from CFStringArun Raghavan1-27/+31
2016-01-04module-coreaudio-device: get channel name as CFString and convert to plain C ↵Mihai Moldovan1-2/+44
string. This is an OpenPGP/MIME signed message (RFC 4880 and 3156) The old code fetched the channel name via AudioObjectGetPropertyData() and accessed the "returned" data as a plain char buffer. This may or may not have worked at some point according to the Apple CFString documentation, which warns that the actual data layout is an implementation detail and subject to change at any time. On recent OS X versions, this behavior led to "random data" channel names like >H��{, H��{<. We need to actually let AudioObjectGetPropertyData() populate a CFString struct and convert this into a plain char buffer. The conversion function will not free the CFString, so do that in the caller. Signed-off-by: Mihai Moldovan <ionic@ionic.de>
2015-09-25Rename functions with "tostring" in the name to one with "to_string" to ↵Deepak Srivastava1-2/+2
conform with the convention. component: core <EP-E358F00C1D9A449EAE69225B9D2530F8> BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=88833 Signed-off-by: Deepak Srivastava <srivastava.d@samsung.com>
2015-04-01coreaudio: Change error type to OSStatusRené J. V. Bertin1-6/+7
CoreAudio routines that return an error status do so with the OSStatus type, which is not a UInt32: typical OS X errors are negative numbers. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-01-14update FSF addresses to FSF web pageOndrej Holecek3-9/+3
FSF addresses used in PA sources are no longer valid and rpmlint generates numerous warnings during packaging because of this. This patch changes all FSF addresses to FSF web page according to the GPL how-to: https://www.gnu.org/licenses/gpl-howto.en.html Done automatically by sed-ing through sources.
2014-11-10rtpoll: Fixup pa_rtpoll_runDavid Henningsson1-1/+1
Commit fa092af59cf64902a5caa99 removed an argument to pa_rtpoll_run, but forgot to remove that argument for all callers to pa_rtpoll_run. This commit removes the remaining ones. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-12-05bonjour-publish: Return ports in network byteorderKenneth Perry1-2/+2
For DNS-SD (Bonjour) discovery, all ports should be set in network byteorder instead of host byteorder. Without this, all ports on little-endian systems (intel) are incorrect. Documentation: https://developer.apple.com/library/mac/documentation/networking/Reference/DNSServiceDiscovery_CRef/Reference/reference.html#//apple_ref/c/func/DNSServiceRegister
2013-09-17hashmap: Add the ability to free keysArun Raghavan1-1/+1
Since the hashmap stores a pointer to the key provided at pa_hashmap_put() time, it make sense to allow the hashmap to be given ownership of the key and have it free it at pa_hashmap_remove/free time. To do this cleanly, we now provide the key and value free functions at hashmap creation time with a pa_hashmap_new_full. With this, we do away with the free function that was provided at remove/free time for freeing the value.
2013-07-04Remove pa_bool_t and replace it with bool.poljar (Damir Jelić)3-29/+29
commands used for this (executed from the pulseaudio/src directory): find . -regex '\(.*\.[hc]\|.*\.cc\|.*\.m4\)' -not -name 'macro.h' \ -a -not -name 'reserve.[ch]' -a -not -name 'reserve-monitor.[ch]' \ -a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \ -a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \ -a -not -name 'poll-win32.c' -a -not -name 'thread-win32.c' \ -a -not -name 'dllmain.c' -a -not -name 'gconf-helper.c' \ -exec sed -i -e 's/\bpa_bool_t\b/bool/g' \ -e 's/\bTRUE\b/true/g' -e 's/\bFALSE\b/false/g' {} \; and: sed -i -e '181,194!s/\bpa_bool_t\b/bool/' \ -e '181,194!s/\bTRUE\b/true/' -e \ '181,194!s/\bFALSE\b/false/' pulsecore/macro.h
2013-06-24Style fix: Remove new lines from opening bracketspoljar (Damir Jelić)2-10/+5
This patch replaces every occurrence of ')\n{' with ') {'. Command used for this: find . -type d \( -name ffmpeg \) -prune -o \ -regex '\(.*\.[hc]\|.*\.cc\)' \ -a -not -name core-util.c -a -not \ -name adrian-aec.c -a -not -name g711.c \ -exec sed -i -e '/)$/{N;s/)\n{$/) {/}' {} \; The excluded files are mirrored files from external sources.
2013-05-29osx: Fix latency queryingVadim Troshchinskiy1-10/+23
get_latency_us() used an uninitialized variable, and an incorrect scope for some of the AudioObjectGetPropertyData() calls. As a result, audio would randomly not work at all. BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=65122
2013-02-16hashmap: Use pa_free_cb_t instead of pa_free2_cb_tTanu Kaskinen1-1/+1
The previous patch removed module-gconf's dependency on the userdata pointer of the free callback, and that was the only place where the userdata pointer of pa_free2_cb_t was used, so now there's no need for pa_free2_cb_t in pa_hashmap_free(). Using pa_free_cb_t instead allows removing a significant amount of repetitive code.
2012-11-16modules: Micro-optimisation for rewind_requested pathsArun Raghavan1-1/+1
Since some devices can be chatty with regards to how often they return from poll(), this adds a PA_UNLIKELY() to all the the rewind_requested checks in our sink modules to make the general case (no rewind was requested) the fast path.
2012-11-16sink: Process rewind requests also when suspended.Tanu Kaskinen1-3/+6
When a rewind is requested on a sink input, the request parameters are stored in the pa_sink_input struct. The parameters are reset during rewind processing, and if the sink decides to ignore the rewind request due to being suspended, stale parameters are left in pa_sink_input. It's particularly problematic if the rewrite_bytes parameter is left at -1, because that will prevent all future rewind processing on that sink input. So, in order to avoid stale parameters, every rewind request needs to be processed, even if the sink is suspended. Reported-by: Uoti Urpala
2012-07-09osx: Add a single "On" profile to coreaudio devices. Fixes crash on OS X.Sjors Gielen1-0/+12
Since commit 12af302a last month, cards always have at least one profile, so there is also always an active_profile (this makes the code more simple). However, module-coreaudio-device did not create a profile yet, causing a crash of PulseAudio when used on OS X. This patch fixes this crash, by adding a single "On" profile. I've also added a TODO for adding an "Off" profile which removes all sinks and sources -- I can work on resolving this TODO later on.
2012-06-09modules: Use pa_streq instead of strcmp.Arti Trivedi Bora1-1/+1
2012-01-28fix the ever-popular 'the the' typoPeter Meerwald1-1/+1
some are comments, some are user-visible doxygen text and documentation
2011-06-22Remove unnecessary #includesMaarten Bosmans2-4/+0
2011-04-23module-coreaudio-device: Fix two build warningsDaniel Mack1-2/+2
2011-04-23module-coreaudio-device: Set the thread name to device nameDaniel Mack1-1/+1
This makes gdb's "info threads" better understandable
2011-04-23module-coreaudio-device: Dispatch sink/source state messages from main loopDaniel Mack1-38/+50
This fixes a long standing race condition when tearing down streams on Mac OS X.
2011-04-23module-coreaudio-detect: Add 'ioproc_frames' parameterDaniel Mack1-3/+20
This value is passed on to the instances of module-coreaudio-device that are loaded upon device detection. The value is purely optional, as the device module will fall back to to its default if it's not given.
2011-03-21osx: re-order module locationsDaniel Mack3-0/+1649
move all Mac OS X related modules to own location.