linux/sound/drivers/pcm-indirect2.c
<<
v2..6" 3i"> img src/pcm-.static/gfx/right.png" alt=">>"> href=". ref= class="lxr_search"> ="+search" method="post" onsubmit="return do_search(this);"> input typionhidden" namionnavtarget" /option"> input typiontext" namionsearch" idonsearch"> butt11Search v2..6" 3i"und/drionclick="return ajax_perss();"> Perss../lina> href=".d/drilindiv".d/driliux+v ac> ="ajax+*" method="post" onsubmit="return false;"> input typionhidden" namionajax_lookup" idonajax_lookup" /option"> d/drilinux+v3. d/drilidiv class="headingbott1m">. idiv idonfile_contents"3 v2..6" 3i#L1" idonL1" class="line" namionL1">ril1ina> ref= class="comment">/* href=". v2..6" 3i#L2" idonL2" class="line" namionL2">ril2ina> ref= class="comment"> * Helper func> s ux+ 2..6" PCM data transfer to a simple FIFO 2. href=". v2..6" 3i#L3" idonL3" class="line" namionL3">ril3ina> ref= class="comment"> * hardwaer (small, no possibility to read "hardwaer io posi> ", href=". v2..6" 3i#L4" idonL4" class="line" namionL4">ril4ina> ref= class="comment"> * updating posi> done by 2.terrupt, ...) href=". v2..6" 3i#L5" idonL5" class="line" namionL5">ril5ina> ref= class="comment"> * href=". v2..6" 3i#L6" idonL6" class="line" namionL6">ril6ina> ref= class="comment"> * Copyright (c) by 2007 Joachim Fo ter <JOFT@gmx.de> href=". v2..6" 3i#L7" idonL7" class="line" namionL7">ril7ina> ref= class="comment"> * href=". v2..6" 3i#L8" idonL8" class="line" namionL8">ril8ina> ref= class="comment"> * Based on " v2..6" .h" (alsa-.1" -1ue="v) by href=". v2..6" 3i#L9" idonL9" class="line" namionL9">ril9ina> ref= class="comment"> * href=". v2..6" 3i#L10" idonL10" class="line" namionL10">ri"v2.a> ref= class="comment"> * Copyright (c) by Takashi Iwai <tiwai@suse.de> href=". v2..6" 3i#L11" idonL11" class="line" namionL11">ri11ina> ref= class="comment"> * Jaroslav Ky> a <perex@suse.cz> href=". v2..6" 3i#L12" idonL12" class="line" namionL12">ri12ina> ref= class="comment"> * href=". v2..6" 3i#L13" idonL13" class="line" namionL13">ri13ina> ref= class="comment"> * This program is free softwaer; you cf= redistributr it a.14x+ modify href=". v2..6" 3i#L14" idonL14" class="line" namionL14">ri14ina> ref= class="comment"> * it 6.1er the terms of the GNU General Public License as published by href=". v2..6" 3i#L15" idonL15" class="line" namionL15">ri15ina> ref= class="comment"> * the Free Softwaer Fo6.1a> ; either 2 of the License, or href=". v2..6" 3i#L16" idonL16" class="line" namionL16">ri16ina> ref= class="comment"> * (at your an> ) a.y later . href=". v2..6" 3i#L17" idonL17" class="line" namionL17">ri17ina> ref= class="comment"> * href=". v2..6" 3i#L18" idonL18" class="line" namionL18">ri18ina> ref= class="comment"> * This program is distributrd 2. the hope that it will be useful, href=". v2..6" 3i#L19" idonL19" class="line" namionL19">ri19ina> ref= class="comment"> * but WITHOUT ANY WARRANTY; without eve. the implird waeranty of href=". v2..6" 3i#L20" idonL20" class="line" namionL20">ri2v2.a> ref= class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the href=". v2..6" 3i#L21" idonL21" class="line" namionL21">ri21ina> ref= class="comment"> * GNU General Public License fx+ moer details. href=". v2..6" 3i#L22" idonL22" class="line" namionL22">ri22ina> ref= class="comment"> * href=". v2..6" 3i#L23" idonL23" class="line" namionL23">ri23ina> ref= class="comment"> * You should have rece" d a copy of the GNU General Public License href=". v2..6" 3i#L24" idonL24" class="line" namionL24">ri24ina> ref= class="comment"> * along with this program; if not, writr to the Free Softwaer href=". v2..6" 3i#L25" idonL25" class="line" namionL25">ri25ina> ref= class="comment"> * Fo6.1a> , Inc., 675 Mass Ave, Cambridge, MA 02139, USA. href=". v2..6" 3i#L26" idonL26" class="line" namionL26">ri26ina> ref= class="comment"> */ href=". v2..6" 3i#L27" idonL27" class="line" namionL27">ri27ina>. v2..6" 3i#L28" idonL28" class="line" namionL28">ri28ina> ref= class="comment">/* snd_pr2.tk/d() */ href=". v2..6" 3i#L29" idonL29" class="line" namionL29">ri29ina>#include <2.6.14coer.hina>>. v2..6" 3i#L30" idonL30" class="line" namionL30">ri3v2.a> ref= class="comment">/* struct snd_pcm_substream, struct snd_pcm_runtime, snd_pcm_uframes_t href=". v2..6" 3i#L31" idonL31" class="line" namionL31">ri31ina> ref= class="comment"> * snd_pcm_period_ apsed() */ href=". v2..6" 3i#L32" idonL32" class="line" namionL32">ri32ina>#include <2.6.14 .hina>>. v2..6" 3i#L33" idonL33" class="line" namionL33">ri33ina>. v2..6" 3i#L34" idonL34" class="line" namionL34">ri34ina>#include " v2..6" 3h" class="fref"> v2..6" 3hina>". v2..6" 3i#L35" idonL35" class="line" namionL35">ri35ina>. v2..6" 3i#L36" idonL36" class="line" namionL36">ri36ina>#ifdef5/sovers/p+code=SND_PCM_INDIRECT2_STAT" class="sref">SND_PCM_INDIRECT2_STATina>. v2..6" 3i#L37" idonL37" class="line" namionL37">ri37ina> ref= class="comment">/* jiffies */ href=". v2..6" 3i#L38" idonL38" class="line" namionL38">ri38ina>#include < /jiffies3h" class="fref"> > /jiffies3hina>>. v2..6" 3i#L39" idonL39" class="line" namionL39">ri39ina>. v2..6" 3i#L40" idonL40" class="line" namionL40">ri4v2.a>void5/sovers/p+code=snd_pcm_2..6" _stat" class="sref">snd_pcm_2..6" _stat2.a>(struct /sovers/p+code=snd_pcm_substream" class="sref">snd_pcm_substream2.a> * sovers/p+code=substream" class="sref">substream2.a>,. v2..6" 3i#L41" idonL41" class="line" namionL41">ri41ina> struct /sovers/p+code=snd_pcm_2..6" " class="sref">snd_pcm_2..6" 2.a> * sovers/p+code=" " class="sref">" 2.a>). v2..6" 3i#L42" idonL42" class="line" namionL42">ri4 2.a>{. v2..6" 3i#L43" idonL43" class="line" namionL43">ri43ina> struct /sovers/p+code=snd_pcm_runtime" class="sref">snd_pcm_runtime2.a> * sovers/p+code="untime" class="sref">runtime2.a> = /sovers/p+code=substream" class="sref">substream2.a>-> sovers/p+code="untime" class="sref">runtime2.a>;. v2..6" 3i#L44" idonL44" class="line" namionL44">ri44ina> 2.t /sovers/p+code=i" class="sref">i2.a>;. v2..6" 3i#L45" idonL45" class="line" namionL45">ri45ina> 2.t /sovers/p+code=j" class="sref">j2.a>;. v2..6" 3i#L46" idonL46" class="line" namionL46">ri46ina> 2.t /sovers/p+code=k" class="sref">k2.a>;. v2..6" 3i#L47" idonL47" class="line" namionL47">ri47ina> 2.t /sovers/p+code=seconds" class="sref">seconds2.a> = ( sovers/p+code=" " class="sref">" 2.a>-> sovers/p+code=lastbytetime" class="sref">lastbytetime2.a> - /sovers/p+code=" " class="sref">" 2.a>-> sovers/p+code=firstbytetime" class="sref">firstbytetime2.a>) / /sovers/p+code=HZ" class="sref">HZ2.a>;. v2..6" 3i#L48" idonL48" class="line" namionL48">ri48ina>. v2..6" 3i#L49" idonL49" class="line" namionL49">ri49ina> /sovers/p+code=snd_pr2.tk" class="sref">snd_pr2.tk2.a>(/sovers/p+code=KERN_DEBUG" class="sref">KERN_DEBUGina> ref= class="string">"STAT: mul_ apsed: %u, mul_ apsed_real: %d, " v2..6" 3i#L50" idonL50" class="line" namionL50">ri50ina> ref= class="string">"irq_occured: %d\n" v2..6" 3i#L51" idonL51" class="line" namionL51">ri51ina> /sovers/p+code=" " class="sref">" 2.a>-> sovers/p+code=mul_ apsed" class="sref">mul_ apsed2.a>, /sovers/p+code=" " class="sref">" 2.a>-> sovers/p+code=mul_ apsed_real" class="sref">mul_ apsed_real2.a>, /sovers/p+code=" " class="sref">" 2.a>-> sovers/p+code=irq_occured" class="sref">irq_occured2.a>);. v2..6" 3i#L52" idonL52" class="line" namionL52">ri52ina> /sovers/p+code=snd_pr2.tk" class="sref">snd_pr2.tk2.a>(/sovers/p+code=KERN_DEBUG" class="sref">KERN_DEBUGina> ref= class="string">"STAT: min_multiple: %d (irq > eriod)\n" v2..6" 3i#L53" idonL53" class="line" namionL53">ri53ina> /sovers/p+code=" " class="sref">" 2.a>-> sovers/p+code=min_multiple" class="sref">min_multiple2.a>);. v2..6" 3i#L54" idonL54" class="line" namionL54">ri54ina> /sovers/p+code=snd_pr2.tk" class="sref">snd_pr2.tk2.a>(/sovers/p+code=KERN_DEBUG" class="sref">KERN_DEBUGina> ref= class="string">"STAT: firstbytetime: %lu, lastbytetime: %lu, " v2..6" 3i#L55" idonL55" class="line" namionL55">ri55ina> ref= class="string">"firstzerotime: %lu\n" v2..6" 3i#L56" idonL56" class="line" namionL56">ri56ina> /sovers/p+code=" " class="sref">" 2.a>-> sovers/p+code=firstbytetime" class="sref">firstbytetime2.a>, /sovers/p+code=" " class="sref">" 2.a>-> sovers/p+code=lastbytetime" class="sref">lastbytetime2.a>, /sovers/p+code=" " class="sref">" 2.a>-> sovers/p+code=firstzerotime" class="sref">firstzerotime2.a>);. v2..6" 3i#L57" idonL57" class="line" namionL57">ri57ina> /sovers/p+code=snd_pr2.tk" class="sref">snd_pr2.tk2.a>(/sovers/p+code=KERN_DEBUG" class="sref">KERN_DEBUGina> ref= class="string">"STAT: bytes2hw: %u Bytes =5>KERN_.28< f= clast; sovers/p+code=firstzerotime" class="rate)> v2..6" 3i#L55" idonL55" class="line" namionL55">ri48ina>.5sovers/p2.6.14.1" > 5 v2..58tring">"firstzerotime: %lu\n" v2..6" 3i#L56" idonL56" class="line" namionL56">ri49ina> 5 /sovers/p+code=sn5_pr2.59 " class="sref">" 2.a>-> sovers/p+code=firstbytetime" class="sref">firstbyte= clast;code=firstbytet= clast;">" 2.a>-> sovers/p+code=firstzerotime" class="sref">firstzero= clast;code=firstbytet= clast;">" 2.a22.a22.aruntime2.a>;. v2..6" ref">runtime2.a>;. ate6" 3i#L57" idonL57" class="line" namionL57">6i50ina> 6 ref= 6lass=60" class="sref">snd_pr2.tk2.a>(/sovers/p+code=KERN_DEBUG" class="sref">KERN_DEBUGina> ref= class="string">"STAT: bytes2hw: %u Bytes =5>KERN_.28< ferotmeasv2..6.1) length,.6i51ina> 6 /sover6/p+co6e=" " class="sref">" 2.2hw: %u Bytes =5>KERN_ ate,. v/s|Hz > v2..6" 3i#L56" idonL56" class="line" namionL56">6i52ina> 6 /sovers/p+code=sn6_pr2.62=" " class="sref">" 2.a>-> sovers sovers/p+code=" " class="sref"> 2.a>-> sovers/p+code=firstzerotime" class="sref">firstzero= clast;code=firstbytet= clast;">" 2.a.a>-> sovers sovers/p+code=" " class="sref"> 3i#L56" idonL56" class="line" namionL56">6i53ina> 6 /sover6/p+co6e=" " class="sref">" 2.a>-> sovers/p+code=min_multiple" class="sref">min_multip= clast;code=firstbytet= clast;">" 2.a22.a22.aruntime2.a>;. 3i#L57" idonL57" class="line" namionL57">6i54ina> 6 /sovers/p+code=sn6_pr2.6k" class="sref">snd_pr2.tk2.a>(/sovers/p+code=KERN_DEBUG" class="sref">KERN_DEBUGina> ref= class="string">"STAT: fir3i#L57" idonL57" class="line" namionL57">6i55ina> 6 ref= 6lass=6string">"firstzerotime: %lu\n" ast; sovers/pf. se hies > v2..6" 3i#L56" idonL56" class="line" namionL56">66ina> reff= class="comment"> * C+code6" " class="sref">" 2 2.a>-> sovers/p+code=min_multiple" class="sref">min_multip> ast;code=min_multip> ast;ef"> 2(2.a>-> sovers/p+code=lastbytetime" class="sref">lastbyteti> ast;code=min_multip> ast;ef">2.a22.a2)s*.1000) /3i#L56" idonL56" class="line" namionL56">6i57ina> 6 /sovers/p+code=sn6_pr2.67 " class="sref">" 2 2.a>-> sovers/vers/p2.6.14.1" > v2..6" ref">runtime2.a>;. ate6" 3i#L56" idonL56" class="line" namionL56">6i48ina>.6sovers/p2.6.14.1" > 6 v2..68tring">"firstzerotia>-> sovers/p+code=lastbytetime" class="sref">lastbyteti> ast;code=min_multip> ast;ef">2.a2.a>-> sovers/p+code=lastbytetime" class="sref">lastbytetihw_buffer_size2.6.14.1" > hw_buffer_sizeef">2.a2) 3i#L56" idonL56" class="line" namionL56">6i49ina> 6 /sovers/p+code=sn6_pr2.69 " class="sref">" 2 a2.a>-> sovers/p+code=lastbytetime" class="sref">lastbytetihw_buffer_size2.6.14.1" > hw_buffer_sizeef">2.a2) 3i#L57" idonL57" class="line" namionL57">7i50ina> 7 ref= 7lass=70" class="sref">snd_pr2.tk2.a>(/sovers/p+code=KERN_DEBUG" class="sref">KERN_DEBUGina> ref= class="string">"STAT: bytes2hw: %u Bytes =5>KERN_.28< fpo4.1" _callsquot; v2..6" 3i#L56" idonL56" class="line" namionL56">7i51ina> 7 /sover7/p+co7e=" " class="sref">" 2.a>-> sovers/p+code=mul_ apsed" class="sref">mul_ apsedpo4.1" _callscode=mul_ apsepo4.1" _calls">" 2.a>-> sovers/p+code=lastbytetime" class="sref">lastbytetime2.diff/p2.ers/p+code=" " cladiff/p2.ef"> 3i#L57" idonL57" class="line" namionL57">7i52ina> 7 /sovers/p+code=sn7_pr2.7k" class="sref">snd_pr2.tk2.a>(/sovers/p+code=KERN_DEBUG" class="sref">KERN_DEBUGina> ref= class="string">"STAT: min_multiple: %d (irq > eriod)\n&sw_io14.1" >sw_f="..14.1" > v2..6" 2.a>-> sovers/p+code=lastbytetime" class="sref">lastbytetisw_io/p+code=KERN_DEBw_io6" 3i#L56" idonL56" class="line" namionL56">7i53ina> 7 /sover7/p+co7e=" " class="sref">" 2.a>-> sovers/p+code=min_multiple" class="sref">min_multipsw_f="./p+code=KERN_DEBw_f=".ef"> 3i#L57" idonL57" class="line" namionL57">7i54ina> 7 /sovers/p+code=sn7_pr2.7k" class="sref">snd_pr2.tk2.a>(/sovers/p+code=KERN_DEBUG" class="sref">KERN_DEBUGina> ref= class="string">"STAT: firstbytetime: %lu, lastbytetime:= cl_sizes[]: > v2..6" 3i#L57" idonL57" class="line" namionL57">7i55ina> 7 ref= 7lass=75" class="sref">snd_pr2.tk2.4.1" > v2..6" pf.0 3i#L57" idonL57" class="line" namionL57">76ina> re7f= class="comment"> * 7+code7" " class="s.14.ef">KERN_DEBUGin4.1" > v2..6" pf.0 ;. v2..6" " cla 8 ;. v2..6" ++) 3i#L43" idonL43" class="line" namionL43">77ina> reff= class="comment"> * hr_pr2.77 " class="sref">" .14.ef">KERN_DEBUGin4.1" > v2..6" ref">substream2.a>4.1" > v2..6" "* 8 ;. v2..6" r cla ef">KERN_DEBUGin4.1" > v2..6" p+ 1)"* 8 ;. v2..6" ++)3i#L43" idonL43" class="line" namionL43">7i48ina>.7sovers/p2.6.14.1" > 7 v2..78tring">"firstzerottttttifa2.a>-> sovers/p+code=lastbytetime" class="sref">lastbyteti= cl_sizescode=firstbytet= cl_sizes cla[. v2..6" ] !f.0) 3i#L43" idonL43" class="line" namionL43">7i49ina> 7 /sovers/p+code=sn7_pr2.79 " class="sref">" 2 as="sref">" 2.a>-> soversa>(/sovers/p+code=KERN_DEBUG" class="sref">KERN_DEBUGina> ref= class="string">"STAT: firstbytetime: %lu, lastbyt14.1" 6.14.1" > v2..6" 3i#L56" idonL56" class="line" namionL56">8i50ina> 8 ref= 8lass=8string">"irq_occureref">" 2 as="sref">" 2.a>-> sovers4.1" > v2..6" 2.a>-> sovers/p+code=firstzerotime" class="sref">firstzero= cl_sizescode=firstbytet= cl_sizes cla[. v2..6" ] 3i#L57" idonL57" class="line" namionL57">8i51ina> 8 /sover8/p+co8ct /sovers/p+code=snd_pcm_2..6" " 2.a>-> sovers4.1" > v2..6" ++ 3i#L57" idonL57" class="line" namionL57">8i52ina> 8 /sovers/p+code=sn8_pr2.82=" " class="sref">" 222222}3i#L57" idonL57" class="line" namionL57">8i53ina> 8 /sover8/p+co8e=" " class="sref">"ifa2(2.a>-> sovers4.1" > v2..6" p14.1" 8) =f.0) &&a2.a>-> sovers4.1" > v2..6" p!f.0)) 3i#L43" idonL43" class="line" namionL43">8i54ina> 8 /sovers/p+code=sn8_pr2.84=" " class="sref">" 222222.a>-> soversa>(/sovers/p+code=KERN_DEBUG" class="sref">KERN_DEBUGina> ref= class="string">"STAT: firstbytetime: %lu, lastbyt > v2..6" 3i#L57" idonL57" class="line" namionL57">8i55ina> 8 ref= 8lass=8string">"firstzerot " 2.a>-> sovers4.1" > v2..6" pf.0 3i#L57" idonL57" class="line" namionL57">86ina> re8f= class="comment"> * 8+code8" " class="sref">" }3i#L57" idonL57" class="line" namionL57">87ina> re8f= class="comment"> * h8_pr2.87 " class="s}3i#L57" idonL57" class="line" namionL57">88ina> reff= class="comment"> * B> ref0ers/p+codiB2 cl4" namionL57">88ina>l3vers/p2.6.14.1" 36">8i50ina> 8 n 7 " class="s}3i#L57" idonL57" class="line" namionL57">88ina> reff= class="comment"> * B> 654 v2..6" p+ 1)iLtring">"ST6.17.3" > v2.6.17.3
The original LXR software bya d 2.a>-&ghttp://t; rceforge.net/prot;STAT: min_m5ultip57:  " 2.a>-> sovers4.1" > v2..6" p5 v2..65 idonL56" class="line" n5amion57
3iCh 56" c/p2.6.14.1" > 2.6@>ux.no.17....65 idoL56" class="quoline" n5a2.6.>ux.no kt;Sly hostNDIREC Redpill Lgth 5 AS.17.3ri Lgtux_PCMsn_cmngrrrrro 2.ai50is services si +1995)ers4.1" /bodydoL/html v2.