aboutsummaryrefslogtreecommitdiff
path: root/include/sound/pcm.h
AgeCommit message (Collapse)Author
2008-08-25ALSA: Allocate larger pages in sgbufTakashi Iwai
Most hardwares have limited buffer-descriptor table length. This also restricts the max buffer size of the sound driver. For example, snd-hda-intel has 1MB buffer size limit, and this is because it can have at most 256 BDL entries. For supporting larger buffers, we need to allocate larger pages even for sg-buffers. This patch changes the sgbuf allocation code to try to allocate larger pages first. At each head of the allocated pages, the number of allocated pages is stored in the lowest bits of the corresponding entry of the table addr field. This change isn't visible as long as the driver uses snd_sgbuf_get_addr() helper. Also, the patch adds a new function, snd_pcm_sgbuf_get_chunk_size(). This returns the size of the chunk on continuous pages starting at the given position offset. If the chunk reaches to a non-continuous page, it returns the size to the boundary. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-25ALSA: Clean up SG-buffer helper functions and macrosTakashi Iwai
Clean up SG-buffer helper functions and macros. Helpers take substream as arguments now. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-13ALSA: Kill snd_assert() in sound/core/*Takashi Iwai
Kill snd_assert() in sound/core/*, either removed or replaced with if () with snd_BUG_ON(). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-01ALSA: Fix limit of 8 PCM devices in SNDRV_CTL_IOCTL_PCM_NEXT_DEVICEPawel MOLL
When compiled with CONFIG_SND_DYNAMIC_MINORS the ALSA core is fine to have more than 8 PCM devices per card, except one place - the SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE ioctl, which will not enumerate devices > 7. This patch fixes the issue, changing the devices list organisation. Instead of adding new device to the tail, the list is now kept always ordered (by card number, then device number). Thus, during enumeration, it is easy to discover the fact that there is no more given card's devices. Additionally the device field of struct snd_pcm had to be changed to int, as its "unsignednity" caused a lot of problems when comparing it to potentially negative signed values. (-1 is 0xffffffff or even more then ;-) Signed-off-by: Pawel Moll <pawel.moll@st.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-01sound: Revert "ALSA: Fix limit of 8 PCM devices in ↵Jaroslav Kysela
SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE" This reverts commit fb3d6f2b77bdec75d45aa9d4464287ed87927866. New, updated patch with same subject replaces this commit. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-07-29ALSA: Fix limit of 8 PCM devices in SNDRV_CTL_IOCTL_PCM_NEXT_DEVICEPawel MOLL
When compiled with CONFIG_SND_DYNAMIC_MINORS the ALSA core is fine to have more than 8 PCM devices per card, except one place - the SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE ioctl, which will not enumerate devices > 7. This patch fixes the issue, changing the devices list organisation. Instead of adding new device to the tail, the list is now kept always ordered (by card number, then device number). Thus, during enumeration, it is easy to discover the fact that there is no more given card's devices. The same limit was present in OSS emulation code. It has been fixed as well. Additionally the device field of struct snd_pcm is now int, instead of unsigned int, as there is no obvious reason for keeping it unsigned. This caused a lot of problems with comparing this value with other (almost always signed) variables. There is just one more place where device number is unsigned - in struct snd_pcm_info, which should be also sorted out in future. Signed-off-by: Pawel MOLL <pawel.moll@st.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] Remove PCM sleep_min and tickTakashi Iwai
The 'tick' in PCM is set (again) via sw_params. And, nobody uses this feature at all except for a command line option of aplay. (This is literally 'nobody', as I checked alsa-lib API calls in all programs in major distros.) Above all, if we need finer wake-ups for the position update, it's basically an issue that the driver should solve, not tuned by each application. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] Remove PCM xfer_align sw paramsTakashi Iwai
The xfer_align sw_params parameter has never been used in a sane manner, and no one understands what this does exactly. The current implementation looks also buggy because it allows write of shorter size than xfer_align. So, if you do partial writes, the write isn't actually aligned at all. Removing this parameter will make some pcm_lib_* code more readable (and less buggy). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31[ALSA] Use posix clock monotonic for PCM and timer timestampsJaroslav Kysela
We need an accurate and continuous (monotonic) time sources to do accurate synchronization among more timing sources. This patch allows to enable monotonic timestamps for ALSA PCM devices and enables monotonic timestamps for ALSA timer devices. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2007-10-16[ALSA] Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.czJaroslav Kysela
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2007-10-16[ALSA] Kill useless volatile in pcm.hTakashi Iwai
The volatile prefix is just useless there. Let's kill them, and then gcc will be happier, too. sound/acore/pcm.c:867: warning: passing argument 1 of ‘__constant_c_and_count_memset’ discards qualifiers from pointer target type Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16[ALSA] Fix 'discards qualifiers' compile warnings in pcm.hTakashi Iwai
Fixed cast messes in pcm.h. include/sound/pcm.h: In function ‘hw_param_interval_c’: include/sound/pcm.h:800: warning: passing argument 1 of ‘hw_param_interval’ discards qualifiers from pointer target type Simply redefine the inline functions again for const pointers. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16[ALSA] pcm: add snd_pcm_rate_to_rate_bit() helperClemens Ladisch
Add a snd_pcm_rate_to_rate_bit() function to factor out common code used by several drivers. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16[ALSA] pcm: merge rates[] from pcm_misc.c and pcm_native.cClemens Ladisch
Merge the rates[] arrays from pcm_misc.c and pcm_native.c because they are both the same. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-05-11[ALSA] Add snd_pcm_group_for_each_entry() for code cleanupTakashi Iwai
Added a new macro snd_pcm_group_for_each_entry() just for code cleanup. Old macros, snd_pcm_group_for_each() and snd_pcm_group_substream_entry(), are removed. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-02-12[PATCH] mark struct file_operations const 1Arjan van de Ven
Many struct file_operations in the kernel can be "const". Marking them const moves these to the .rodata section, which avoids false sharing with potential dirty data. In addition it'll catch accidental writes at compile time to these shared resources. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-09[ALSA] add struct snd_pcm_substream forward declarationRandy Dunlap
fixes: include/sound/pcm.h:62: warning: 'struct snd_pcm_substream' declared inside parameter list Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-02-09[ALSA] pcm core: add prealloc_max file to substream directory to show ↵Jaroslav Kysela
maximum DMA size Users ask us many times about the maximum DMA size for PCM devices. This file gives them a hint in KB. Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-02-09[ALSA] alsa core: add struct device pointer to struct snd_pcmJohannes Berg
This patch adds a struct device pointer to struct snd_pcm in order to be able to give it a different device than the card. It defaults to the card's device, however, so it should behave identically for drivers not touching the field. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-12-04[PATCH] severing poll.h -> mm.hAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2006-10-01[PATCH] maximum latency tracking: ALSA supportTakashi Iwai
Add maximum latency tracking to the ALSA subsystem for PCM playback. In ALSA, the playback application controls the buffer size and thus indirectly the period of latency that it can deal with. This patch uses 75% of the total available latency as threshold to announce to the latency subsystem; While 75% is a crude heuristic it's a quite reasonable one; the remaining 25% can be used for all driver processing for the next samples which is also proportional to the size of the buffer. With ogg123 a latency setting of about 4msec was seen (at 44Khz), while with the "play" command a much longer maximum tolerable latency was seen. Other, more multimedia oriented players as well as games, will have a lot smaller buffers to allow better synchronization and those will actually get into the latency domains where there is impact on the power management rules. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-23[ALSA] Fix control/status mmap with shared PCM substreamTakashi Iwai
The flag to avoid 32bit-incompatible mmap for control/status records should be outside the pcm substream instance since a substream can be shared among multiple opens. Now it's flagged in pcm_file list that is directly assigned to file->private_data. Also, removed snd_pcm_add_file() and remove_file() functions and substream.files field that are not really used in the code. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-06-22[ALSA] Fix mmap_count with O_APPEND opened streamsTakashi Iwai
Move mmap_count to snd_pcm_substream instead of runtime struct so that multiplly opened substreams via O_APPEND can be handled correctly. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-06-22[ALSA] Add O_APPEND flag support to PCMTakashi Iwai
Added O_APPEND flag support to PCM to enable shared substreams among multiple processes. This mechanism is used by dmix and dsnoop plugins. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-06-22[ALSA] Move OSS-specific hw_params helper to snd-pcm-oss moduleTakashi Iwai
Move EXPORT_SYMBOL()s to places adjacent to functions/variables. Also move OSS-specific hw_params helper functions to pcm_oss.c. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-04-27[ALSA] Fix Oops at rmmod with CONFIG_SND_VERBOSE_PROCFS=nTakashi Iwai
Fixed Oops at rmmod with CONFIG_SND_VERBOSE_PROCFS=n. Add ifdef to struct fields for optimization and better compile checks. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-04-12[ALSA] sound/core/pcm.c: make snd_pcm_format_name() staticAdrian Bunk
Modules: PCM Midlevel This patch makes the needlessly global snd_pcm_format_name() static. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-04-12[ALSA] Fix Oops of PCM OSS emulationTakashi Iwai
Modules: PCM Midlevel,ALSA<-OSS emulation Fix Oops of PCM OSS emulation occuring when multiple playback is used. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-03-31[ALSA] Clean up PCM codes (take 2)Takashi Iwai
- Clean up initialization and destruction of substream instance Now snd_pcm_open_substream() alone does most initialization jobs. Add pcm_release callback for cleaning up at snd_pcm_release_substream() - Tidy up PCM oss code Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-03-31[ALSA] Tiny clean up of PCM codesTakashi Iwai
- Make snd_pcm_prepare() static - Clean up snd_pcm_kernel_*_ioctl() functions, reduce exports Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-03-22[ALSA] semaphore -> mutex (core part)Ingo Molnar
Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-03[ALSA] dynamic minors (3/6): store device-specific object pointers dynamicallyClemens Ladisch
Instead of storing the pointers to the device-specific structures in an array, put them into the struct snd_minor, and look them up dynamically. This makes the device type modules independent of the minor number encoding. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-01-03[ALSA] dynamic minors (1/6): store device type in struct snd_minorClemens Ladisch
Instead of a comment string, store the device type in the snd_minor structure. This makes snd_minor more flexible, and has the nice side effect that we don't need anymore to create a separate snd_minor template for registering a device but can pass the file_operations directly to snd_register_device(). Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-01-03[ALSA] Remove xxx_t typedefs: PCMTakashi Iwai
Modules: PCM Midlevel Remove xxx_t typedefs from the core PCM codes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2005-11-04[ALSA] Use getnstimeofday()Takashi Iwai
Modules: Documentation,PCM Midlevel,Timer Midlevel,ALSA Core Use the standard getnstimeofday() function instead of ALSA's own one. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2005-09-12[ALSA] Another fix for DocBookTakashi Iwai
PCM Midlevel Revive snd_pcm_format_cpu_endian() document. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2005-09-12[ALSA] Remove superfluous PCI ID definitionsTakashi Iwai
CS46xx driver,EMU10K1/EMU10K2 driver,PCM Midlevel,Trident driver YMFPCI driver,BT87x driver,CMIPCI driver,CS4281 driver ENS1370/1+ driver,ES1938 driver,ES1968 driver,Intel8x0 driver Intel8x0-modem driver,Maestro3 driver,RME32 driver,RME96 driver SonicVibes driver,VIA82xx driver,ALI5451 driver,ICE1712 driver ICE1724 driver,NM256 driver,RME HDSP driver,RME9652 driver Remove superfluous PCI ID definitions. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2005-09-09[PATCH] DocBook: fix kernel-api documentation generationMartin Waitz
This patch changes a macro definition so that kernel-doc can understand it. Signed-off-by: Martin Waitz <tali@admingilde.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-07[kernel-doc] fix various DocBook build problems/warningsJeff Garzik
Most serious is fixing include/sound/pcm.h, which breaks the DocBook build. The other stuff is just filling in things that cause warnings.
2005-08-30[ALSA] ALSA's struct _snd_pcm_substream: Obsolete open_flagKarsten Wiese
PCM Midlevel,ALSA<-OSS emulation,USB USX2Y This patch removes open_flag from struct _snd_pcm_substream. All of its uses are substituted by querying struct _snd_pcm_substream's member ffile instead. Signed-off-by: Karsten Wiese <annabellesgarden@yahoo.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2005-05-29[ALSA] sound/core/: possible cleanupsAdrian Bunk
PCM Midlevel,ALSA Core,Timer Midlevel,ALSA sequencer,Virtual Midi This patch contains the following possible cleanups: - make needlessly global code static - #if 0 the following unused global functions - remove the following unneeded EXPORT_SYMBOL's Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2005-05-29[ALSA] Export missing snd_pcm_format_*()Takashi Iwai
PCM Midlevel Export snd_pcm_format_size(). This function is used by some out-of-kernel drivers. Make snd_pcm_format_cpu_endian() macro for optimization. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2005-04-16Linux-2.6.12-rc2Linus Torvalds
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!