<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/sound/pci/echoaudio/echoaudio.h, branch master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/sound/pci/echoaudio/echoaudio.h?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/sound/pci/echoaudio/echoaudio.h?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2021-07-19T14:16:55Z</updated>
<entry>
<title>ALSA: echoaudio: Allocate resources with device-managed APIs</title>
<updated>2021-07-19T14:16:55Z</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2021-07-15T07:58:54Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9c211bf392bbf7cec3f69129adeedff7983c833e'/>
<id>urn:sha1:9c211bf392bbf7cec3f69129adeedff7983c833e</id>
<content type='text'>
This patch converts the resource management in PCI echoaudio drivers
with devres as a clean up.  Each manual resource management is
converted with the corresponding devres helper, the page allocations
are done with the devres helper, and the card object release is
managed now via card-&gt;private_free instead of a lowlevel snd_device.
The irq handler is still managed manually because it's re-acquired at
PM suspend/resume.

This should give no user-visible functional changes.

Link: https://lore.kernel.org/r/20210715075941.23332-33-tiwai@suse.de
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: echoaduio: Drop superfluous volatile modifier</title>
<updated>2020-08-11T12:21:49Z</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2020-08-03T14:39:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=85cb905d3c5ff6107f4948314731c1b55b689cfc'/>
<id>urn:sha1:85cb905d3c5ff6107f4948314731c1b55b689cfc</id>
<content type='text'>
The dsp_registers field of struct echoaduio has the volatile modifier,
but it's basically superfluous; the field is accessed only for the
base pointer of readl() and writel(), hence marking with __iomem alone
should suffice.  OTOH, having the volatile prefix causes a compile
warning like:
  sound/pci/echoaudio/echoaudio.c:1878:14: warning: passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers]

So it's better to drop this superfluous modifier.

Link: https://lore.kernel.org/r/20200803143958.24324-1-tiwai@suse.de
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: echoaudio: Address bugs in the interrupt handling</title>
<updated>2020-07-09T10:59:24Z</updated>
<author>
<name>Mark Hills</name>
<email>mark@xwax.org</email>
</author>
<published>2020-07-08T10:18:48Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=a0b224b90bb60b3fbd2cae750227c995c9e61055'/>
<id>urn:sha1:a0b224b90bb60b3fbd2cae750227c995c9e61055</id>
<content type='text'>
Distorted audio appears occasionally, affecting either playback or
capture and requiring the affected substream to be closed by all
applications and re-opened.

The best way I have found to reproduce the bug is to use dmix in
combination with Chromium, which opens the audio device multiple times
in threads. Anecdotally, the problems appear to have increased with
faster CPUs. I ruled out 32-bit counter wrapping; it often happens
much earlier.

Since applying this patch I have not had problems, where previously
they would occur several times a day.

The patch targets the following issues:

* Check for progress using the counter from the hardware, not after it
  has been truncated to the buffer.

  This is a clean way to address a possible bug where if a whole
  ringbuffer advances between interrupts, it goes unnoticed.

* Move last_period state from chip to pipe

  This more logically belongs as part of pipe, and code is reasier to
  read if it is "counter position last time a period elapsed".

  Now the code has no references to period count. A period is just
  when the regular counter crosses a threshold. This increases
  readability and reduces scope for bugs.

* Treat period notification and buffer advance independently:

  This helps to clarify what is the responsibility of the interrupt
  handler, and what is pcm_pointer().

  Removing shared state between these operations means race conditions
  are fixed without introducing locks. Synchronisation is only around
  the read of pipe-&gt;dma_counter. There may be cache line contention
  around "struct audiopipe" but I did not have cause to profile this.

Pay attention to be robust where dma_counter wrapping is not a
multiple of period_size or buffer_size.

This is a revised patch based on feedback from Takashi and Giuliano.

Signed-off-by: Mark Hills &lt;mark@xwax.org&gt;
Link: https://lore.kernel.org/r/20200708101848.3457-5-mark@xwax.org
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: echoaudio: Race conditions around "opencount"</title>
<updated>2020-07-09T10:58:35Z</updated>
<author>
<name>Mark Hills</name>
<email>mark@xwax.org</email>
</author>
<published>2020-07-08T10:18:45Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=027c70021b905eb23e2f36c64add062ba218b841'/>
<id>urn:sha1:027c70021b905eb23e2f36c64add062ba218b841</id>
<content type='text'>
Use of atomics does not make these statements robust:

       atomic_inc(&amp;chip-&gt;opencount);
       if (atomic_read(&amp;chip-&gt;opencount) &gt; 1 &amp;&amp; chip-&gt;rate_set)
               chip-&gt;can_set_rate=0;

