There is a shameful lack of information on the Alsa website about how to write a driver for Alsa. This is becoming a frequently-asked question on the alsa-dev mailing list.
The best advice seems to be:
Update: Takashi has helped fill this gaping void: http://www.alsa-project.org/\~iwai/writing-an-alsa-driver/index.html
Alfons Adriaensen asked on the alsa-user mailing-list about the API change for v1.0: Is there any document that describes this new API and the rationale for it ?
Takashi responded: ... the doxygen output, i.e. online manual on web, is already based on the new API. Basically, the difference is found only in some snd_pcm_hw_params_xxx and snd_pcm_sw_params_xxx functions, such as snd_pcm_hw_params_get_access(). These functions returned non-integer value as the value itself, e.g.
int snd_pcm_hw_params_get_access(const snd_pcm_hw_params_t *params);
with the new API, they return always the error code and store the value in the given pointer uniformly, e.g.
int snd_pcm_hw_params_get_access(const snd_pcm_hw_params_t *params, snd_pcm_access_t *access);
so that you can check the error condition safely. btw, you can still use the old codes by defining
#define ALSA_PCM_OLD_HW_PARAMS_API #define ALSA_PCM_OLD_SW_PARAMS_API
before inclusion of asound/asoundlib.h. Takashi 20031123
Retrieved from "http://alsa.opensrc.org/WritingAnAlsaDriver"