On 01 November 2026 at 04:26 pm, Takashi Iwai <[email protected]> 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

Reply via email to