minor changes, improve clock detection

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3195 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
beveloper
2003-05-11 01:12:00 +00:00
parent 07ce4687df
commit 9b91bd404b
3 changed files with 30 additions and 10 deletions
@@ -351,6 +351,9 @@ static status_t get_buffers(multi_buffer_list *data)
static status_t buffer_exchange(multi_buffer_info *data)
{
#if DEBUG
static int debug_buffers_exchanged = 0;
#endif
cpu_status status;
void *backbuffer;
/*
@@ -395,6 +398,12 @@ static status_t buffer_exchange(multi_buffer_info *data)
data->recorded_frames_count = 0;
}
*/
#if DEBUG
debug_buffers_exchanged++;
if (((debug_buffers_exchanged % 100) == 1) && (debug_buffers_exchanged < 1111)) {
LOG(("buffer_exchange: %d buffers processed\n", debug_buffers_exchanged));
}
#endif
return B_OK;
@@ -428,18 +428,20 @@ ich_clock_calibrate()
LOG(("ich_clock_calibrate: finished, rate %ld\n", rate));
if (rate > (44100 - 300) && rate < (44100 + 300)) {
ac97_set_clock(config->ac97, 44100);
if (rate > (44100 - 1000) && rate < (44100 + 1000)) {
LOG(("ich_clock_calibrate: setting clock 44100\n"));
} else if (rate > (48000 - 300) && rate < (48000 + 300)) {
ac97_set_clock(config->ac97, 48000);
ac97_set_clock(config->ac97, 44100);
} else if (rate > (48000 - 1000) && rate < (48000 + 1000)) {
LOG(("ich_clock_calibrate: setting clock 48000\n"));
} else if (rate > (41194 - 300) && rate < (41194 + 300)) {
ac97_set_clock(config->ac97, 41194);
ac97_set_clock(config->ac97, 48000);
} else if (rate > (41194 - 1000) && rate < (41194 + 1000)) {
LOG(("ich_clock_calibrate: setting clock 41194\n"));
} else if (rate > (55930 - 300) && rate < (55930 + 300)) {
ac97_set_clock(config->ac97, 55930);
ac97_set_clock(config->ac97, 41194);
} else if (rate > (55930 - 1000) && rate < (55930 + 1000)) {
LOG(("ich_clock_calibrate: setting clock 55930\n"));
ac97_set_clock(config->ac97, 55930);
} else {
LOG(("ich_clock_calibrate: NOT setting clock\n"));
}
if ( !ac97_set_rate(config->ac97, AC97_PCM_FRONT_DAC_RATE, 44100)
@@ -28,12 +28,21 @@
#ifndef _ICH_H_
#define _ICH_H_
#include "debug.h"
#include "hardware.h"
#define VERSION "Version 1.5, Copyright (c) 2002 Marcus Overhagen, compiled on " ## __DATE__ ## " " ## __TIME__
#define VERSION_NUMBER "1.6"
#if DEBUG
#define VERSION_DEBUG " (DEBUG)"
#else
#define VERSION_DEBUG ""
#endif
#define VERSION "Version " VERSION_NUMBER VERSION_DEBUG ", Copyright (c) 2002, 2003 Marcus Overhagen, compiled on " ## __DATE__ ## " " ## __TIME__
#define DRIVER_NAME "ich_ac97"
#define BUFFER_SIZE 4096
#define BUFFER_SIZE 2048
#define BUFFER_COUNT 2
#define BUFFER_FRAMES_COUNT (BUFFER_SIZE / 4)