Skip to main content

Sonify and visualize Linux kernel interrupts by reading /proc/interrupts

Project description

pysoundofinterrupts

PyPI version License: MIT

Sonify and visualize Linux kernel interrupts by reading /proc/interrupts: listen to the system like a stethoscope or plot its activity in real time.

Based on an idea by Nicolás Wolovick: each interrupt drives the speaker in 1-bit PCM fashion (ZX-Spectrum style). If there are about 100 interrupts per second, you hear something like a 100 Hz tone.

Linux only — the program reads /proc/interrupts. On other systems it exits with a clear message.

Links: PyPI · Repository


Installation

With pipx (recommended)

Install and run in an isolated environment without touching your global Python:

pipx install pysoundofinterrupts

This makes the interrupts-sound (audio) and interrupts-plot (graph) commands available.

To install from source (e.g. for development):

pipx install .

With pip

pip install pysoundofinterrupts

Requirements: Python 3.8+, Linux.


Usage

Command Description
interrupts-sound Listen to kernel interrupts in real time (audio).
interrupts-plot Real-time plot by type (LOC, RES, CAL, TLB).

Real-time sound

interrupts-sound

Press Enter to exit. To calibrate the level:

Option Environment variable Description
--subtractor INTERRUPTS_SUBTRACTOR Subtract a floor from rate (default 1000)
--divider INTERRUPTS_DIVIDER Divide the rate (default 25)
--amplitude INTERRUPTS_AMPLITUDE Volume 0–1 (default 0.2)

Example:

interrupts-sound --subtractor 800 --divider 20

Real-time plot

interrupts-plot

Shows interrupts by type (LOC, RES, CAL, TLB). Options:

Option Environment variable Description
--x-max INTERRUPTS_PLOT_X_MAX Points on X axis (default 100)
--y-max INTERRUPTS_PLOT_Y_MAX Y axis upper limit (default 5000)
--interval INTERRUPTS_PLOT_INTERVAL Update interval in ms (default 50)

Development and tests

Clone the repo, create an environment, and install in editable mode with test extras:

git clone https://github.com/pablogventura/pysoundofinterrupts.git
cd pysoundofinterrupts
python3 -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -e ".[test]"
pytest tests/ -v

Publishing to PyPI

From the project directory, with build and twine installed:

pip install build twine
./scripts/publish_to_pypi.sh

The first time, configure your PyPI credentials (token in ~/.pypirc or TWINE_USERNAME and TWINE_PASSWORD). See Twine: Configuration.


Troubleshooting

  • No audio: Check your default output device. The program uses the system default or the first available output device.
  • Linux only: On Windows or macOS the program exits stating it requires Linux.
  • Permissions: Reading /proc/interrupts usually does not require root. If it fails, check that the file exists: ls /proc/interrupts.

License

MIT. See LICENSE in the repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysoundofinterrupts-0.1.1.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysoundofinterrupts-0.1.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file pysoundofinterrupts-0.1.1.tar.gz.

File metadata

  • Download URL: pysoundofinterrupts-0.1.1.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pysoundofinterrupts-0.1.1.tar.gz
Algorithm Hash digest
SHA256 efe50f01331eae66b9fbc11fa4bd3b334382ce3781f8b31975a5b058e982c1fa
MD5 c6af1a086fb138344dcd9a771b4e8638
BLAKE2b-256 573858263b7433a4d03775846a39a4db2786797b098ea80fc6b4702db4f752c1

See more details on using hashes here.

File details

Details for the file pysoundofinterrupts-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pysoundofinterrupts-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 817989093a3072dd179d11785e846226e1d93a6d56a6ab51db6024f4cbab1dd2
MD5 1f4a8dea0cb4dc1107fa8bbe2c507d6b
BLAKE2b-256 84214b4445c88de20fb5a1fc063f0bc10bfb3b7c20b20b9ad97eef1c6255ccea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page