summaryrefslogtreecommitdiffstats
path: root/src/modules/module-oss.c
Commit message (Collapse)AuthorAgeFilesLines
* add missing poll.h inclusionLennart Poettering2007-10-071-0/+1
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1937 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Fix race condition between IO thread creation and pa_sink_put(). Move ↵Lennart Poettering2007-10-011-62/+114
| | | | | | 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
* only do IO if we are RUNNING or IDLE, but not when we are in INITLennart Poettering2007-09-281-2/+2
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1912 fefdeb5f-60dc-0310-8127-8f9354f1896f
* drop the PA_SOURCE_CAN_SUSPEND and PA_SINK_CAN_SUSPEND flags, since they ↵Lennart Poettering2007-09-241-2/+2
| | | | | | 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
* instead of using the mixer ioctl()s on the dsp fd, open a seperate fd for ↵Lennart Poettering2007-09-231-160/+227
| | | | | | the mixer. This allows us the keep the mixer fd open while closing the dsp device while suspending. git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1893 fefdeb5f-60dc-0310-8127-8f9354f1896f
* simplify rt loops a bit by moving more code into pa_rtpoll. It is now ↵Lennart Poettering2007-09-141-27/+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-3/+3
| | | | | | 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
* consolidate close() calls to pa_close(), and make sure on every occasion ↵Lennart Poettering2007-09-121-4/+4
| | | | | | that we handle failures of close() sensibly git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1811 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
* make sure that the device volume is properly read before we call ↵Lennart Poettering2007-09-101-2/+2
| | | | | | pa_sink_put() and thus make the pa_sink available git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1789 fefdeb5f-60dc-0310-8127-8f9354f1896f
* don't call pa_source_process_msg() for PA_SOURCE_MESSAGE_GET_LATENCY, since ↵Lennart Poettering2007-09-101-1/+1
| | | | | | it makes querying the latency always fail git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1784 fefdeb5f-60dc-0310-8127-8f9354f1896f
* fix an assert when runnig module-oss in record only-mode. optimize ↵Lennart Poettering2007-09-061-11/+24
| | | | | | allocation of memblocks on playback git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1777 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Lots of assorted minor cleanups and fixes:Lennart Poettering2007-08-301-33/+37
| | | | | | | | | | | | | | | | | | * 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-83/+87
| | | | 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-1/+1
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1645 fefdeb5f-60dc-0310-8127-8f9354f1896f
* port oss driver to make use of the default fragment sizes as defined in ↵Lennart Poettering2007-08-111-28/+20
| | | | | | pa_core: store in the sink/source description whether mmap is used; if mmap() fails, fall back to UNIX read/write mode instead of bailing out immediately git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1639 fefdeb5f-60dc-0310-8127-8f9354f1896f
* make use of pa_thread_mq everywhereLennart Poettering2007-08-101-17/+19
| | | | 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
* A lot of updates, all necessary to get the native protocol ported:Lennart Poettering2007-07-311-10/+11
| | | | | | | | | | | | | * 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
* fix suspending logicLennart Poettering2007-07-281-60/+89
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1559 fefdeb5f-60dc-0310-8127-8f9354f1896f
* reload OSS volume after unsuspendLennart Poettering2007-07-281-0/+5
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1553 fefdeb5f-60dc-0310-8127-8f9354f1896f
* port module-alsa-sink to new lock-free core. also add mmmap'ing support ↵Lennart Poettering2007-07-281-23/+38
| | | | | | while doing so. git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1551 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Disable memory mapping if we open the device in O_WRONLY. Unfortunately we ↵Lennart Poettering2007-07-261-1/+6
| | | | | | cannot do mmap() in Linux without opening the device for reading as well. git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1549 fefdeb5f-60dc-0310-8127-8f9354f1896f
* change order of munmap and freeing of memblocksLennart Poettering2007-07-251-9/+9
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1524 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Replace a couple of assert()s by pa_assert()sLennart Poettering2007-07-131-6/+5
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1512 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Merge module-oss-mmap into module-oss and make suspending working properlyLennart Poettering2007-07-131-206/+653
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1510 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Make sure pollfd[POLLFD_ASYNCQ].revents is properly initialized on signalLennart Poettering2007-07-121-1/+8
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1507 fefdeb5f-60dc-0310-8127-8f9354f1896f
* fix segfault when recording with module-oss.cLennart Poettering2007-07-121-1/+1
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1506 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Port module-oss to the new lock-free coreLennart Poettering2007-06-251-15/+23
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1501 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Update OSS driver for new lock-free coreLennart Poettering2007-06-231-228/+512
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1491 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Merge HUGE set of changes temporarily into a branch, to allow me to move ↵Lennart Poettering2007-06-111-6/+16
| | | | | | 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
* Kill spaces on EOLLennart Poettering2007-05-291-5/+5
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1465 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Fix module-oss for devices that return EAGAIN when we don't expect it. ↵Lennart Poettering2007-05-231-3/+10
| | | | | | (Closes #66) git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1442 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-35/+35
| | | | | | | 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-15/+7
| | | | 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-7/+15
| | | | | | | | | | | | | | | | | | | | | 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-17/+17
| | | | | | | | | | | | 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-2/+2
| | | | | | | | | | | | | | | 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-4/+3
| | | | 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-4/+28
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1223 fefdeb5f-60dc-0310-8127-8f9354f1896f
* handle hot-remeving of OSS devices properlyLennart Poettering2006-08-121-12/+30
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1221 fefdeb5f-60dc-0310-8127-8f9354f1896f
* fix a segfault in module-ossLennart Poettering2006-08-121-1/+1
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1216 fefdeb5f-60dc-0310-8127-8f9354f1896f
* don't set the sink/source descriptions manually, use the new functions ↵Lennart Poettering2006-08-111-11/+13
| | | | | | 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-2/+2
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1201 fefdeb5f-60dc-0310-8127-8f9354f1896f
* set is_hardware flag for a few hw pluginsLennart Poettering2006-07-161-0/+2
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1092 fefdeb5f-60dc-0310-8127-8f9354f1896f
* try to use send(,,MSG_NOSIGNAL) instead of write() wherever possible (whichLennart Poettering2006-07-141-1/+1
| | | | | | | | | | will allow us to drop the SIGPIPE check). Cache the results of the last write()/send() to make sure that we do not issue more than necessary system calls. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1083 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