Commit 28c61501 authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Linus Torvalds

[PATCH] ALSA Harmony fixes

 - The entire silence buffer is now being filled, instead of just 1/8th of it.
 - The silence buffer is now prepared during initialisation of the driver.
 - snd_pcm_format_size() is missing from the ALSA headers:
   using snd_pcm_format_physical_width() instead.
Signed-off-by: default avatarStuart Brady <sdbrady@ntlworld.com>
Signed-off-by: default avatarMatthew Wilcox <willy@parisc-linux.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 7f93f6dd
......@@ -310,7 +310,7 @@ static int harmony_detect_rate(int *freq)
case 32000: newrate = HARMONY_SR_32KHZ; break;
case 48000: newrate = HARMONY_SR_48KHZ; break;
case 9600: newrate = HARMONY_SR_9KHZ; break;
case 5125: newrate = HARMONY_SR_5KHZ; break;
case 5512: newrate = HARMONY_SR_5KHZ; break;
case 11025: newrate = HARMONY_SR_11KHZ; break;
case 18900: newrate = HARMONY_SR_18KHZ; break;
case 22050: newrate = HARMONY_SR_22KHZ; break;
......
......@@ -368,7 +368,7 @@ snd_harmony_capture_trigger(snd_pcm_substream_t *ss, int cmd)
}
static int
snd_harmony_set_data_format(harmony_t *h, int fmt)
snd_harmony_set_data_format(harmony_t *h, int fmt, int force)
{
int o = h->st.format;
int n;
......@@ -388,10 +388,10 @@ snd_harmony_set_data_format(harmony_t *h, int fmt)
break;
}
if (o != n) {
if (force || o != n) {
snd_pcm_format_set_silence(fmt, h->sdma.area,
SILENCE_BUFSZ /
snd_pcm_format_width(fmt));
(snd_pcm_format_physical_width(fmt) / 8));
}
return n;
......@@ -412,7 +412,7 @@ snd_harmony_playback_prepare(snd_pcm_substream_t *ss)
h->st.playing = 0;
h->st.rate = snd_harmony_rate_bits(rt->rate);
h->st.format = snd_harmony_set_data_format(h, rt->format);
h->st.format = snd_harmony_set_data_format(h, rt->format, 0);
if (rt->channels == 2)
h->st.stereo = HARMONY_SS_STEREO;
......@@ -441,7 +441,7 @@ snd_harmony_capture_prepare(snd_pcm_substream_t *ss)
h->st.capturing = 0;
h->st.rate = snd_harmony_rate_bits(rt->rate);
h->st.format = snd_harmony_set_data_format(h, rt->format);
h->st.format = snd_harmony_set_data_format(h, rt->format, 0);
if (rt->channels == 2)
h->st.stereo = HARMONY_SS_STEREO;
......@@ -666,6 +666,9 @@ snd_harmony_pcm_init(harmony_t *h)
return err;
}
h->st.format = snd_harmony_set_data_format(h,
SNDRV_PCM_FORMAT_S16_BE, 1);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment