alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* Error in configuring playback device
@ 2011-03-15 13:21 Irfan Shaikh
  2011-03-15 14:07 ` Clemens Ladisch
  0 siblings, 1 reply; 3+ messages in thread
From: Irfan Shaikh @ 2011-03-15 13:21 UTC (permalink / raw)
  To: alsa-devel@alsa-project.org

Hello all

Problem :

1)   I have an playback thread which i am closing and creating based on certain conditions
      Some times the my thread does not exit grace fully due to which my snd_pcm_close() does not gets executed.

2) Next time when i create thread i get error in configuring playback device

My idea to solve above problem :

         Can i alwayse close the device handle before opening it if pointer to playback handle exists
For eg :

if(playback_handle)
      snd_pcm_close(playback_handle);
snd_pcm_open(playback_handle);


Please suugest me some better method to solve the problem.

Regards



SASKEN BUSINESS DISCLAIMER: This message may contain confidential, proprietary or legally privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any 
 virus transmitted by this email.
Read Disclaimer at http://www.sasken.com/extras/mail_disclaimer.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Error in configuring playback device
  2011-03-15 13:21 Error in configuring playback device Irfan Shaikh
@ 2011-03-15 14:07 ` Clemens Ladisch
  2011-03-15 14:22   ` Irfan Shaikh
  0 siblings, 1 reply; 3+ messages in thread
From: Clemens Ladisch @ 2011-03-15 14:07 UTC (permalink / raw)
  To: Irfan Shaikh; +Cc: alsa-devel@alsa-project.org

Irfan Shaikh wrote:
> Can i alwayse close the device handle before opening it if pointer to playback handle exists
> 
> if(playback_handle)
>       snd_pcm_close(playback_handle);
> snd_pcm_open(playback_handle);

This will work, as long as you ensure that playback_handle is always set
to NULL when the device is actually closed.

> SASKEN BUSINESS DISCLAIMER: ... 

*** DISCLAIMER ***
This e-mail contains public information intended for any subscriber of
this mailing list and for anybody else who bothers to read it; it will
be copied, disclosed and distributed to the public.  If you think you
are not the intended recipient, please commit suicide immediately.
These terms apply also to any e-mails quoted in, referenced from, or
answering this e-mail, and supersede any disclaimers in those e-mails.
Additionally, disclaimers in those e-mails will incur legal processing
fees of $42 per line; you have agreed to this by reading this disclaimer.


Regards,
Clemens

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Error in configuring playback device
  2011-03-15 14:07 ` Clemens Ladisch
@ 2011-03-15 14:22   ` Irfan Shaikh
  0 siblings, 0 replies; 3+ messages in thread
From: Irfan Shaikh @ 2011-03-15 14:22 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: alsa-devel@alsa-project.org

playback_handle gets initialized to NULL.
Therefore snd_pcm_close() does not gets executed in if condition
My snd_pcm_open() always fails for first time even if i reset my hardware.

Please provide me some hint so that i can over come the above issue

> if(playback_handle)
>       snd_pcm_close(playback_handle);
> snd_pcm_open(playback_handle);

This will work, as long as you ensure that playback_handle is always set
to NULL when the device is actually closed.

SASKEN BUSINESS DISCLAIMER: This message may contain confidential, proprietary or legally privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any 
 virus transmitted by this email.
Read Disclaimer at http://www.sasken.com/extras/mail_disclaimer.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-15 14:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-15 13:21 Error in configuring playback device Irfan Shaikh
2011-03-15 14:07 ` Clemens Ladisch
2011-03-15 14:22   ` Irfan Shaikh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).