Switch madplay to the new API. This is done thanks to a patch written
by Micha Nelissen <micha@neli.hopto.org> and available at
http://article.gmane.org/gmane.comp.audio.mad.devel/729.
--- madplay-0.15.2b/audio_alsa.c 2008-10-18 15:10:16.000000000 +0200
+++ madplay-0.15.2b/audio_alsa.c.new 2008-10-18 15:03:27.000000000 +0200
-#define ALSA_PCM_OLD_HW_PARAMS_API
-#define ALSA_PCM_OLD_SW_PARAMS_API
#include <alsa/asoundlib.h>
+#define BUFFER_TIME_MAX 500000
-int buffer_time = 500000;
-int period_time = 100000;
-char *defaultdev = "plughw:0,0";
+unsigned char *buf = NULL;
+unsigned int channels = -1;
+unsigned int bitdepth = -1;
+unsigned int sample_size = -1;
+unsigned int buffer_time;
+unsigned int period_time;
+char *defaultdev = "plughw:0,0";
snd_pcm_hw_params_t *alsa_hwparams;
snd_pcm_sw_params_t *alsa_swparams;
-snd_pcm_sframes_t buffer_size;
-snd_pcm_sframes_t period_size;
+snd_pcm_uframes_t buffer_size;
snd_pcm_format_t alsa_format = -1;
snd_pcm_access_t alsa_access = SND_PCM_ACCESS_MMAP_INTERLEAVED;
snd_pcm_hw_params_t *params,
/* choose all parameters */
err = snd_pcm_hw_params_any(handle,params);
printf("Access type not available for playback: %s\n", snd_strerror(err));