Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.msdos.programmer > #4176

Re: is there a high-frequency timer available on the PC? (besides the PIT)

From Johann Klammer <klammerj@NOSPAM.a1.net>
Newsgroups comp.os.msdos.programmer
Subject Re: is there a high-frequency timer available on the PC? (besides the PIT)
Date 2022-08-17 19:02 +0200
Organization Aioe.org NNTP Server
Message-ID <tdj6v2$1h8$1@gioia.aioe.org> (permalink)
References <tdieam$4gt$1@gioia.aioe.org>

Show all headers | View raw


On 08/17/2022 12:01 PM, Mateusz Viste wrote:
> Hi,
> 
> I am playing a little with feeding the DAC of my SoundBlaster card with
> raw samples that I am trying to time accurately.
> 
> The "obvious" way to do such thing is to use DMA transfers and
> let the SoundBlaster chip control the sampling. That's not what I am
> doing for the moment. I use the SoundBlaster DAC directly and write 8
> bit samples to it in real time. Yes, it is not CPU-efficient, does not
> allow to play things in background, etc. but please indulge me and
> consider this a thought exercise.
> 
> So here's the question: Is there any kind of timer available on the PC
> that would allow to generate some 8 kHz samples? I mean, besides the
> obvious PIT of course. Some hidden VGA register maybe? A way to abuse a
> timer in the SoundBlaster or Adlib hardware? Some creative
> polling of a port or keyboard controller?
> 
> So far, the timers I know about are those:
>  - VGA VSYNC (tied to screen's refresh rate, ie. 50-60 Hz or so)
>  - calibrated busy loop (meh)
>  - PIT (18.2 Hz default, changing it doesn't work under Windows)
>  - BIOS "system clock" (sourced by the PIT, really)
>  - TSC (requires a Pentium+ CPU)
>  - APIC (modern CPUs only)
>  - CMOS RTC clock (ports 0x70 & 0x71, fixed at 1024 Hz)*
> 
> Anything else?
> 
> Mateusz
> 
> *a pretty nice article about abusing the RTC clock here:
> https://web.archive.org/web/20150514074601/http://www.nondot.org/sabre/os/files/MiscHW/CMOSTimer.html
> 
some have what they call a HPET, but Idunno if it's available on your specific box. or 
in portspace.
https://en.wikipedia.org/wiki/High_Precision_Event_Timer

Back to comp.os.msdos.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

is there a high-frequency timer available on the PC? (besides the PIT) Mateusz Viste <mateusz@xyz.invalid> - 2022-08-17 12:01 +0200
  Re: is there a high-frequency timer available on the PC? (besides the PIT) Johann Klammer <klammerj@NOSPAM.a1.net> - 2022-08-17 19:02 +0200
  Re: is there a high-frequency timer available on the PC? (besides the PIT) rridge@csclub.uwaterloo.ca (Ross Ridge) - 2022-08-19 15:25 +0000
    Re: is there a high-frequency timer available on the PC? (besides the PIT) rridge@csclub.uwaterloo.ca (Ross Ridge) - 2022-08-19 19:44 +0000
      Re: is there a high-frequency timer available on the PC? (besides the PIT) Mateusz Viste <mateusz@xyz.invalid> - 2022-08-19 22:16 +0200
        Re: is there a high-frequency timer available on the PC? (besides the PIT) "Alexei A. Frounze" <alexfrunews@gmail.com> - 2022-08-19 21:20 -0700

csiph-web