<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/include/sound/pcm.h, branch linux-6.10.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-05-29T08:40:36Z</updated>
<entry>
<title>ALSA: pcm: fix typo in comment</title>
<updated>2024-05-29T08:40:36Z</updated>
<author>
<name>Alexandre Belloni</name>
</author>
<published>2024-05-28T19:18:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6d40dbc75877110c5e0d661dd77f6cfce916765e'/>
<id>urn:sha1:6d40dbc75877110c5e0d661dd77f6cfce916765e</id>
<content type='text'>
Fix the typo in the comment for SNDRV_PCM_RATE_KNOT

Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20240528191850.63314-1-alexandre.belloni@bootlin.com
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm: add support for 705.6kHz and 768kHz sample rates</title>
<updated>2024-04-18T07:30:34Z</updated>
<author>
<name>Pavel Hofman</name>
</author>
<published>2024-04-16T12:17:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ad88ea67b135f74a9f32dc5404a35c773b2a3925'/>
<id>urn:sha1:ad88ea67b135f74a9f32dc5404a35c773b2a3925</id>
<content type='text'>
Many modern codecs support 705.6kHz and 768kHz sample rates. Current HW
params fail to set 705.6kHz and 768kHz sample rates as these are not in the
known-rates list.

Add these new rates to the known-rates list to allow them.

Also add defines in pcm.h so that drivers can use it.

Signed-off-by: Pavel Hofman &lt;pavel.hofman@ivitera.com&gt;
Reviewed-by: Jaroslav Kysela &lt;perex@perex.cz&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Message-ID: &lt;20240416121726.628679-3-pavel.hofman@ivitera.com&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm: Use guard() for PCM stream locks</title>
<updated>2024-02-28T14:01:22Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2024-02-27T08:53:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=650224fe8d5f6dbe6cc5875d14bf80da60dd56f8'/>
<id>urn:sha1:650224fe8d5f6dbe6cc5875d14bf80da60dd56f8</id>
<content type='text'>
Define guard() usage for PCM stream locking and use it in appropriate
places.

The pair of snd_pcm_stream_lock() and snd_pcm_stream_unlock() can be
presented with guard(pcm_stream_lock) now.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Link: https://lore.kernel.org/r/20240227085306.9764-23-tiwai@suse.de
</content>
</entry>
<entry>
<title>ALSA: pcm: Introduce MSBITS subformat interface</title>
<updated>2023-11-27T16:24:26Z</updated>
<author>
<name>Jaroslav Kysela</name>
</author>
<published>2023-11-17T12:05:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2112aa034907c428785e1a5730927181276ee45b'/>
<id>urn:sha1:2112aa034907c428785e1a5730927181276ee45b</id>
<content type='text'>
Improve granularity of format selection for S32/U32 formats by adding
constants representing 20, 24 and MAX most significant bits.

The MAX means the maximum number of significant bits which can
the physical format hold. For 32-bit formats, MAX is related
to 32 bits. For 8-bit formats, MAX is related to 8 bits etc.

As there is only one user currently (format S32_LE), subformat is
represented by a simple u32 and stores flags only for that one user
alone. The approach of subformat being part of struct snd_pcm_hardware
is a compromise between ALSA and ASoC allowing for
hw_params-intersection code to be alloc/free-less while not adding any
new responsibilities to ASoC runtime structures.

Acked-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Jaroslav Kysela &lt;perex@perex.cz&gt;
Co-developed-by: Cezary Rojewski &lt;cezary.rojewski@intel.com&gt;
Signed-off-by: Cezary Rojewski &lt;cezary.rojewski@intel.com&gt;
Link: https://lore.kernel.org/r/20231117120610.1755254-2-cezary.rojewski@intel.com
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm: Drop obsoleted PCM copy_user and copy_kernel ops</title>
<updated>2023-08-18T10:19:19Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2023-08-15T19:01:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6c0217b11066b9bcd6d8f1f8bd11c0610e536e04'/>
<id>urn:sha1:6c0217b11066b9bcd6d8f1f8bd11c0610e536e04</id>
<content type='text'>
Finally all users have been converted to the new PCM copy ops, let's
drop the obsoleted copy_kernel and copy_user ops completely.

Link: https://lore.kernel.org/r/20230815190136.8987-26-tiwai@suse.de
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: core: Add memory copy helpers between iov_iter and iomem</title>
<updated>2023-08-18T10:18:16Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2023-08-15T19:01:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=561b4fa9c1111292ec975a04ecd8372ac0256e1e'/>
<id>urn:sha1:561b4fa9c1111292ec975a04ecd8372ac0256e1e</id>
<content type='text'>
Add two more helpers for copying memory between iov_iter and iomem,
which will be used by the new PCM copy ops in a few drivers.
The existing helpers became wrappers of those now.

Note that copy_from/to_iter() returns the copied bytes, hence the
error condition is adjusted accordingly.

