Commit 8b0d84b3 authored by sletz's avatar sletz
Browse files

Josh Green ALSA driver capture only patch.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3848 0c269be4-1314-0410-8aa9-9f06e86f4224
parent d5afe86e
......@@ -20,12 +20,17 @@ Michael Voigt
Torben Hohn
Paul Davis
Peter L Jones
Devin Anderson
Devin Anderson
Josh Green
---------------------------
Jackdmp changes log
---------------------------
2009-12-08 Stephane Letz <letz@grame.fr>
* Josh Green ALSA driver capture only patch.
2009-12-03 Stephane Letz <letz@grame.fr>
* Fix JackCoreMidiDriver::ReadProcAux when ring buffer is full (thanks Devin Anderson).
......
......@@ -263,102 +263,106 @@ JackAlsaDriver::alsa_driver_hw_specific (alsa_driver_t *driver, int hw_monitorin
void
JackAlsaDriver::alsa_driver_setup_io_function_pointers (alsa_driver_t *driver)
{
if (SND_PCM_FORMAT_FLOAT_LE == driver->playback_sample_format) {
if (driver->playback_interleaved) {
driver->channel_copy = memcpy_interleave_d32_s32;
} else {
driver->channel_copy = memcpy_fake;
}
driver->read_via_copy = sample_move_floatLE_sSs;
driver->write_via_copy = sample_move_dS_floatLE;
} else {
switch (driver->playback_sample_bytes) {
case 2:
if (driver->playback_handle) {
if (SND_PCM_FORMAT_FLOAT_LE == driver->playback_sample_format) {
if (driver->playback_interleaved) {
driver->channel_copy = memcpy_interleave_d16_s16;
driver->channel_copy = memcpy_interleave_d32_s32;
} else {
driver->channel_copy = memcpy_fake;
}
driver->read_via_copy = sample_move_floatLE_sSs;
driver->write_via_copy = sample_move_dS_floatLE;
} else {
switch (driver->playback_sample_bytes) {
case 2:
if (driver->playback_interleaved) {
driver->channel_copy = memcpy_interleave_d16_s16;
} else {
driver->channel_copy = memcpy_fake;
}
switch (driver->dither) {
case Rectangular:
jack_info("Rectangular dithering at 16 bits");
driver->write_via_copy = driver->quirk_bswap?
sample_move_dither_rect_d16_sSs:
sample_move_dither_rect_d16_sS;
break;
switch (driver->dither) {
case Rectangular:
jack_info("Rectangular dithering at 16 bits");
driver->write_via_copy = driver->quirk_bswap?
sample_move_dither_rect_d16_sSs:
sample_move_dither_rect_d16_sS;
break;
case Triangular:
jack_info("Triangular dithering at 16 bits");
driver->write_via_copy = driver->quirk_bswap?
sample_move_dither_tri_d16_sSs:
sample_move_dither_tri_d16_sS;
break;
case Triangular:
jack_info("Triangular dithering at 16 bits");
driver->write_via_copy = driver->quirk_bswap?
sample_move_dither_tri_d16_sSs:
sample_move_dither_tri_d16_sS;
break;
case Shaped:
jack_info("Noise-shaped dithering at 16 bits");
driver->write_via_copy = driver->quirk_bswap?
sample_move_dither_shaped_d16_sSs:
sample_move_dither_shaped_d16_sS;
break;
case Shaped:
jack_info("Noise-shaped dithering at 16 bits");
driver->write_via_copy = driver->quirk_bswap?
sample_move_dither_shaped_d16_sSs:
sample_move_dither_shaped_d16_sS;
break;
default:
driver->write_via_copy = driver->quirk_bswap?
sample_move_d16_sSs :
sample_move_d16_sS;
default:
driver->write_via_copy = driver->quirk_bswap?
sample_move_d16_sSs :
sample_move_d16_sS;
break;
}
break;
}
break;
case 3: /* NO DITHER */
if (driver->playback_interleaved) {
driver->channel_copy = memcpy_interleave_d24_s24;
} else {
driver->channel_copy = memcpy_fake;
}
case 3: /* NO DITHER */
if (driver->playback_interleaved) {
driver->channel_copy = memcpy_interleave_d24_s24;
} else {
driver->channel_copy = memcpy_fake;
}
driver->write_via_copy = driver->quirk_bswap?
sample_move_d24_sSs:
sample_move_d24_sS;
driver->write_via_copy = driver->quirk_bswap?
sample_move_d24_sSs:
sample_move_d24_sS;
break;
break;
case 4: /* NO DITHER */
if (driver->playback_interleaved) {
driver->channel_copy = memcpy_interleave_d32_s32;
} else {
driver->channel_copy = memcpy_fake;
}
case 4: /* NO DITHER */
if (driver->playback_interleaved) {
driver->channel_copy = memcpy_interleave_d32_s32;
} else {
driver->channel_copy = memcpy_fake;
}
driver->write_via_copy = driver->quirk_bswap?
sample_move_d32u24_sSs:
sample_move_d32u24_sS;
break;
driver->write_via_copy = driver->quirk_bswap?
sample_move_d32u24_sSs:
sample_move_d32u24_sS;
break;
default:
jack_error ("impossible sample width (%d) discovered!",
driver->playback_sample_bytes);
exit (1);
default:
jack_error ("impossible sample width (%d) discovered!",
driver->playback_sample_bytes);
exit (1);
}
}
}
switch (driver->capture_sample_bytes) {
case 2:
driver->read_via_copy = driver->quirk_bswap?
sample_move_dS_s16s:
sample_move_dS_s16;
break;
case 3:
driver->read_via_copy = driver->quirk_bswap?
sample_move_dS_s24s:
sample_move_dS_s24;
break;
case 4:
driver->read_via_copy = driver->quirk_bswap?
sample_move_dS_s32u24s:
sample_move_dS_s32u24;
break;
if (driver->capture_handle) {
switch (driver->capture_sample_bytes) {
case 2:
driver->read_via_copy = driver->quirk_bswap?
sample_move_dS_s16s:
sample_move_dS_s16;
break;
case 3:
driver->read_via_copy = driver->quirk_bswap?
sample_move_dS_s24s:
sample_move_dS_s24;
break;
case 4:
driver->read_via_copy = driver->quirk_bswap?
sample_move_dS_s32u24s:
sample_move_dS_s32u24;
break;
}
}
}
......
Supports Markdown
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