* Void PPC: PulseAudio issue with sound updates 7.4-rc1
@ 2026-11-01 9:15 Christian Zigotzky
2026-11-01 14:53 ` Christian Zigotzky
0 siblings, 1 reply; 12+ messages in thread
From: Christian Zigotzky @ 2026-11-01 9:15 UTC (permalink / raw)
To: zzzccc427
Cc: tiwai, perex, linux-sound, linuxppc-dev, R.T.Dickinson,
mad skateman, Damien Stewart
Hi,
Although PulseAudio recognises the sound cards, it is unable to
successfully initialise the corresponding output profiles on Void PPC
since the sound updates 7.4-rc1 [1]. The output via ALSA works.
Tested with the onboard HDA ATI SB sound device, Soundblaster LIVE
Player 1024 PCI card, AMD HDMI audio and with USB audio. Strangely
enough Pulseaudio can enable the sound devices on MintPPC32. I think the
latest sound updates are responsible for the issue on Void PPC.
I bisected last week [2] and ad28d2f607d1792c04531f2c5fd9ac0bf5bdcc9c
(ALSA: pcm: Serialize and check HW_REFINE ioctls) is the first bad commit.
I was able to revert the first bad commit and this solved the issue. [2]
Then I created a patch for reverting the bad commit. [3]
Could you please check the sound updates 7.4-rc1? [1]
Thanks,
Christian
[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=75c1cb8178fe84403fd95236ddf21754f0a4156c
[2] https://github.com/chzigotzky/kernels/issues/21
[3]
https://github.com/chzigotzky/kernels/commit/644ec7c1f2f812d5eb89741e643f742596a49b2d
[4] Screenshots:
- With the sound updates:
https://i.ibb.co/675Yjxvd/Kernel-7-4-0-with-sound-updates.png
- With the patched kernel:
https://i.ibb.co/9HDrnnm1/Kernel-7-4-0-alpha8-Power-PC-1.png and
https://i.ibb.co/vx77FdHV/Kernel-7-4-0-alpha8-Power-PC-2.png
--
Sent with BrassMonkey 35.0.2 (https://github.com/chzigotzky/Web-Browsers-and-Suites-for-Linux-PPC/releases/tag/BrassMonkey_35.0.2)
^ permalink raw reply [flat|nested] 12+ messages in thread
* Void PPC: PulseAudio issue with sound updates 7.4-rc1
2026-11-01 9:15 Void PPC: PulseAudio issue with sound updates 7.4-rc1 Christian Zigotzky
@ 2026-11-01 14:53 ` Christian Zigotzky
2026-11-01 15:26 ` Takashi Iwai
0 siblings, 1 reply; 12+ messages in thread
From: Christian Zigotzky @ 2026-11-01 14:53 UTC (permalink / raw)
To: zzzccc427
Cc: tiwai, perex, linux-sound, linuxppc-dev, R.T.Dickinson,
mad skateman, Damien Stewart, Christian Zigotzky
On 01/11/26 10:15, Christian Zigotzky wrote:
> Hi,
>
> Although PulseAudio recognises the sound cards, it is unable to
> successfully initialise the corresponding output profiles on Void PPC
> since the sound updates 7.4-rc1 [1]. The output via ALSA works.
>
> Tested with the onboard HDA ATI SB sound device, Soundblaster LIVE
> Player 1024 PCI card, AMD HDMI audio and with USB audio. Strangely
> enough Pulseaudio can enable the sound devices on MintPPC32. I think
> the latest sound updates are responsible for the issue on Void PPC.
>
> I bisected last week [2] and ad28d2f607d1792c04531f2c5fd9ac0bf5bdcc9c
> (ALSA: pcm: Serialize and check HW_REFINE ioctls) is the first bad
> commit.
>
> I was able to revert the first bad commit and this solved the issue. [2]
>
> Then I created a patch for reverting the bad commit. [3]
>
> Could you please check the sound updates 7.4-rc1? [1]
>
> Thanks,
> Christian
>
> [1]
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=75c1cb8178fe84403fd95236ddf21754f0a4156c
> [2] https://github.com/chzigotzky/kernels/issues/21
> [3]
> https://github.com/chzigotzky/kernels/commit/644ec7c1f2f812d5eb89741e643f742596a49b2d
> [4] Screenshots:
> - With the sound updates:
> https://i.ibb.co/675Yjxvd/Kernel-7-4-0-with-sound-updates.png
> - With the patched kernel:
> https://i.ibb.co/9HDrnnm1/Kernel-7-4-0-alpha8-Power-PC-1.png and
> https://i.ibb.co/vx77FdHV/Kernel-7-4-0-alpha8-Power-PC-2.png
>
The sound-fixes-7.4-rc1 [1] don't solve the issue with PulseAudio on
Void PPC. We still need the sound patch [2] for reverting the bad commit.
- Christian
[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e9954f3fbddd25e1a01b7e5a0b72fb8b564204e0
[2]
https://raw.githubusercontent.com/chzigotzky/kernels/refs/heads/main/patches/e5500/sound.patch
--
Sent with BrassMonkey 35.0.2 (https://github.com/chzigotzky/Web-Browsers-and-Suites-for-Linux-PPC/releases/tag/BrassMonkey_35.0.2)
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Void PPC: PulseAudio issue with sound updates 7.4-rc1
2026-11-01 14:53 ` Christian Zigotzky
@ 2026-11-01 15:26 ` Takashi Iwai
2026-11-03 7:34 ` Christian Zigotzky
0 siblings, 1 reply; 12+ messages in thread
From: Takashi Iwai @ 2026-11-01 15:26 UTC (permalink / raw)
To: Christian Zigotzky
Cc: zzzccc427, tiwai, perex, linux-sound, linuxppc-dev, R.T.Dickinson,
mad skateman, Damien Stewart, Christian Zigotzky
On Sun, 01 Nov 2026 15:53:07 +0100,
Christian Zigotzky wrote:
>
> On 01/11/26 10:15, Christian Zigotzky wrote:
> > Hi,
> >
> > Although PulseAudio recognises the sound cards, it is unable to
> > successfully initialise the corresponding output profiles on Void
> > PPC since the sound updates 7.4-rc1 [1]. The output via ALSA works.
> >
> > Tested with the onboard HDA ATI SB sound device, Soundblaster LIVE
> > Player 1024 PCI card, AMD HDMI audio and with USB audio. Strangely
> > enough Pulseaudio can enable the sound devices on MintPPC32. I think
> > the latest sound updates are responsible for the issue on Void PPC.
> >
> > I bisected last week [2] and
> > ad28d2f607d1792c04531f2c5fd9ac0bf5bdcc9c (ALSA: pcm: Serialize and
> > check HW_REFINE ioctls) is the first bad commit.
> >
> > I was able to revert the first bad commit and this solved the issue. [2]
> >
> > Then I created a patch for reverting the bad commit. [3]
> >
> > Could you please check the sound updates 7.4-rc1? [1]
> >
> > Thanks,
> > Christian
> >
> > [1]
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=75c1cb8178fe84403fd95236ddf21754f0a4156c
> > [2] https://github.com/chzigotzky/kernels/issues/21
> > [3]
> > https://github.com/chzigotzky/kernels/commit/644ec7c1f2f812d5eb89741e643f742596a49b2d
> > [4] Screenshots:
> > - With the sound updates:
> > https://i.ibb.co/675Yjxvd/Kernel-7-4-0-with-sound-updates.png
> > - With the patched kernel:
> > https://i.ibb.co/9HDrnnm1/Kernel-7-4-0-alpha8-Power-PC-1.png and
> > https://i.ibb.co/vx77FdHV/Kernel-7-4-0-alpha8-Power-PC-2.png
> >
>
> The sound-fixes-7.4-rc1 [1] don't solve the issue with PulseAudio on
> Void PPC. We still need the sound patch [2] for reverting the bad
> commit.
Hm, could you verify whether the below oneliner recovers from your
problem or not?
-- 8< --
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -965,7 +965,8 @@ static int snd_pcm_hw_refine_user(struct snd_pcm_substream *substream,
if (IS_ERR(params))
return PTR_ERR(params);
- err = snd_pcm_hw_refine_with_lock(substream, params);
+ //err = snd_pcm_hw_refine_with_lock(substream, params);
+ err = snd_pcm_hw_refine(substream, params);
if (err < 0)
return err;
-- 8< --
If this works, clear this change again, and figure out which check in
snd_pcm_hw_refine_with_lock() gives the error. The function has three
preliminary checks: PCM_RUNTIME_CHECK(), snd_pcm_buffer_access_lock()
(& unlock()), and hw_parms_state_check. The first one must be
harmless, and the real problem must be either
snd_pcm_buffer_access_lock() or hw_params_state_check().
```
static int snd_pcm_hw_refine_with_lock(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
struct snd_pcm_runtime *runtime;
int err;
if (PCM_RUNTIME_CHECK(substream))
return -ENXIO;
runtime = substream->runtime;
err = snd_pcm_buffer_access_lock(runtime);
if (err < 0)
return err;
err = hw_params_state_check(substream);
if (err)
goto unlock;
err = snd_pcm_hw_refine(substream, params);
unlock:
snd_pcm_buffer_access_unlock(runtime);
return err;
}
```
OTOH, if the oneliner above doesn't change the behavior, something
else overlooked obviously.
Oh wait, it might be the 32bit compat path? If so, the call at
snd_pcm_ioctl_hw_params_compat() needs to be tested, instead.
thanks,
Takashi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Void PPC: PulseAudio issue with sound updates 7.4-rc1
2026-11-01 15:26 ` Takashi Iwai
@ 2026-11-03 7:34 ` Christian Zigotzky
2026-11-03 7:44 ` Takashi Iwai
0 siblings, 1 reply; 12+ messages in thread
From: Christian Zigotzky @ 2026-11-03 7:34 UTC (permalink / raw)
To: Takashi Iwai
Cc: zzzccc427, tiwai, perex, linux-sound, linuxppc-dev, R.T.Dickinson,
mad skateman, Damien Stewart, Christian Zigotzky
On 01 November 2026 at 04:26 pm, Takashi Iwai <tiwai@suse.de> wrote:
Hm, could you verify whether the below oneliner recovers from your
problem or not?
-- 8< --
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -965,7 +965,8 @@ static int snd_pcm_hw_refine_user(struct snd_pcm_substream *substream,
if (IS_ERR(params))
return PTR_ERR(params);
- err = snd_pcm_hw_refine_with_lock(substream, params);
+ //err = snd_pcm_hw_refine_with_lock(substream, params);
+ err = snd_pcm_hw_refine(substream, params);
if (err < 0)
return err;
-- 8< --
If this works, clear this change again, and figure out which check in
snd_pcm_hw_refine_with_lock() gives the error. The function has three
preliminary checks: PCM_RUNTIME_CHECK(), snd_pcm_buffer_access_lock()
(& unlock()), and hw_parms_state_check. The first one must be
harmless, and the real problem must be either
snd_pcm_buffer_access_lock() or hw_params_state_check().
```
static int snd_pcm_hw_refine_with_lock(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
struct snd_pcm_runtime *runtime;
int err;
if (PCM_RUNTIME_CHECK(substream))
return -ENXIO;
runtime = substream->runtime;
err = snd_pcm_buffer_access_lock(runtime);
if (err < 0)
return err;
err = hw_params_state_check(substream);
if (err)
goto unlock;
err = snd_pcm_hw_refine(substream, params);
unlock:
snd_pcm_buffer_access_unlock(runtime);
return err;
}
```
OTOH, if the oneliner above doesn't change the behavior, something
else overlooked obviously.
Oh wait, it might be the 32bit compat path? If so, the call at
snd_pcm_ioctl_hw_params_compat() needs to be tested, instead.
thanks,
Takashi
- - -
Hi Takashi,
Thank you for your patch.
I tested your patch today but unfortunately it doesn’t solve the issue with PulseAudio on Void PPC.
Thanks for your help,
Christian
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Void PPC: PulseAudio issue with sound updates 7.4-rc1
2026-11-03 7:34 ` Christian Zigotzky
@ 2026-11-03 7:44 ` Takashi Iwai
2026-11-03 12:00 ` Christian Zigotzky
0 siblings, 1 reply; 12+ messages in thread
From: Takashi Iwai @ 2026-11-03 7:44 UTC (permalink / raw)
To: Christian Zigotzky
Cc: Takashi Iwai, zzzccc427, perex, linux-sound, linuxppc-dev,
R.T.Dickinson, mad skateman, Damien Stewart, Christian Zigotzky
On Tue, 03 Nov 2026 08:34:52 +0100,
Christian Zigotzky wrote:
>
> On 01 November 2026 at 04:26 pm, Takashi Iwai <tiwai@suse.de> wrote:
>
> Hm, could you verify whether the below oneliner recovers from your
> problem or not?
>
> -- 8< --
> --- a/sound/core/pcm_native.c
> +++ b/sound/core/pcm_native.c
> @@ -965,7 +965,8 @@ static int snd_pcm_hw_refine_user(struct snd_pcm_substream *substream,
> if (IS_ERR(params))
> return PTR_ERR(params);
>
> - err = snd_pcm_hw_refine_with_lock(substream, params);
> + //err = snd_pcm_hw_refine_with_lock(substream, params);
> + err = snd_pcm_hw_refine(substream, params);
> if (err < 0)
> return err;
>
> -- 8< --
>
> If this works, clear this change again, and figure out which check in
> snd_pcm_hw_refine_with_lock() gives the error. The function has three
> preliminary checks: PCM_RUNTIME_CHECK(), snd_pcm_buffer_access_lock()
> (& unlock()), and hw_parms_state_check. The first one must be
> harmless, and the real problem must be either
> snd_pcm_buffer_access_lock() or hw_params_state_check().
>
> ```
> static int snd_pcm_hw_refine_with_lock(struct snd_pcm_substream *substream,
> struct snd_pcm_hw_params *params)
> {
> struct snd_pcm_runtime *runtime;
> int err;
>
> if (PCM_RUNTIME_CHECK(substream))
> return -ENXIO;
> runtime = substream->runtime;
> err = snd_pcm_buffer_access_lock(runtime);
> if (err < 0)
> return err;
> err = hw_params_state_check(substream);
> if (err)
> goto unlock;
>
> err = snd_pcm_hw_refine(substream, params);
>
> unlock:
> snd_pcm_buffer_access_unlock(runtime);
> return err;
> }
> ```
>
> OTOH, if the oneliner above doesn't change the behavior, something
> else overlooked obviously.
>
> Oh wait, it might be the 32bit compat path? If so, the call at
> snd_pcm_ioctl_hw_params_compat() needs to be tested, instead.
>
>
> thanks,
>
> Takashi
>
>
> - - -
>
> Hi Takashi,
>
> Thank you for your patch.
>
> I tested your patch today but unfortunately it doesn’t solve the issue with PulseAudio on Void PPC.
Have you tried changing the call of snd_pcm_hw_refine_with_lock() in
snd_pcm_ioctl_hw_params_compat(), too? Or check the call in
snd_pcm_hw_refine_old_user(), too.
If it doesn't change even if you replace all callers of
snd_pcm_hw_refine_with_lock() with snd_pcm_hw_refine(), something
wrong in the test itself.
Takashi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Void PPC: PulseAudio issue with sound updates 7.4-rc1
2026-11-03 7:44 ` Takashi Iwai
@ 2026-11-03 12:00 ` Christian Zigotzky
2026-11-03 14:38 ` Takashi Iwai
0 siblings, 1 reply; 12+ messages in thread
From: Christian Zigotzky @ 2026-11-03 12:00 UTC (permalink / raw)
To: Takashi Iwai
Cc: Takashi Iwai, zzzccc427, perex, linux-sound, linuxppc-dev,
R.T.Dickinson, mad skateman, Damien Stewart, Christian Zigotzky
On 03 November 2026 at 08:44 am, Takashi Iwai <tiwai@suse.de> wrote:
Have you tried changing the call of snd_pcm_hw_refine_with_lock() in
snd_pcm_ioctl_hw_params_compat(), too? Or check the call in
snd_pcm_hw_refine_old_user(), too.
If it doesn't change even if you replace all callers of
snd_pcm_hw_refine_with_lock() with snd_pcm_hw_refine(), something
wrong in the test itself.
Takashi
- - -
I have tried it and sound works again.
My modifications:
diff -rupN a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c
--- a/sound/core/pcm_compat.c 2026-11-01 22:26:31.000000000 +0100
+++ b/sound/core/pcm_compat.c 2026-11-03 10:01:54.228010513 +0100
@@ -252,7 +252,7 @@ static int snd_pcm_ioctl_hw_params_compa
return -EFAULT;
if (refine) {
- err = snd_pcm_hw_refine_with_lock(substream, data);
+ err = snd_pcm_hw_refine(substream, data);
if (err < 0)
return err;
err = fixup_unreferenced_params(substream, data);
diff -rupN a/sound/core/pcm_native.c b/sound/core/pcm_native.c
--- a/sound/core/pcm_native.c 2026-11-01 22:26:31.000000000 +0100
+++ b/sound/core/pcm_native.c 2026-11-03 10:02:24.836343549 +0100
@@ -932,29 +932,6 @@ static int snd_pcm_hw_params_user(struct
* this one should be used for ioctls and other external paths instead of
* direct call of snd_pcm_hw_refine()
*/
-static int snd_pcm_hw_refine_with_lock(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params)
-{
- struct snd_pcm_runtime *runtime;
- int err;
-
- if (PCM_RUNTIME_CHECK(substream))
- return -ENXIO;
- runtime = substream->runtime;
- err = snd_pcm_buffer_access_lock(runtime);
- if (err < 0)
- return err;
- err = hw_params_state_check(substream);
- if (err)
- goto unlock;
-
- err = snd_pcm_hw_refine(substream, params);
-
- unlock:
- snd_pcm_buffer_access_unlock(runtime);
- return err;
-}
-
static int snd_pcm_hw_refine_user(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params __user * _params)
{
@@ -965,7 +942,7 @@ static int snd_pcm_hw_refine_user(struct
if (IS_ERR(params))
return PTR_ERR(params);
- err = snd_pcm_hw_refine_with_lock(substream, params);
+ err = snd_pcm_hw_refine(substream, params);
if (err < 0)
return err;
@@ -4247,7 +4224,7 @@ static int snd_pcm_hw_refine_old_user(st
if (IS_ERR(oparams))
return PTR_ERR(oparams);
snd_pcm_hw_convert_from_old_params(params, oparams);
- err = snd_pcm_hw_refine_with_lock(substream, params);
+ err = snd_pcm_hw_refine(substream, params);
if (err < 0)
return err;
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Void PPC: PulseAudio issue with sound updates 7.4-rc1
2026-11-03 12:00 ` Christian Zigotzky
@ 2026-11-03 14:38 ` Takashi Iwai
2026-11-04 0:40 ` [PATCH] ALSA: pcm: Allow HW_REFINE queries with mapped buffers Vincent Cloutier
0 siblings, 1 reply; 12+ messages in thread
From: Takashi Iwai @ 2026-11-03 14:38 UTC (permalink / raw)
To: Christian Zigotzky
Cc: Takashi Iwai, zzzccc427, perex, linux-sound, linuxppc-dev,
R.T.Dickinson, mad skateman, Damien Stewart, Christian Zigotzky
On Tue, 03 Nov 2026 13:00:24 +0100,
Christian Zigotzky wrote:
>
> On 03 November 2026 at 08:44 am, Takashi Iwai <tiwai@suse.de> wrote:
>
> Have you tried changing the call of snd_pcm_hw_refine_with_lock() in
> snd_pcm_ioctl_hw_params_compat(), too? Or check the call in
> snd_pcm_hw_refine_old_user(), too.
>
> If it doesn't change even if you replace all callers of
> snd_pcm_hw_refine_with_lock() with snd_pcm_hw_refine(), something
> wrong in the test itself.
>
>
> Takashi
>
> - - -
>
> I have tried it and sound works again.
Then please figure out which replacement of
snd_pcm_hw_refine_with_lock() actually matters.
(You can keep snd_pcm_hw_refine_with_lock() definition there.)
thanks,
Takashi
>
> My modifications:
>
> diff -rupN a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c
> --- a/sound/core/pcm_compat.c 2026-11-01 22:26:31.000000000 +0100
> +++ b/sound/core/pcm_compat.c 2026-11-03 10:01:54.228010513 +0100
> @@ -252,7 +252,7 @@ static int snd_pcm_ioctl_hw_params_compa
> return -EFAULT;
>
> if (refine) {
> - err = snd_pcm_hw_refine_with_lock(substream, data);
> + err = snd_pcm_hw_refine(substream, data);
> if (err < 0)
> return err;
> err = fixup_unreferenced_params(substream, data);
> diff -rupN a/sound/core/pcm_native.c b/sound/core/pcm_native.c
> --- a/sound/core/pcm_native.c 2026-11-01 22:26:31.000000000 +0100
> +++ b/sound/core/pcm_native.c 2026-11-03 10:02:24.836343549 +0100
> @@ -932,29 +932,6 @@ static int snd_pcm_hw_params_user(struct
> * this one should be used for ioctls and other external paths instead of
> * direct call of snd_pcm_hw_refine()
> */
> -static int snd_pcm_hw_refine_with_lock(struct snd_pcm_substream *substream,
> - struct snd_pcm_hw_params *params)
> -{
> - struct snd_pcm_runtime *runtime;
> - int err;
> -
> - if (PCM_RUNTIME_CHECK(substream))
> - return -ENXIO;
> - runtime = substream->runtime;
> - err = snd_pcm_buffer_access_lock(runtime);
> - if (err < 0)
> - return err;
> - err = hw_params_state_check(substream);
> - if (err)
> - goto unlock;
> -
> - err = snd_pcm_hw_refine(substream, params);
> -
> - unlock:
> - snd_pcm_buffer_access_unlock(runtime);
> - return err;
> -}
> -
> static int snd_pcm_hw_refine_user(struct snd_pcm_substream *substream,
> struct snd_pcm_hw_params __user * _params)
> {
> @@ -965,7 +942,7 @@ static int snd_pcm_hw_refine_user(struct
> if (IS_ERR(params))
> return PTR_ERR(params);
>
> - err = snd_pcm_hw_refine_with_lock(substream, params);
> + err = snd_pcm_hw_refine(substream, params);
> if (err < 0)
> return err;
>
> @@ -4247,7 +4224,7 @@ static int snd_pcm_hw_refine_old_user(st
> if (IS_ERR(oparams))
> return PTR_ERR(oparams);
> snd_pcm_hw_convert_from_old_params(params, oparams);
> - err = snd_pcm_hw_refine_with_lock(substream, params);
> + err = snd_pcm_hw_refine(substream, params);
> if (err < 0)
> return err;
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] ALSA: pcm: Allow HW_REFINE queries with mapped buffers
2026-11-03 14:38 ` Takashi Iwai
@ 2026-11-04 0:40 ` Vincent Cloutier
2026-11-04 5:27 ` Christian Zigotzky
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Vincent Cloutier @ 2026-11-04 0:40 UTC (permalink / raw)
To: Takashi Iwai
Cc: Vincent Cloutier, Christian Zigotzky, Cen Zhang, Jaroslav Kysela,
linux-sound
From: Vincent Cloutier <vincent@cloutier.co>
PulseAudio 16.1 queries supported formats after configuring and mapping
a PCM buffer. Sharing HW_PARAMS' state checker with HW_REFINE causes
these queries to fail with -EBADFD because a non-OSS stream has active
buffer mappings. PulseAudio then fails to create its sinks and sources.
Make the mmap restriction optional in the shared state checker. Keep it
for HW_PARAMS, which can reconfigure the mapped buffer, but skip it for
HW_REFINE, which only refines the caller's constraint structure. Keep
the stream-state checks and buffer access locking for native, compat
and legacy refinement ioctls rather than bypassing their wrapper.
Leave the accepted stream states unchanged.
On Librem 5, both L5 and Modem cards reproduce the failure for playback
and capture: refinement succeeds before setup and after RW setup, but
fails after MMAP setup in PREPARED state. With this change, all eight
cases pass, PulseAudio starts normally and audible playback works.
The reproducer does not start streams or transfer audio data.
Fixes: ad28d2f607d1 ("ALSA: pcm: Serialize and check HW_REFINE ioctls")
Link: https://lore.kernel.org/linux-sound/41a2e39a-5637-8afa-f84f-f79e63b3b56e@xenosoft.de/
Link: https://lore.kernel.org/linux-sound/874idyx9n6.wl-tiwai@suse.de/
Assisted-by: OpenCode:GPT-6.1 Sol
Signed-off-by: Vincent Cloutier <vincent@cloutier.co>
---
sound/core/pcm_native.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 5cbf88da7626..01d9f5ad4ea9 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -776,14 +776,15 @@ static void pcm_qos_req_update(struct snd_pcm_substream *substream, int usecs)
usecs);
}
-static int hw_params_state_check(struct snd_pcm_substream *substream)
+static int hw_params_state_check(struct snd_pcm_substream *substream,
+ bool check_mmap)
{
guard(pcm_stream_lock_irq)(substream);
switch (substream->runtime->state) {
case SNDRV_PCM_STATE_OPEN:
case SNDRV_PCM_STATE_SETUP:
case SNDRV_PCM_STATE_PREPARED:
- if (!is_oss_stream(substream) &&
+ if (check_mmap && !is_oss_stream(substream) &&
atomic_read(&substream->mmap_count))
return -EBADFD;
return 0;
@@ -806,7 +807,7 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream,
err = snd_pcm_buffer_access_lock(runtime);
if (err < 0)
return err;
- err = hw_params_state_check(substream);
+ err = hw_params_state_check(substream, true);
if (err)
goto unlock;
@@ -944,7 +945,8 @@ static int snd_pcm_hw_refine_with_lock(struct snd_pcm_substream *substream,
err = snd_pcm_buffer_access_lock(runtime);
if (err < 0)
return err;
- err = hw_params_state_check(substream);
+ /* Refinement queries constraints without changing the mapped buffer. */
+ err = hw_params_state_check(substream, false);
if (err)
goto unlock;
base-commit: 05441d697f7f9a927264f4058cbbc6a03dfcac9d
--
2.56.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] ALSA: pcm: Allow HW_REFINE queries with mapped buffers
2026-11-04 0:40 ` [PATCH] ALSA: pcm: Allow HW_REFINE queries with mapped buffers Vincent Cloutier
@ 2026-11-04 5:27 ` Christian Zigotzky
2026-11-04 7:30 ` Takashi Iwai
2026-11-04 7:28 ` Takashi Iwai
2026-11-04 11:38 ` Christian Zigotzky
2 siblings, 1 reply; 12+ messages in thread
From: Christian Zigotzky @ 2026-11-04 5:27 UTC (permalink / raw)
To: Vincent Cloutier, Takashi Iwai
Cc: Vincent Cloutier, Cen Zhang, Jaroslav Kysela, linux-sound,
R.T.Dickinson, mad skateman, Damien Stewart, Christian Zigotzky
On 11/04/2026 01:40 AM, Vincent Cloutier wrote:
> From: Vincent Cloutier <vincent@cloutier.co>
>
> PulseAudio 16.1 queries supported formats after configuring and mapping
> a PCM buffer. Sharing HW_PARAMS' state checker with HW_REFINE causes
> these queries to fail with -EBADFD because a non-OSS stream has active
> buffer mappings. PulseAudio then fails to create its sinks and sources.
>
> Make the mmap restriction optional in the shared state checker. Keep it
> for HW_PARAMS, which can reconfigure the mapped buffer, but skip it for
> HW_REFINE, which only refines the caller's constraint structure. Keep
> the stream-state checks and buffer access locking for native, compat
> and legacy refinement ioctls rather than bypassing their wrapper.
> Leave the accepted stream states unchanged.
>
> On Librem 5, both L5 and Modem cards reproduce the failure for playback
> and capture: refinement succeeds before setup and after RW setup, but
> fails after MMAP setup in PREPARED state. With this change, all eight
> cases pass, PulseAudio starts normally and audible playback works.
> The reproducer does not start streams or transfer audio data.
>
> Fixes: ad28d2f607d1 ("ALSA: pcm: Serialize and check HW_REFINE ioctls")
> Link: https://lore.kernel.org/linux-sound/41a2e39a-5637-8afa-f84f-f79e63b3b56e@xenosoft.de/
> Link: https://lore.kernel.org/linux-sound/874idyx9n6.wl-tiwai@suse.de/
> Assisted-by: OpenCode:GPT-6.1 Sol
> Signed-off-by: Vincent Cloutier <vincent@cloutier.co>
> ---
> sound/core/pcm_native.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
> index 5cbf88da7626..01d9f5ad4ea9 100644
> --- a/sound/core/pcm_native.c
> +++ b/sound/core/pcm_native.c
> @@ -776,14 +776,15 @@ static void pcm_qos_req_update(struct snd_pcm_substream *substream, int usecs)
> usecs);
> }
>
> -static int hw_params_state_check(struct snd_pcm_substream *substream)
> +static int hw_params_state_check(struct snd_pcm_substream *substream,
> + bool check_mmap)
> {
> guard(pcm_stream_lock_irq)(substream);
> switch (substream->runtime->state) {
> case SNDRV_PCM_STATE_OPEN:
> case SNDRV_PCM_STATE_SETUP:
> case SNDRV_PCM_STATE_PREPARED:
> - if (!is_oss_stream(substream) &&
> + if (check_mmap && !is_oss_stream(substream) &&
> atomic_read(&substream->mmap_count))
> return -EBADFD;
> return 0;
> @@ -806,7 +807,7 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream,
> err = snd_pcm_buffer_access_lock(runtime);
> if (err < 0)
> return err;
> - err = hw_params_state_check(substream);
> + err = hw_params_state_check(substream, true);
> if (err)
> goto unlock;
>
> @@ -944,7 +945,8 @@ static int snd_pcm_hw_refine_with_lock(struct snd_pcm_substream *substream,
> err = snd_pcm_buffer_access_lock(runtime);
> if (err < 0)
> return err;
> - err = hw_params_state_check(substream);
> + /* Refinement queries constraints without changing the mapped buffer. */
> + err = hw_params_state_check(substream, false);
> if (err)
> goto unlock;
>
>
> base-commit: 05441d697f7f9a927264f4058cbbc6a03dfcac9d
@Takashi
Should I still try to find out which replacement of
snd_pcm_hw_refine_with_lock() actually matters or has the issue been
sorted out with Vincent's patch?
- Christian
--
Sent with BrassMonkey 35.0.2 (https://github.com/chzigotzky/Web-Browsers-and-Suites-for-Linux-PPC/releases/tag/BrassMonkey_35.0.2)
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ALSA: pcm: Allow HW_REFINE queries with mapped buffers
2026-11-04 0:40 ` [PATCH] ALSA: pcm: Allow HW_REFINE queries with mapped buffers Vincent Cloutier
2026-11-04 5:27 ` Christian Zigotzky
@ 2026-11-04 7:28 ` Takashi Iwai
2026-11-04 11:38 ` Christian Zigotzky
2 siblings, 0 replies; 12+ messages in thread
From: Takashi Iwai @ 2026-11-04 7:28 UTC (permalink / raw)
To: Vincent Cloutier
Cc: Takashi Iwai, Vincent Cloutier, Christian Zigotzky, Cen Zhang,
Jaroslav Kysela, linux-sound
On Wed, 04 Nov 2026 01:40:25 +0100,
Vincent Cloutier wrote:
>
> From: Vincent Cloutier <vincent@cloutier.co>
>
> PulseAudio 16.1 queries supported formats after configuring and mapping
> a PCM buffer. Sharing HW_PARAMS' state checker with HW_REFINE causes
> these queries to fail with -EBADFD because a non-OSS stream has active
> buffer mappings. PulseAudio then fails to create its sinks and sources.
>
> Make the mmap restriction optional in the shared state checker. Keep it
> for HW_PARAMS, which can reconfigure the mapped buffer, but skip it for
> HW_REFINE, which only refines the caller's constraint structure. Keep
> the stream-state checks and buffer access locking for native, compat
> and legacy refinement ioctls rather than bypassing their wrapper.
> Leave the accepted stream states unchanged.
>
> On Librem 5, both L5 and Modem cards reproduce the failure for playback
> and capture: refinement succeeds before setup and after RW setup, but
> fails after MMAP setup in PREPARED state. With this change, all eight
> cases pass, PulseAudio starts normally and audible playback works.
> The reproducer does not start streams or transfer audio data.
>
> Fixes: ad28d2f607d1 ("ALSA: pcm: Serialize and check HW_REFINE ioctls")
> Link: https://lore.kernel.org/linux-sound/41a2e39a-5637-8afa-f84f-f79e63b3b56e@xenosoft.de/
> Link: https://lore.kernel.org/linux-sound/874idyx9n6.wl-tiwai@suse.de/
> Assisted-by: OpenCode:GPT-6.1 Sol
> Signed-off-by: Vincent Cloutier <vincent@cloutier.co>
Applied now. Thanks.
Takashi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ALSA: pcm: Allow HW_REFINE queries with mapped buffers
2026-11-04 5:27 ` Christian Zigotzky
@ 2026-11-04 7:30 ` Takashi Iwai
0 siblings, 0 replies; 12+ messages in thread
From: Takashi Iwai @ 2026-11-04 7:30 UTC (permalink / raw)
To: Christian Zigotzky
Cc: Vincent Cloutier, Takashi Iwai, Vincent Cloutier, Cen Zhang,
Jaroslav Kysela, linux-sound, R.T.Dickinson, mad skateman,
Damien Stewart, Christian Zigotzky
On Wed, 04 Nov 2026 06:27:00 +0100,
Christian Zigotzky wrote:
>
> On 11/04/2026 01:40 AM, Vincent Cloutier wrote:
> > From: Vincent Cloutier <vincent@cloutier.co>
> >
> > PulseAudio 16.1 queries supported formats after configuring and mapping
> > a PCM buffer. Sharing HW_PARAMS' state checker with HW_REFINE causes
> > these queries to fail with -EBADFD because a non-OSS stream has active
> > buffer mappings. PulseAudio then fails to create its sinks and sources.
> >
> > Make the mmap restriction optional in the shared state checker. Keep it
> > for HW_PARAMS, which can reconfigure the mapped buffer, but skip it for
> > HW_REFINE, which only refines the caller's constraint structure. Keep
> > the stream-state checks and buffer access locking for native, compat
> > and legacy refinement ioctls rather than bypassing their wrapper.
> > Leave the accepted stream states unchanged.
> >
> > On Librem 5, both L5 and Modem cards reproduce the failure for playback
> > and capture: refinement succeeds before setup and after RW setup, but
> > fails after MMAP setup in PREPARED state. With this change, all eight
> > cases pass, PulseAudio starts normally and audible playback works.
> > The reproducer does not start streams or transfer audio data.
> >
> > Fixes: ad28d2f607d1 ("ALSA: pcm: Serialize and check HW_REFINE ioctls")
> > Link: https://lore.kernel.org/linux-sound/41a2e39a-5637-8afa-f84f-f79e63b3b56e@xenosoft.de/
> > Link: https://lore.kernel.org/linux-sound/874idyx9n6.wl-tiwai@suse.de/
> > Assisted-by: OpenCode:GPT-6.1 Sol
> > Signed-off-by: Vincent Cloutier <vincent@cloutier.co>
> > ---
> > sound/core/pcm_native.c | 10 ++++++----
> > 1 file changed, 6 insertions(+), 4 deletions(-)
> >
> > diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
> > index 5cbf88da7626..01d9f5ad4ea9 100644
> > --- a/sound/core/pcm_native.c
> > +++ b/sound/core/pcm_native.c
> > @@ -776,14 +776,15 @@ static void pcm_qos_req_update(struct snd_pcm_substream *substream, int usecs)
> > usecs);
> > }
> > -static int hw_params_state_check(struct snd_pcm_substream
> > *substream)
> > +static int hw_params_state_check(struct snd_pcm_substream *substream,
> > + bool check_mmap)
> > {
> > guard(pcm_stream_lock_irq)(substream);
> > switch (substream->runtime->state) {
> > case SNDRV_PCM_STATE_OPEN:
> > case SNDRV_PCM_STATE_SETUP:
> > case SNDRV_PCM_STATE_PREPARED:
> > - if (!is_oss_stream(substream) &&
> > + if (check_mmap && !is_oss_stream(substream) &&
> > atomic_read(&substream->mmap_count))
> > return -EBADFD;
> > return 0;
> > @@ -806,7 +807,7 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream,
> > err = snd_pcm_buffer_access_lock(runtime);
> > if (err < 0)
> > return err;
> > - err = hw_params_state_check(substream);
> > + err = hw_params_state_check(substream, true);
> > if (err)
> > goto unlock;
> > @@ -944,7 +945,8 @@ static int snd_pcm_hw_refine_with_lock(struct
> > snd_pcm_substream *substream,
> > err = snd_pcm_buffer_access_lock(runtime);
> > if (err < 0)
> > return err;
> > - err = hw_params_state_check(substream);
> > + /* Refinement queries constraints without changing the mapped buffer. */
> > + err = hw_params_state_check(substream, false);
> > if (err)
> > goto unlock;
> >
> > base-commit: 05441d697f7f9a927264f4058cbbc6a03dfcac9d
> @Takashi
>
> Should I still try to find out which replacement of
> snd_pcm_hw_refine_with_lock() actually matters or has the issue been
> sorted out with Vincent's patch?
Try Vincent's patch at first. If it doesn't help, go for further
investigations.
thanks,
Takashi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ALSA: pcm: Allow HW_REFINE queries with mapped buffers
2026-11-04 0:40 ` [PATCH] ALSA: pcm: Allow HW_REFINE queries with mapped buffers Vincent Cloutier
2026-11-04 5:27 ` Christian Zigotzky
2026-11-04 7:28 ` Takashi Iwai
@ 2026-11-04 11:38 ` Christian Zigotzky
2 siblings, 0 replies; 12+ messages in thread
From: Christian Zigotzky @ 2026-11-04 11:38 UTC (permalink / raw)
To: Vincent Cloutier
Cc: Takashi Iwai, Vincent Cloutier, Zhang Cen, Jaroslav Kysela,
linux-sound, R.T.Dickinson, mad skateman, Damien Stewart,
Christian Zigotzky
On 04 November 2026 at 01:41 am, Vincent Cloutier <vincent.cloutier@icloud.com> wrote:
From: Vincent Cloutier <vincent@cloutier.co>
PulseAudio 16.1 queries supported formats after configuring and mapping
a PCM buffer. Sharing HW_PARAMS' state checker with HW_REFINE causes
these queries to fail with -EBADFD because a non-OSS stream has active
buffer mappings. PulseAudio then fails to create its sinks and sources.
Make the mmap restriction optional in the shared state checker. Keep it
for HW_PARAMS, which can reconfigure the mapped buffer, but skip it for
HW_REFINE, which only refines the caller's constraint structure. Keep
the stream-state checks and buffer access locking for native, compat
and legacy refinement ioctls rather than bypassing their wrapper.
Leave the accepted stream states unchanged.
On Librem 5, both L5 and Modem cards reproduce the failure for playback
and capture: refinement succeeds before setup and after RW setup, but
fails after MMAP setup in PREPARED state. With this change, all eight
cases pass, PulseAudio starts normally and audible playback works.
The reproducer does not start streams or transfer audio data.
Fixes: ad28d2f607d1 ("ALSA: pcm: Serialize and check HW_REFINE ioctls")
Link: https://lore.kernel.org/linux-sound/41a2e39a-5637-8afa-f84f-f79e63b3b56e@xenosoft.de/
Link: https://lore.kernel.org/linux-sound/874idyx9n6.wl-tiwai@suse.de/
Assisted-by: OpenCode:GPT-6.1 Sol
Signed-off-by: Vincent Cloutier <vincent@cloutier.co>
---
sound/core/pcm_native.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 5cbf88da7626..01d9f5ad4ea9 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -776,14 +776,15 @@ static void pcm_qos_req_update(struct snd_pcm_substream *substream, int usecs)
usecs);
}
-static int hw_params_state_check(struct snd_pcm_substream *substream)
+static int hw_params_state_check(struct snd_pcm_substream *substream,
+ bool check_mmap)
{
guard(pcm_stream_lock_irq)(substream);
switch (substream->runtime->state) {
case SNDRV_PCM_STATE_OPEN:
case SNDRV_PCM_STATE_SETUP:
case SNDRV_PCM_STATE_PREPARED:
- if (!is_oss_stream(substream) &&
+ if (check_mmap && !is_oss_stream(substream) &&
atomic_read(&substream->mmap_count))
return -EBADFD;
return 0;
@@ -806,7 +807,7 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream,
err = snd_pcm_buffer_access_lock(runtime);
if (err < 0)
return err;
- err = hw_params_state_check(substream);
+ err = hw_params_state_check(substream, true);
if (err)
goto unlock;
@@ -944,7 +945,8 @@ static int snd_pcm_hw_refine_with_lock(struct snd_pcm_substream *substream,
err = snd_pcm_buffer_access_lock(runtime);
if (err < 0)
return err;
- err = hw_params_state_check(substream);
+ /* Refinement queries constraints without changing the mapped buffer. */
+ err = hw_params_state_check(substream, false);
if (err)
goto unlock;
base-commit: 05441d697f7f9a927264f4058cbbc6a03dfcac9d
--
2.56.0
- - -
Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de>
The issue from the thread “Void PPC: PulseAudio issue with sound updates 7.4-rc1” has been fixed with this patch.
Thanks
^ permalink raw reply related [flat|nested] 12+ messages in thread
end of thread, other threads:[~2026-11-04 11:39 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-01 9:15 Void PPC: PulseAudio issue with sound updates 7.4-rc1 Christian Zigotzky
2026-11-01 14:53 ` Christian Zigotzky
2026-11-01 15:26 ` Takashi Iwai
2026-11-03 7:34 ` Christian Zigotzky
2026-11-03 7:44 ` Takashi Iwai
2026-11-03 12:00 ` Christian Zigotzky
2026-11-03 14:38 ` Takashi Iwai
2026-11-04 0:40 ` [PATCH] ALSA: pcm: Allow HW_REFINE queries with mapped buffers Vincent Cloutier
2026-11-04 5:27 ` Christian Zigotzky
2026-11-04 7:30 ` Takashi Iwai
2026-11-04 7:28 ` Takashi Iwai
2026-11-04 11:38 ` Christian Zigotzky
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.