[alsa-devel] How to do pause/resume in ALSA application
Hi,
I am using the snd_pcm_pause API in my application but it is returning error: Invalid argument. I am passing the PCM handle of the playback stream which I opened earlier and using to play a WAV file. Although I am able to hear the WAV file correctly, I am not able to pause. I checked whether the pause functionality is supported, using snd_pcm_hw_params_can_pause() and it returned me success.
Any help is welcome.
Thanks & Regards,
Anuj Aggarwal
Aggarwal, Anuj wrote:
I am using the snd_pcm_pause API in my application but it is returning error: Invalid argument.
This indicates that the driver (or some PCM plugin) does not support pausing.
I checked whether the pause functionality is supported, using snd_pcm_hw_params_can_pause() and it returned me success.
This is a bug. What device name did you use when opening the device, and which driver are you using?
Regards, Clemens
Clemens,
Are you suggesting a bug in the driver or in the library?
I passed "plughw:0,0" as the device name. We have our own driver for the audio codec, written as per the ALSA framework.
Thanks & Regards, Anuj Aggarwal
-----Original Message----- From: alsa-devel-bounces@alsa-project.org [mailto:alsa-devel-bounces@alsa-project.org] On Behalf Of Clemens Ladisch Sent: Wednesday, March 05, 2008 9:23 PM To: Aggarwal, Anuj Cc: alsa-devel@alsa-project.org; suresh.raj@gmail.com Subject: Re: [alsa-devel] How to do pause/resume in ALSA application
Aggarwal, Anuj wrote:
I am using the snd_pcm_pause API in my application but it is returning error: Invalid argument.
This indicates that the driver (or some PCM plugin) does not support pausing.
I checked whether the pause functionality is supported, using snd_pcm_hw_params_can_pause() and it returned me success.
This is a bug. What device name did you use when opening the device, and which driver are you using?
Regards, Clemens _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
(please don't top-post) Aggarwal, Anuj wrote:
Are you suggesting a bug in the driver or in the library?
Yes.
I passed "plughw:0,0" as the device name.
The plug plugin doesn't do funny things with pausing, so the bug must be in the driver.
We have our own driver for the audio codec, written as per the ALSA framework.
I'd guess that the SNDRV_PCM_INFO_PAUSE flag is set, but that the trigger callback doesn't implement SNDRV_PCM_TRIGGER_PAUSE_PUSH/RELEASE.
HTH Clemens
participants (2)
-
Aggarwal, Anuj
-
Clemens Ladisch