From: Adrian M. <ad...@mc...> - 2002-01-15 21:50:23
|
This patch: * removes some dead bits of code * makes a few changes to speed up code execution at the margins * improves responsiveness and decreases load on processor in low demand situations I know mrbrown has in mind posting more patches when he returns from hibernation. 35c35 < #include "../sound_config.h" --- > #include "sound_config.h" 179a180 > spu_write_wait(); 222,225c223,224 < // Wait one second < int j = jiffies + HZ; < while (jiffies < j) < schedule(); --- > // Wait a little > schedule(); 273,290d271 < static int aica_lock_channel(int channel) < { < //channels exist in blocks of 32 32-bit registers < //beginning at 0xa0700000 for the SH4 < //...but there are only 64 of them! < if ((channel > 63) || (channel < 0)) { < DEBGM < ("Attempted to open a sound channel which does not exist\n"); < return -EINVAL; < } < return 0; < } < < static int aica_unlock_channel(int channel) < { < < return 0; < } 329a311,313 > //Lock channels 1 & 2 > request_mem_region(0xa0700000, 0x100, "AICA Channels"); > 331,336d314 < int err = aica_lock_channel(devc->channel); < if (err != 0) { < MOD_DEC_USE_COUNT; < up(&dsp_mutex); < return err; //failed < } 346,348d323 < } else if ((minor & 0xF) == SND_DEV_AUDIO) { < chanh->sfmt = SM_8BIT; < devc->sformat = AFMT_MU_LAW; 356c331 < aica_unlock_channel(devc->channel); --- > release_mem_region(0xa0700000, 0x100); 437,438c412 < if (devc) < aica_unlock_channel(devc->channel); --- > release_mem_region(0xa0700000, 0x100); 457c431 < int z; --- > int z, y, x, w; 461,462c435,437 < BUFFER3[z] = BUFFER[z * 2]; < BUFFER2[z] = BUFFER[z * 2 + 1]; --- > x = z * 2; > BUFFER3[z] = BUFFER[x]; > BUFFER2[z] = BUFFER[x + 1]; 465,470c440,447 < < for (z = 0; z < *count_out / samplelength; z++) { < BUFFER3[z * 2] = BUFFER[z * 4]; < BUFFER3[z * 2 + 1] = BUFFER[z * 4 + 1]; < BUFFER2[z * 2] = BUFFER[z * 4 + 2]; < BUFFER2[z * 2 + 1] = BUFFER[z * 4 + 3]; --- > y = *count_out / samplelength; > for (z = 0; z < y; z++) { > x = z * 2; > w = z * 4; > BUFFER3[x] = BUFFER[w]; > BUFFER3[x + 1] = BUFFER[w + 1]; > BUFFER2[x] = BUFFER[w + 2]; > BUFFER2[x + 1] = BUFFER[w + 3]; 489c466 < if (chanh->freq < 15000) --- > if (chanh->freq < 23000) 491c468 < 5); --- > 1); 506a484,488 > if (chanh->freq < 23000) > interruptible_sleep_on_timeout(& > (devc-> > open_wait), > 1); 536,540c518,519 < switch (devc->sformat) { < case AFMT_U8: < convert_u8tos8(BUFFER, count); < break; < } --- > else if (devc->sformat == AFMT_U8) convert_u8tos8(BUFFER, count); > 545c524,525 < } --- > BUFFERR = BUFFER2; > } 550,551d529 < if (stereo) < BUFFERR = BUFFER2; 826c804 < ("AICA audio device driver for Dreamcast Linux - ver 0.1-pre10\n"); --- > ("AICA audio device driver for Dreamcast Linux - ver 0.1-pre12\n"); |