and

       if (atomic_read(&amp;chip-&gt;opencount)) {
               if (chip-&gt;opencount) {
                       changed = -EAGAIN;
               } else {
                       changed = set_digital_mode(chip, dmode);

It would be necessary to atomically increment or decrement the value
and use the returned result. And yet we still need to prevent other
threads making use of "can_set_rate" while we set it.

However in all but one case the atomic is misleading as they are already
running with "mode_mutex" held.

Decisions are made on mode setting are often intrinsically connected
to "opencount" because some operations are not permitted unless
there is sole ownership.

So instead simplify this, and use "mode_mutex" as a lock for all reference
counting and mode setting.

Signed-off-by: Mark Hills &lt;mark@xwax.org&gt;
Link: https://lore.kernel.org/r/20200708101848.3457-2-mark@xwax.org
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: echoaudio: Proper endian notations</title>
<updated>2018-07-27T07:06:09Z</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2018-07-25T21:24:10Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=2a833a02a12b1dbb605739d589d11b4400c2078c'/>
<id>urn:sha1:2a833a02a12b1dbb605739d589d11b4400c2078c</id>
<content type='text'>
Many data fields defined in echoaudio drivers are in little-endian,
hence they should be defined with __le16 or __le32.  This makes it
easier to catch the forgotten conversions.

Spotted by sparse, a warning like:
  sound/pci/echoaudio/echoaudio_dsp.c:990:36: warning: incorrect type in assignment (different base types)

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: echoaudio: Drop superfluous macro</title>
<updated>2018-05-24T09:23:02Z</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2018-05-24T09:20:06Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=afe5da3eba8796c259e5134872e844436e716f7e'/>
<id>urn:sha1:afe5da3eba8796c259e5134872e844436e716f7e</id>
<content type='text'>
Drop pci_device() macro that just leads to chip-&gt;pci-&gt;dev, and pass it
directly to request_firmware().  It was introduced for allowing the
external alsa-driver kernel module builds.  Since it was discontinued
years ago, we should clean it up now.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: echoaudio: Use standard C definitions of true and false</title>
<updated>2015-08-10T12:27:16Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2015-08-10T12:02:53Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=3f6175ece947358e988af149ecca0d31100ee6c4'/>
<id>urn:sha1:3f6175ece947358e988af149ecca0d31100ee6c4</id>
<content type='text'>
The echoaudio locally defines TRUE and FALSE.  Not only is this
redundant given that C now has a boolean type it results in lots of
warnings as other headers also define these macros, causing duplicate
definitions.  Fix this by removing the local defines and converting all
local users to use the standard C true and false instead, simply
removing the macros is less safe due to implicit inclusion of the other
definitons.

[fixed overlooked replacement of FALSE by tiwai]

Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: echoaudio: remove all snd_printk</title>
<updated>2014-11-03T13:07:25Z</updated>
<author>
<name>Sudip Mukherjee</name>
<email>sudipm.mukherjee@gmail.com</email>
</author>
<published>2014-11-03T10:34:13Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=b5b4a41b392960010fccf1f9ccf8334d612bd450'/>
<id>urn:sha1:b5b4a41b392960010fccf1f9ccf8334d612bd450</id>
<content type='text'>
removed all references of snd_printk with the standard dev_* macro.

[a few places degraded to dev_dbg(), too -- tiwai]

Signed-off-by: Sudip Mukherjee &lt;sudip@vectorindia.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: echoaudio: add reference of struct echoaudio</title>
<updated>2014-11-03T13:02:33Z</updated>
<author>
<name>Sudip Mukherjee</name>
<email>sudipm.mukherjee@gmail.com</email>
</author>
<published>2014-11-03T10:34:12Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=e369086968157415aeb11af3b57cd998c6721603'/>
<id>urn:sha1:e369086968157415aeb11af3b57cd998c6721603</id>
<content type='text'>
added reference of struct echoaudio to free_firmware function.
this structure will be later used to get a reference of the card
when converting snd_printk to dev_* in the next patch of the series.

Signed-off-by: Sudip Mukherjee &lt;sudip@vectorindia.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: pci: remove __dev* attributes</title>
<updated>2012-12-07T06:20:55Z</updated>
<author>
<name>Bill Pemberton</name>
<email>wfp5p@virginia.edu</email>
</author>
<published>2012-12-06T17:35:10Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=e23e7a1436207217000c2854214bc908936af3cb'/>
<id>urn:sha1:e23e7a1436207217000c2854214bc908936af3cb</id>
<content type='text'>
CONFIG_HOTPLUG is going away as an option.  As result the __dev*
markings will be going away.

Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst,
and __devexit.

Signed-off-by: Bill Pemberton &lt;wfp5p@virginia.edu&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
</feed>