Link: https://lore.kernel.org/r/20230815190136.8987-4-tiwai@suse.de
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm: Add copy ops with iov_iter</title>
<updated>2023-08-18T10:18:15Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2023-08-15T19:01:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cf393babb37a1679a1ec1d864df1090353465e23'/>
<id>urn:sha1:cf393babb37a1679a1ec1d864df1090353465e23</id>
<content type='text'>
iov_iter is a universal interface to copy the data chunk from/to
user-space and kernel in a unified manner.  This API can fit for ALSA
PCM copy ops, too; we had to split to copy_user and copy_kernel in the
past, and those can be unified to a single ops with iov_iter.

This patch adds a new PCM copy ops that passes iov_iter for copying
both kernel and user-space in the same way.  This patch touches only
the ALSA PCM core part, and the actual users will be replaced in the
following patches.

The expansion of iov_iter is done in the PCM core right before calling
each copy callback.  It's a bit suboptimal, but I took this now as
it's the most straightforward replacement.  The more conversion to
iov_iter in the caller side is a TODO for future.

As of now, the old copy_user and copy_kernel ops are still kept.
Once after all users are converted, we'll drop the old copy_user and
copy_kernel ops, too.

Link: https://lore.kernel.org/r/20230815190136.8987-3-tiwai@suse.de
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm: Don't embed device</title>
<updated>2023-08-17T07:23:45Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2023-08-16T16:02:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bc41a7228cedc39395d032b2502975e53b7a9180'/>
<id>urn:sha1:bc41a7228cedc39395d032b2502975e53b7a9180</id>
<content type='text'>
So far we use the embedded struct device for each PCM substreams in
struct snd_pcm.  This may result in UAF when the delayed kobj release
is used; each corresponding struct device is still accessed at the
(delayed) device release, while the snd_pcm object may be already
gone.

As a workaround, detach the struct device from the snd_pcm object by
allocating via the new snd_device_alloc() helper.

A caveat is that we store the PCM substream pointer to drvdata since
the device resume and others require the access to it.

This patch is based on the fix Curtis posted initially.  In this
patch, the changes are split and use the new helper function instead.

Link: https://lore.kernel.org/r/20230801171928.1460120-1-cujomalainey@chromium.org
Reviewed-by: Jaroslav Kysela &lt;perex@perex.cz&gt;
Signed-off-by: Curtis Malainey &lt;cujomalainey@chromium.org&gt;
Tested-by: Curtis Malainey &lt;cujomalainey@chromium.org&gt;
Link: https://lore.kernel.org/r/20230816160252.23396-4-tiwai@suse.de
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm: rewrite snd_pcm_playback_silence()</title>
<updated>2023-04-21T10:21:04Z</updated>
<author>
<name>Oswald Buddenhagen</name>
</author>
<published>2023-04-20T11:33:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9f656705c5faa18afb26d922cfc64f9fd103c38d'/>
<id>urn:sha1:9f656705c5faa18afb26d922cfc64f9fd103c38d</id>
<content type='text'>
The auto-silencer supports two modes: "thresholded" to fill up "just
enough", and "top-up" to fill up "as much as possible". The two modes
used rather distinct code paths, which this patch unifies. The only
remaining distinction is how much we actually want to fill.

This fixes a bug in thresholded mode, where we failed to use new_hw_ptr,
resulting in under-fill.

Top-up mode is now more well-behaved and much easier to understand in
corner cases.

This also updates comments in the proximity of silencing-related data
structures.

Signed-off-by: Oswald Buddenhagen &lt;oswald.buddenhagen@gmx.de&gt;
Reviewed-by: Jaroslav Kysela &lt;perex@perex.cz&gt;
Link: https://lore.kernel.org/r/20230420113324.877164-1-oswald.buddenhagen@gmx.de
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm: fix undefined behavior in bit shift for SNDRV_PCM_RATE_KNOT</title>
<updated>2022-11-23T06:56:47Z</updated>
<author>
<name>Baisong Zhong</name>
</author>
<published>2022-11-21T11:00:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b5172e62458f8e6ff359e5f096044a488db90ac5'/>
<id>urn:sha1:b5172e62458f8e6ff359e5f096044a488db90ac5</id>
<content type='text'>
Shifting signed 32-bit value by 31 bits is undefined, so changing
significant bit to unsigned. The UBSAN warning calltrace like below:

UBSAN: shift-out-of-bounds in sound/core/pcm_native.c:2676:21
left shift of 1 by 31 places cannot be represented in type 'int'
...
Call Trace:
 &lt;TASK&gt;
 dump_stack_lvl+0x8d/0xcf
 ubsan_epilogue+0xa/0x44
 __ubsan_handle_shift_out_of_bounds+0x1e7/0x208
 snd_pcm_open_substream+0x9f0/0xa90
 snd_pcm_oss_open.part.26+0x313/0x670
 snd_pcm_oss_open+0x30/0x40
 soundcore_open+0x18b/0x2e0
 chrdev_open+0xe2/0x270
 do_dentry_open+0x2f7/0x620
 path_openat+0xd66/0xe70
 do_filp_open+0xe3/0x170
 do_sys_openat2+0x357/0x4a0
 do_sys_open+0x87/0xd0
 do_syscall_64+0x34/0x80

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Baisong Zhong &lt;zhongbaisong@huawei.com&gt;
Link: https://lore.kernel.org/r/20221121110044.3115686-1-zhongbaisong@huawei.com
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
</feed>
