<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968" /><title>Access Flags</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><link rel="home" href="index.html" title="Writing an ALSA Driver" /><link rel="up" href="ch06.html" title="Chapter 6. Control Interface" /><link rel="prev" href="ch06s03.html" title="Control Names" /><link rel="next" href="ch06s05.html" title="Callbacks" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Access Flags</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch06s03.html">Prev</a> </td><th width="60%" align="center">Chapter 6. Control Interface</th><td width="20%" align="right"> <a accesskey="n" href="ch06s05.html">Next</a></td></tr></table><hr /></div><div class="section" title="Access Flags"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="control-interface-access-flags"></a>Access Flags</h2></div></div></div><p> The access flag is the bitmask which specifies the access type of the given control. The default access type is <code class="constant">SNDRV_CTL_ELEM_ACCESS_READWRITE</code>, which means both read and write are allowed to this control. When the access flag is omitted (i.e. = 0), it is considered as <code class="constant">READWRITE</code> access as default. </p><p> When the control is read-only, pass <code class="constant">SNDRV_CTL_ELEM_ACCESS_READ</code> instead. In this case, you don't have to define the <em class="structfield"><code>put</code></em> callback. Similarly, when the control is write-only (although it's a rare case), you can use the <code class="constant">WRITE</code> flag instead, and you don't need the <em class="structfield"><code>get</code></em> callback. </p><p> If the control value changes frequently (e.g. the VU meter), <code class="constant">VOLATILE</code> flag should be given. This means that the control may be changed without <a class="link" href="ch06s07.html" title="Change Notification"><em class="citetitle"> notification</em></a>. Applications should poll such a control constantly. </p><p> When the control is inactive, set the <code class="constant">INACTIVE</code> flag, too. There are <code class="constant">LOCK</code> and <code class="constant">OWNER</code> flags to change the write permissions. </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch06s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch06.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch06s05.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Control Names </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Callbacks</td></tr></table></div></body></html>