[alsa-devel] alsa-lib: Rate conversion broken for non-S16?
I have a device (snd-usb-caiaq) whose native sample format is S24_3BE. When sample rate conversion is used, the audio becomes near silent, distorted, and only in the left channel.
It is reproducable with aplay (see example below). Recording is not affected. Playback is correct if only format conversion is used.
It looks something is causing the incorrect put function to be used by the rate conversion.
I traced it to linear_expand() and others, alsa-lib-src/pcm_rate_linear.c.
Forcing the function to put S16 format into the destination buffer allows, suprisingly, the sound to be heard correctly and at full volume from both aplay and xwax:
if (rate->put_idx == 10) rate->put_idx = 6
I suspected that linear_init() is looking in the wrong place to choose the attributes for the rate conversion. After some time spent I cannot see it.
But is there any reason that the output buffer for the rate conversion would not be in S24_3BE? And for the rate conversion to be misinformed?
$ uname -s -r -v -p -i -m Linux 2.6.34.1-mh #83 SMP PREEMPT Wed Jul 21 23:25:33 BST 2010 i686 pentium4 i386
$ alsacap Card 0, ID `Audio8DJ', name `Audio 8 DJ' Device 0, ID `Audio 8 DJ', name `Audio 8 DJ', 4 subdevices (4 available) 2 channels, sampling rate 44100..96000 Hz Sample formats: S24_3BE Subdevice 0, name `subdevice #0' Subdevice 1, name `subdevice #1' Subdevice 2, name `subdevice #2' Subdevice 3, name `subdevice #3'
$ aplay -v -D plughw:Audio8DJ,0,0 halcyon-24000.wav Playing WAVE 'halcyon-24000.wav' : Signed 16 bit Little Endian, Rate 24000 Hz, Stereo Plug PCM: Rate conversion PCM (48000, sformat=S24_3BE) Converter: linear-interpolation Protocol version: 10002 Its setup is: stream : PLAYBACK access : RW_INTERLEAVED format : S16_LE subformat : STD channels : 2 rate : 24000 exact rate : 24000 (24000/1) msbits : 16 buffer_size : 10922 period_size : 2730 period_time : 113770 tstamp_mode : NONE period_step : 1 avail_min : 2730 period_event : 0 start_threshold : 10922 stop_threshold : 10922 silence_threshold: 0 silence_size : 0 boundary : 715784192 Slave: Hardware PCM card 0 'Audio 8 DJ' device 0 subdevice 0 Its setup is: stream : PLAYBACK access : MMAP_INTERLEAVED format : S24_3BE subformat : STD channels : 2 rate : 48000 exact rate : 48000 (48000/1) msbits : 24 buffer_size : 21845 period_size : 5461 period_time : 113770 tstamp_mode : NONE period_step : 1 avail_min : 5461 period_event : 0 start_threshold : 21844 stop_threshold : 21845 silence_threshold: 0 silence_size : 0 boundary : 1431633920 appl_ptr : 0 hw_ptr : 0
Hi, does anybody have any thoughts on my email below? The rate conversion code looks stable and untouched for a while.
Thanks
On Sun, 1 Aug 2010, Mark Hills wrote:
I have a device (snd-usb-caiaq) whose native sample format is S24_3BE. When sample rate conversion is used, the audio becomes near silent, distorted, and only in the left channel.
It is reproducable with aplay (see example below). Recording is not affected. Playback is correct if only format conversion is used.
It looks something is causing the incorrect put function to be used by the rate conversion.
I traced it to linear_expand() and others, alsa-lib-src/pcm_rate_linear.c.
Forcing the function to put S16 format into the destination buffer allows, suprisingly, the sound to be heard correctly and at full volume from both aplay and xwax:
if (rate->put_idx == 10) rate->put_idx = 6
I suspected that linear_init() is looking in the wrong place to choose the attributes for the rate conversion. After some time spent I cannot see it.
But is there any reason that the output buffer for the rate conversion would not be in S24_3BE? And for the rate conversion to be misinformed?
$ uname -s -r -v -p -i -m Linux 2.6.34.1-mh #83 SMP PREEMPT Wed Jul 21 23:25:33 BST 2010 i686 pentium4 i386
$ alsacap Card 0, ID `Audio8DJ', name `Audio 8 DJ' Device 0, ID `Audio 8 DJ', name `Audio 8 DJ', 4 subdevices (4 available) 2 channels, sampling rate 44100..96000 Hz Sample formats: S24_3BE Subdevice 0, name `subdevice #0' Subdevice 1, name `subdevice #1' Subdevice 2, name `subdevice #2' Subdevice 3, name `subdevice #3'
$ aplay -v -D plughw:Audio8DJ,0,0 halcyon-24000.wav Playing WAVE 'halcyon-24000.wav' : Signed 16 bit Little Endian, Rate 24000 Hz, Stereo Plug PCM: Rate conversion PCM (48000, sformat=S24_3BE) Converter: linear-interpolation Protocol version: 10002 Its setup is: stream : PLAYBACK access : RW_INTERLEAVED format : S16_LE subformat : STD channels : 2 rate : 24000 exact rate : 24000 (24000/1) msbits : 16 buffer_size : 10922 period_size : 2730 period_time : 113770 tstamp_mode : NONE period_step : 1 avail_min : 2730 period_event : 0 start_threshold : 10922 stop_threshold : 10922 silence_threshold: 0 silence_size : 0 boundary : 715784192 Slave: Hardware PCM card 0 'Audio 8 DJ' device 0 subdevice 0 Its setup is: stream : PLAYBACK access : MMAP_INTERLEAVED format : S24_3BE subformat : STD channels : 2 rate : 48000 exact rate : 48000 (48000/1) msbits : 24 buffer_size : 21845 period_size : 5461 period_time : 113770 tstamp_mode : NONE period_step : 1 avail_min : 5461 period_event : 0 start_threshold : 21844 stop_threshold : 21845 silence_threshold: 0 silence_size : 0 boundary : 1431633920 appl_ptr : 0 hw_ptr : 0
At Wed, 11 Aug 2010 09:04:32 +0100 (BST), Mark Hills wrote:
Hi, does anybody have any thoughts on my email below? The rate conversion code looks stable and untouched for a while.
I guess it's a missing support of 3-byte formats in 16bit conversion, so not specific to rate plugin.
Adding the support shouldn't be too hard, since it's already found in 32bit conversion.
thanks,
Takashi
Thanks
On Sun, 1 Aug 2010, Mark Hills wrote:
I have a device (snd-usb-caiaq) whose native sample format is S24_3BE. When sample rate conversion is used, the audio becomes near silent, distorted, and only in the left channel.
It is reproducable with aplay (see example below). Recording is not affected. Playback is correct if only format conversion is used.
It looks something is causing the incorrect put function to be used by the rate conversion.
I traced it to linear_expand() and others, alsa-lib-src/pcm_rate_linear.c.
Forcing the function to put S16 format into the destination buffer allows, suprisingly, the sound to be heard correctly and at full volume from both aplay and xwax:
if (rate->put_idx == 10) rate->put_idx = 6
I suspected that linear_init() is looking in the wrong place to choose the attributes for the rate conversion. After some time spent I cannot see it.
But is there any reason that the output buffer for the rate conversion would not be in S24_3BE? And for the rate conversion to be misinformed?
$ uname -s -r -v -p -i -m Linux 2.6.34.1-mh #83 SMP PREEMPT Wed Jul 21 23:25:33 BST 2010 i686 pentium4 i386
$ alsacap Card 0, ID `Audio8DJ', name `Audio 8 DJ' Device 0, ID `Audio 8 DJ', name `Audio 8 DJ', 4 subdevices (4 available) 2 channels, sampling rate 44100..96000 Hz Sample formats: S24_3BE Subdevice 0, name `subdevice #0' Subdevice 1, name `subdevice #1' Subdevice 2, name `subdevice #2' Subdevice 3, name `subdevice #3'
$ aplay -v -D plughw:Audio8DJ,0,0 halcyon-24000.wav Playing WAVE 'halcyon-24000.wav' : Signed 16 bit Little Endian, Rate 24000 Hz, Stereo Plug PCM: Rate conversion PCM (48000, sformat=S24_3BE) Converter: linear-interpolation Protocol version: 10002 Its setup is: stream : PLAYBACK access : RW_INTERLEAVED format : S16_LE subformat : STD channels : 2 rate : 24000 exact rate : 24000 (24000/1) msbits : 16 buffer_size : 10922 period_size : 2730 period_time : 113770 tstamp_mode : NONE period_step : 1 avail_min : 2730 period_event : 0 start_threshold : 10922 stop_threshold : 10922 silence_threshold: 0 silence_size : 0 boundary : 715784192 Slave: Hardware PCM card 0 'Audio 8 DJ' device 0 subdevice 0 Its setup is: stream : PLAYBACK access : MMAP_INTERLEAVED format : S24_3BE subformat : STD channels : 2 rate : 48000 exact rate : 48000 (48000/1) msbits : 24 buffer_size : 21845 period_size : 5461 period_time : 113770 tstamp_mode : NONE period_step : 1 avail_min : 5461 period_event : 0 start_threshold : 21844 stop_threshold : 21845 silence_threshold: 0 silence_size : 0 boundary : 1431633920 appl_ptr : 0 hw_ptr : 0
-- Mark
At Wed, 11 Aug 2010 10:59:59 +0200, I wrote:
At Wed, 11 Aug 2010 09:04:32 +0100 (BST), Mark Hills wrote:
Hi, does anybody have any thoughts on my email below? The rate conversion code looks stable and untouched for a while.
I guess it's a missing support of 3-byte formats in 16bit conversion, so not specific to rate plugin.
Adding the support shouldn't be too hard, since it's already found in 32bit conversion.
A quick (untested) fix is below.
Takashi
--- diff --git a/src/pcm/pcm_linear.c b/src/pcm/pcm_linear.c index 12e2e7f..01b6742 100644 --- a/src/pcm/pcm_linear.c +++ b/src/pcm/pcm_linear.c @@ -114,10 +114,9 @@ int snd_pcm_linear_get32_index(snd_pcm_format_t src_format, snd_pcm_format_t dst
int snd_pcm_linear_put_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format) { - int sign, width, endian; + int sign, width, pwidth, endian; sign = (snd_pcm_format_signed(src_format) != snd_pcm_format_signed(dst_format)); - width = snd_pcm_format_width(dst_format) / 8 - 1; #ifdef SND_LITTLE_ENDIAN endian = snd_pcm_format_big_endian(dst_format); #else @@ -125,7 +124,23 @@ int snd_pcm_linear_put_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_f #endif if (endian < 0) endian = 0; - return width * 4 + endian * 2 + sign; + pwidth = snd_pcm_format_physical_width(dst_format); + width = snd_pcm_format_width(dst_format) / 8 - 1; + if (pwidth == 24) { + switch (width) { + case 24: + width = 0; break; + case 20: + width = 1; break; + case 18: + default: + width = 2; break; + } + return width * 4 + endian * 2 + sign + 16; + } else { + width = width / 8 - 1; + return width * 4 + endian * 2 + sign; + } }
int snd_pcm_linear_put32_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format) diff --git a/src/pcm/plugin_ops.h b/src/pcm/plugin_ops.h index 04220d6..0c63ca6 100644 --- a/src/pcm/plugin_ops.h +++ b/src/pcm/plugin_ops.h @@ -407,7 +407,7 @@ get16_123_B2_18: sample = (_get_triple_s(src) >> 2) ^ 0x8000; goto GET16_END;
#ifdef PUT16_LABELS /* dst_wid dst_endswap sign_toggle */ -static void *const put16_labels[4 * 2 * 2] = { +static void *const put16_labels[4 * 2 * 2 + 4 * 3] = { &&put16_12_1, /* 16h -> 8h */ &&put16_12_9, /* 16h ^> 8h */ &&put16_12_1, /* 16h -> 8s */ @@ -424,6 +424,19 @@ static void *const put16_labels[4 * 2 * 2] = { &&put16_12_9200, /* 16h ^> 32h */ &&put16_12_0021, /* 16h -> 32s */ &&put16_12_0029, /* 16h ^> 32s */ + /* 3bytes format */ + &&put16_12_120, /* 16h -> 24h */ + &&put16_12_920, /* 16h ^> 24h */ + &&put16_12_021, /* 16h -> 24s */ + &&put16_12_029, /* 16h ^> 24h */ + &&put16_12_120_20, /* 16h -> 20h */ + &&put16_12_920_20, /* 16h ^> 20h */ + &&put16_12_021_20, /* 16h -> 20s */ + &&put16_12_029_20, /* 16h ^> 20h */ + &&put16_12_120_18, /* 16h -> 18h */ + &&put16_12_920_18, /* 16h ^> 18h */ + &&put16_12_021_18, /* 16h -> 18s */ + &&put16_12_029_18, /* 16h ^> 18h */ }; #endif
@@ -443,6 +456,18 @@ put16_12_1200: as_u32(dst) = (u_int32_t)sample << 16; goto PUT16_END; put16_12_9200: as_u32(dst) = (u_int32_t)(sample ^ 0x8000) << 16; goto PUT16_END; put16_12_0021: as_u32(dst) = (u_int32_t)bswap_16(sample); goto PUT16_END; put16_12_0029: as_u32(dst) = (u_int32_t)bswap_16(sample) ^ 0x80; goto PUT16_END; +put16_12_120: _put_triple(dst, (u_int32_t)sample << 8); goto PUT16_END; +put16_12_920: _put_triple(dst, (u_int32_t)(sample ^ 0x8000) << 8); goto PUT16_END; +put16_12_021: _put_triple_s(dst, (u_int32_t)sample << 8); goto PUT16_END; +put16_12_029: _put_triple_s(dst, (u_int32_t)(sample ^ 0x8000) << 8); goto PUT16_END; +put16_12_120_20: _put_triple(dst, (u_int32_t)sample << 4); goto PUT16_END; +put16_12_920_20: _put_triple(dst, (u_int32_t)(sample ^ 0x8000) << 4); goto PUT16_END; +put16_12_021_20: _put_triple_s(dst, (u_int32_t)sample << 4); goto PUT16_END; +put16_12_029_20: _put_triple_s(dst, (u_int32_t)(sample ^ 0x8000) << 4); goto PUT16_END; +put16_12_120_18: _put_triple(dst, (u_int32_t)sample << 2); goto PUT16_END; +put16_12_920_18: _put_triple(dst, (u_int32_t)(sample ^ 0x8000) << 2); goto PUT16_END; +put16_12_021_18: _put_triple_s(dst, (u_int32_t)sample << 2); goto PUT16_END; +put16_12_029_18: _put_triple_s(dst, (u_int32_t)(sample ^ 0x8000) << 2); goto PUT16_END; } #endif
On Wed, 11 Aug 2010, Takashi Iwai wrote:
At Wed, 11 Aug 2010 10:59:59 +0200, I wrote:
At Wed, 11 Aug 2010 09:04:32 +0100 (BST), Mark Hills wrote:
Hi, does anybody have any thoughts on my email below? The rate conversion code looks stable and untouched for a while.
I guess it's a missing support of 3-byte formats in 16bit conversion, so not specific to rate plugin.
Indeed, it's an obvious ommision now that you mention it! Thanks for the hint.
Adding the support shouldn't be too hard, since it's already found in 32bit conversion.
A quick (untested) fix is below.
Thanks, I tested your patch.
There's a minor mistake that prevents it working, and a couple of comments don't seem quite right (see below). I'll follow this email with a revised patch.
With my modified patch, I was able to play back reliably in both aplay and xwax on my S24_3BE device with rate conversion.
diff --git a/src/pcm/pcm_linear.c b/src/pcm/pcm_linear.c index 12e2e7f..01b6742 100644 --- a/src/pcm/pcm_linear.c +++ b/src/pcm/pcm_linear.c @@ -114,10 +114,9 @@ int snd_pcm_linear_get32_index(snd_pcm_format_t src_format, snd_pcm_format_t dst
int snd_pcm_linear_put_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format) {
- int sign, width, endian;
- int sign, width, pwidth, endian; sign = (snd_pcm_format_signed(src_format) != snd_pcm_format_signed(dst_format));
- width = snd_pcm_format_width(dst_format) / 8 - 1;
#ifdef SND_LITTLE_ENDIAN endian = snd_pcm_format_big_endian(dst_format); #else @@ -125,7 +124,23 @@ int snd_pcm_linear_put_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_f #endif if (endian < 0) endian = 0;
- return width * 4 + endian * 2 + sign;
- pwidth = snd_pcm_format_physical_width(dst_format);
- width = snd_pcm_format_width(dst_format) / 8 - 1;
I concluded this conversion is mis-placed, as it is done again, below (and affects decision making when pwidth == 24)
- if (pwidth == 24) {
switch (width) {
case 24:
width = 0; break;
case 20:
width = 1; break;
case 18:
default:
width = 2; break;
}
return width * 4 + endian * 2 + sign + 16;
- } else {
width = width / 8 - 1;
I left this conversion in.
return width * 4 + endian * 2 + sign;
- }
}
int snd_pcm_linear_put32_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format) diff --git a/src/pcm/plugin_ops.h b/src/pcm/plugin_ops.h index 04220d6..0c63ca6 100644 --- a/src/pcm/plugin_ops.h +++ b/src/pcm/plugin_ops.h @@ -407,7 +407,7 @@ get16_123_B2_18: sample = (_get_triple_s(src) >> 2) ^ 0x8000; goto GET16_END;
#ifdef PUT16_LABELS /* dst_wid dst_endswap sign_toggle */ -static void *const put16_labels[4 * 2 * 2] = { +static void *const put16_labels[4 * 2 * 2 + 4 * 3] = { &&put16_12_1, /* 16h -> 8h */ &&put16_12_9, /* 16h ^> 8h */ &&put16_12_1, /* 16h -> 8s */ @@ -424,6 +424,19 @@ static void *const put16_labels[4 * 2 * 2] = { &&put16_12_9200, /* 16h ^> 32h */ &&put16_12_0021, /* 16h -> 32s */ &&put16_12_0029, /* 16h ^> 32s */
- /* 3bytes format */
- &&put16_12_120, /* 16h -> 24h */
- &&put16_12_920, /* 16h ^> 24h */
- &&put16_12_021, /* 16h -> 24s */
- &&put16_12_029, /* 16h ^> 24h */
- &&put16_12_120_20, /* 16h -> 20h */
- &&put16_12_920_20, /* 16h ^> 20h */
- &&put16_12_021_20, /* 16h -> 20s */
- &&put16_12_029_20, /* 16h ^> 20h */
- &&put16_12_120_18, /* 16h -> 18h */
- &&put16_12_920_18, /* 16h ^> 18h */
- &&put16_12_021_18, /* 16h -> 18s */
- &&put16_12_029_18, /* 16h ^> 18h */
A couple of the comments here look wrong, as they are repeats. '20h' and '18h' become '20s' and '18s' respectively. I have corrected that in the follow up patch.
}; #endif
[...]
--- src/pcm/pcm_linear.c | 21 ++++++++++++++++++--- src/pcm/plugin_ops.h | 27 ++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 4 deletions(-)
diff --git a/src/pcm/pcm_linear.c b/src/pcm/pcm_linear.c index 12e2e7f..e85dfaa 100644 --- a/src/pcm/pcm_linear.c +++ b/src/pcm/pcm_linear.c @@ -114,10 +114,9 @@ int snd_pcm_linear_get32_index(snd_pcm_format_t src_format, snd_pcm_format_t dst
int snd_pcm_linear_put_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format) { - int sign, width, endian; + int sign, width, pwidth, endian; sign = (snd_pcm_format_signed(src_format) != snd_pcm_format_signed(dst_format)); - width = snd_pcm_format_width(dst_format) / 8 - 1; #ifdef SND_LITTLE_ENDIAN endian = snd_pcm_format_big_endian(dst_format); #else @@ -125,7 +124,23 @@ int snd_pcm_linear_put_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_f #endif if (endian < 0) endian = 0; - return width * 4 + endian * 2 + sign; + pwidth = snd_pcm_format_physical_width(dst_format); + width = snd_pcm_format_width(dst_format); + if (pwidth == 24) { + switch (width) { + case 24: + width = 0; break; + case 20: + width = 1; break; + case 18: + default: + width = 2; break; + } + return width * 4 + endian * 2 + sign + 16; + } else { + width = width / 8 - 1; + return width * 4 + endian * 2 + sign; + } }
int snd_pcm_linear_put32_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format) diff --git a/src/pcm/plugin_ops.h b/src/pcm/plugin_ops.h index 04220d6..21535c9 100644 --- a/src/pcm/plugin_ops.h +++ b/src/pcm/plugin_ops.h @@ -407,7 +407,7 @@ get16_123_B2_18: sample = (_get_triple_s(src) >> 2) ^ 0x8000; goto GET16_END;
#ifdef PUT16_LABELS /* dst_wid dst_endswap sign_toggle */ -static void *const put16_labels[4 * 2 * 2] = { +static void *const put16_labels[4 * 2 * 2 + 4 * 3] = { &&put16_12_1, /* 16h -> 8h */ &&put16_12_9, /* 16h ^> 8h */ &&put16_12_1, /* 16h -> 8s */ @@ -424,6 +424,19 @@ static void *const put16_labels[4 * 2 * 2] = { &&put16_12_9200, /* 16h ^> 32h */ &&put16_12_0021, /* 16h -> 32s */ &&put16_12_0029, /* 16h ^> 32s */ + /* 3bytes format */ + &&put16_12_120, /* 16h -> 24h */ + &&put16_12_920, /* 16h ^> 24h */ + &&put16_12_021, /* 16h -> 24s */ + &&put16_12_029, /* 16h ^> 24s */ + &&put16_12_120_20, /* 16h -> 20h */ + &&put16_12_920_20, /* 16h ^> 20h */ + &&put16_12_021_20, /* 16h -> 20s */ + &&put16_12_029_20, /* 16h ^> 20s */ + &&put16_12_120_18, /* 16h -> 18h */ + &&put16_12_920_18, /* 16h ^> 18h */ + &&put16_12_021_18, /* 16h -> 18s */ + &&put16_12_029_18, /* 16h ^> 18s */ }; #endif
@@ -443,6 +456,18 @@ put16_12_1200: as_u32(dst) = (u_int32_t)sample << 16; goto PUT16_END; put16_12_9200: as_u32(dst) = (u_int32_t)(sample ^ 0x8000) << 16; goto PUT16_END; put16_12_0021: as_u32(dst) = (u_int32_t)bswap_16(sample); goto PUT16_END; put16_12_0029: as_u32(dst) = (u_int32_t)bswap_16(sample) ^ 0x80; goto PUT16_END; +put16_12_120: _put_triple(dst, (u_int32_t)sample << 8); goto PUT16_END; +put16_12_920: _put_triple(dst, (u_int32_t)(sample ^ 0x8000) << 8); goto PUT16_END; +put16_12_021: _put_triple_s(dst, (u_int32_t)sample << 8); goto PUT16_END; +put16_12_029: _put_triple_s(dst, (u_int32_t)(sample ^ 0x8000) << 8); goto PUT16_END; +put16_12_120_20: _put_triple(dst, (u_int32_t)sample << 4); goto PUT16_END; +put16_12_920_20: _put_triple(dst, (u_int32_t)(sample ^ 0x8000) << 4); goto PUT16_END; +put16_12_021_20: _put_triple_s(dst, (u_int32_t)sample << 4); goto PUT16_END; +put16_12_029_20: _put_triple_s(dst, (u_int32_t)(sample ^ 0x8000) << 4); goto PUT16_END; +put16_12_120_18: _put_triple(dst, (u_int32_t)sample << 2); goto PUT16_END; +put16_12_920_18: _put_triple(dst, (u_int32_t)(sample ^ 0x8000) << 2); goto PUT16_END; +put16_12_021_18: _put_triple_s(dst, (u_int32_t)sample << 2); goto PUT16_END; +put16_12_029_18: _put_triple_s(dst, (u_int32_t)(sample ^ 0x8000) << 2); goto PUT16_END; } #endif
At Fri, 13 Aug 2010 13:27:30 +0100 (BST), Mark Hills wrote:
On Wed, 11 Aug 2010, Takashi Iwai wrote:
At Wed, 11 Aug 2010 10:59:59 +0200, I wrote:
At Wed, 11 Aug 2010 09:04:32 +0100 (BST), Mark Hills wrote:
Hi, does anybody have any thoughts on my email below? The rate conversion code looks stable and untouched for a while.
I guess it's a missing support of 3-byte formats in 16bit conversion, so not specific to rate plugin.
Indeed, it's an obvious ommision now that you mention it! Thanks for the hint.
Adding the support shouldn't be too hard, since it's already found in 32bit conversion.
A quick (untested) fix is below.
Thanks, I tested your patch.
There's a minor mistake that prevents it working, and a couple of comments don't seem quite right (see below). I'll follow this email with a revised patch.
With my modified patch, I was able to play back reliably in both aplay and xwax on my S24_3BE device with rate conversion.
OK, thanks. Now applied your fix patch to git tree.
Takashi
participants (2)
-
Mark Hills
-
Takashi Iwai