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