[alsa-devel] Error in configuring playback device
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
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
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
participants (2)
-
Clemens Ladisch
-
Irfan Shaikh