summaryrefslogtreecommitdiffstats
path: root/src/modules/module-alsa-source.c
Commit message (Collapse)AuthorAgeFilesLines
* Properly handle if ALSA sends us an POLLERR event, this should allow us to ↵Lennart Poettering2007-10-171-1/+29
| | | | | | survive a system suspend cycle better git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1941 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Fix race condition between IO thread creation and pa_sink_put(). Move ↵Lennart Poettering2007-10-011-5/+7
| | | | | | activation of rtpoll fds when we change the state INIT->IDLE. git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1922 fefdeb5f-60dc-0310-8127-8f9354f1896f
* drop the PA_SOURCE_CAN_SUSPEND and PA_SINK_CAN_SUSPEND flags, since they ↵Lennart Poettering2007-09-241-73/+72
| | | | | | were a bad idea in the first place. All sinks/sources are now *required* to handle suspending in one way or another. Luckily all current sink/source implementations handle it fine anyway. git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1894 fefdeb5f-60dc-0310-8127-8f9354f1896f
* fall back to plughw:, if hw: doesn't work, in the alsa source, tooLennart Poettering2007-09-181-14/+40
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1865 fefdeb5f-60dc-0310-8127-8f9354f1896f
* simplify rt loops a bit by moving more code into pa_rtpoll. It is now ↵Lennart Poettering2007-09-141-17/+6
| | | | | | possible to attach "work" functions to a pa_rtpoll_item, which will be called in each loop iteration. This allows us to hide the message processing in the RT loops and to drop the seperate sink_input->process hooks. Basically, only the driver-specific code remains in the RT loops. git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1822 fefdeb5f-60dc-0310-8127-8f9354f1896f
* extend rtpoll API to allow registration of arbitray functions to be executed ↵Lennart Poettering2007-09-121-2/+2
| | | | | | in the event loop. Add priority system for specifying the order of these functions. git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1816 fefdeb5f-60dc-0310-8127-8f9354f1896f
* remaining s/assert/pa_assert/ and refcnt.h modernizationsLennart Poettering2007-09-111-2/+1
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1809 fefdeb5f-60dc-0310-8127-8f9354f1896f
* add 'wait' parameter to pa_rtpoll_run(), if zero pa_rtpoll_runn will only ↵Lennart Poettering2007-09-111-1/+1
| | | | | | update the struct pollfd but not wait for an event git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1803 fefdeb5f-60dc-0310-8127-8f9354f1896f
* fix an assert when runnig module-oss in record only-mode. optimize ↵Lennart Poettering2007-09-061-3/+10
| | | | | | allocation of memblocks on playback git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1777 fefdeb5f-60dc-0310-8127-8f9354f1896f
* fix a couple of compiler warningsLennart Poettering2007-09-041-2/+2
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1768 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Lots of assorted minor cleanups and fixes:Lennart Poettering2007-08-301-29/+22
| | | | | | | | | | | | | | | | | | * s/disconnect/unlink/ at many places where it makes sense * make "start_corked" a normal pa_sink_input/pa_source_output flag instead of a seperate boolean variable * add generic process() function to pa_sink_input/pa_source_output vtable that can be used by streams to do some arbitrary processing in each rt loop iteration even the sink/source is suspended * add detach()/attach() functions to pa_sink_input/pa_source_output vtable that are called when ever the rtpoll object of the event thread changes * add suspend() functions to pa_sink_input/pa_source_output vtable which are called whenever the sink/source they are attached to suspends/resumes * add PA_SINK_INIT/PA_SOURCE_INIT/PA_SINK_INPUT_INIT/PA_SINK_OUTPUT_INIT states to state machines which is active between _new() and _put() * seperate _put() from _new() for pa_sink/pa_source * add PA_SOURCE_OUTPUT_DONT_MOVE/PA_SINK_INPUT_DONT_MOVE flags * make the pa_rtpoll object a property of pa_sink/pa_source to allow streams attached to them make use of it * fix skipping over move_silence * update module-pipe-source to make use of pa_rtpoll * add pa_sink_skip() as optimization in cases where the actualy data returned by pa_sink_render() doesn't matter git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1733 fefdeb5f-60dc-0310-8127-8f9354f1896f
* port remaining sinks to pa_rtpollLennart Poettering2007-08-221-155/+140
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1705 fefdeb5f-60dc-0310-8127-8f9354f1896f
* check pa_core::high_priority before becoming rt threadLennart Poettering2007-08-221-1/+2
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1694 fefdeb5f-60dc-0310-8127-8f9354f1896f
* use realtime scheduling for ALSA and OSS driver threadsLennart Poettering2007-08-161-0/+2
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1679 fefdeb5f-60dc-0310-8127-8f9354f1896f
* fix latency reporting for oss and alsa modulesLennart Poettering2007-08-111-6/+7
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1645 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Add 'via DMA' to sink/source description if device is accessed with mmap()Lennart Poettering2007-08-111-2/+3
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1642 fefdeb5f-60dc-0310-8127-8f9354f1896f
* modify alsa drivers to make use of new global fragment setting variablesLennart Poettering2007-08-111-5/+2
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1633 fefdeb5f-60dc-0310-8127-8f9354f1896f
* make use of pa_thread_mq everywhereLennart Poettering2007-08-101-14/+18
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1624 fefdeb5f-60dc-0310-8127-8f9354f1896f
* * drop redundant pa_core argument from module initialization functionsLennart Poettering2007-08-101-9/+7
| | | | | | | | | | | | * make pa__done() implementations optional * a couple of modernizations * wrap lt_dlsym() at a single place * allow passing of an "api" argument to the HAL module, to choose whether OSS devices or ALSA devices should be picked up * optimize fd closing a little on linux in the forked gconf helper * save a little memory in the xsmp module git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1615 fefdeb5f-60dc-0310-8127-8f9354f1896f
* don't hit an assert when we cannot resume a deviceLennart Poettering2007-08-091-2/+4
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1599 fefdeb5f-60dc-0310-8127-8f9354f1896f
* properly reinitialize pollfd array after resumeLennart Poettering2007-08-081-27/+53
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1590 fefdeb5f-60dc-0310-8127-8f9354f1896f
* reinitialize sw params after resumeLennart Poettering2007-08-071-3/+6
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1587 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Don't stop hardware on buffer underruns. Instead continue playing to ↵Lennart Poettering2007-08-031-19/+29
| | | | | | guarantee that our time function stays as linear as possible. git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1566 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Remove unnecessary snd_pcm_hwsync()Lennart Poettering2007-08-031-1/+0
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1565 fefdeb5f-60dc-0310-8127-8f9354f1896f
* On recommendation of Takashi Iwai prefer Master volume control over PCM and ↵Lennart Poettering2007-08-031-1/+1
| | | | | | don't control Mic control git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1564 fefdeb5f-60dc-0310-8127-8f9354f1896f
* A lot of updates, all necessary to get the native protocol ported:Lennart Poettering2007-07-311-6/+7
| | | | | | | | | | | | | * add an int64_t argument to pa_asyncmsgq because it is very difficult to pass 64 values otherwise * simplify subclassing in pa_object * s/drop/unlink/ at some places * port the native protocol to the lock-free core (not tested, compiles fine) * move synchronisation of playback streams into pa_sink_input * add "start_corked" field to pa_sink_input_new_data * allow casting of NULL values in pa_object git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1562 fefdeb5f-60dc-0310-8127-8f9354f1896f
* port module-alsa-source to new lock-free coreLennart Poettering2007-07-281-241/+553
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1561 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Merge HUGE set of changes temporarily into a branch, to allow me to move ↵Lennart Poettering2007-06-111-3/+7
| | | | | | them from one machine to another (lock-free and stuff) git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1469 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Handle suspended alsa devices. Based on patch by ranma. (closes #26)Pierre Ossman2007-03-021-0/+39
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1433 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Add copyright notices to all relevant files. (based on svn log)Pierre Ossman2007-02-131-0/+3
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1426 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Huge trailing whitespace cleanup. Let's keep the tree pure from here on,Pierre Ossman2007-01-041-29/+29
| | | | | | | mmmkay? git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1418 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Revert r1404 and keep it on a development branch until it is fully tested.Pierre Ossman2006-11-061-7/+3
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1409 fefdeb5f-60dc-0310-8127-8f9354f1896f
* rework memory block management to be thread-safe and mostly lock-free.Lennart Poettering2006-09-261-3/+7
| | | | | | | | | | | | | | | | | | | | | pa_memblock is now an opaque structure. Access to its fields is now done through various accessor functions in a thread-safe manner. pa_memblock_acquire() and pa_memblock_release() are now used to access the attached audio data. Why? To allow safe manipulation of the memory pointer maintained by the memory block. Internally _acquire() and _release() maintain a reference counter. Please do not confuse this reference counter whith the one maintained by pa_memblock_ref()/_unref()! As a side effect this patch removes all direct usages of AO_t and replaces it with pa_atomic_xxx based code. This stuff needs some serious testing love. Especially if threads are actively used. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1404 fefdeb5f-60dc-0310-8127-8f9354f1896f
* remove all occurences of Lennart Poettering2006-08-181-19/+19
| | | | | | | | | | | | pa_logXXX(__FILE__": and replace them by pa_logXXX(" git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1272 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Rework memory management to allow shared memory data transfer. The central ideaLennart Poettering2006-08-181-1/+1
| | | | | | | | | | | | | | | is to allocate all audio memory blocks from a per-process memory pool which is available as read-only SHM segment to other local processes. Then, instead of writing the actual audio data to the socket just write references to this shared memory pool. To work optimally all memory blocks should now be of type PA_MEMBLOCK_POOL or PA_MEMBLOCK_POOL_EXTERNAL. The function pa_memblock_new() now generates memory blocks of this type by default. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1266 fefdeb5f-60dc-0310-8127-8f9354f1896f
* make use of pa_sink_used_by()/pa_source_used_by() wherever applicableLennart Poettering2006-08-121-2/+1
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1227 fefdeb5f-60dc-0310-8127-8f9354f1896f
* generate default sink/source names from the device files they belong toLennart Poettering2006-08-121-3/+14
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1223 fefdeb5f-60dc-0310-8127-8f9354f1896f
* don't set the sink/source descriptions manually, use the new functions ↵Lennart Poettering2006-08-111-1/+3
| | | | | | pa_{sink,source}_set_description() instead git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1205 fefdeb5f-60dc-0310-8127-8f9354f1896f
* shorten sink/source device descriptions a littleLennart Poettering2006-08-111-1/+1
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1201 fefdeb5f-60dc-0310-8127-8f9354f1896f
* ALSA: handle write()/read() errors properly by unloading the driver module. ↵Lennart Poettering2006-08-111-24/+52
| | | | | | This should fix problems when removing USB audio device while pulseaudio is running. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1194 fefdeb5f-60dc-0310-8127-8f9354f1896f
* try to reduce volume updates in the ALSA sinks/sources: only touch the ↵Lennart Poettering2006-08-071-9/+13
| | | | | | shadowed hw volme if necessary git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1189 fefdeb5f-60dc-0310-8127-8f9354f1896f
* set is_hardware flag for a few hw pluginsLennart Poettering2006-07-161-0/+1
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1092 fefdeb5f-60dc-0310-8127-8f9354f1896f
* fix segfault when module-alsa-source fails to loadLennart Poettering2006-06-201-1/+1
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1049 fefdeb5f-60dc-0310-8127-8f9354f1896f
* big s/polyp/pulse/gLennart Poettering2006-06-191-15/+15
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1033 fefdeb5f-60dc-0310-8127-8f9354f1896f
* * alsa-sink: if "PCM" is not found as mixer track name, fallback to "Master"Lennart Poettering2006-05-301-1/+1
| | | | | | | * alsa-source: if "Capture" is not found as mixer track name, fallback to "Mic" git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@993 fefdeb5f-60dc-0310-8127-8f9354f1896f
* * if an ALSA device doesn't support the channel count requested, use what ↵Lennart Poettering2006-05-301-4/+11
| | | | | | | | | | ALSA suggests instead * if an ALSA device doesn't support the sampling freq requested, use what ALSA suggests and resample if this deviates more than 10% from what we requested * fix segfault freeing an unitialized mixer_fdl field git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@992 fefdeb5f-60dc-0310-8127-8f9354f1896f
* * split pa_cstrerror() into its own file polypcore/core-error.[ch]Lennart Poettering2006-05-251-1/+1
| | | | | | | | * fix building of padsp * remove a warning when compiling padsp.c git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@972 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Wrap strerror() in a function that makes it thread safe and converts thePierre Ossman2006-05-221-1/+2
| | | | | | | output to UTF-8. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@945 fefdeb5f-60dc-0310-8127-8f9354f1896f
* split polypcore/util.[ch] into polypcore/core-util.[ch] and polyp/util.[ch]Lennart Poettering2006-05-171-1/+1
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@917 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Move xmalloc to the public side (libpolyp).Pierre Ossman2006-05-171-1/+2
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@908 fefdeb5f-60dc-0310-8127-8f9354f1896f