| 1 |
# PC Speaker |
| 2 |
|
| 3 |
40 years of one square beep - and still going! single channel, no volume control... |
| 4 |
|
| 5 |
## real output |
| 6 |
|
| 7 |
so far this is the only chip in Furnace which has a real hardware output option. |
| 8 |
to enable it, select file > configure chip... > PC Speaker > Use system beeper. |
| 9 |
|
| 10 |
be noted that this will only work on Linux as Windows does not provide any user-space APIs to address the PC speaker directly! |
| 11 |
|
| 12 |
you may configure the output method by going in Settings > Emulation > PC Speaker strategy: |
| 13 |
|
| 14 |
- `evdev SND_TONE`: uses input events to control the beeper. |
| 15 |
- requires write permission to `/dev/input/by-path/platform-pcspkr-event-spkr`. |
| 16 |
- is not 100% frequency-accurate as `SND_TONE` demands frequencies, but Furnace uses raw timer periods... |
| 17 |
- `KIOCSOUND on /dev/tty1`: sends the `KIOCSOUND` ioctl to control the beeper. |
| 18 |
- may require running Furnace as root. |
| 19 |
- `/dev/port`: writes to `/dev/port` to control the beeper. |
| 20 |
- requires read/write permission to `/dev/port`. |
| 21 |
- `KIOCSOUND on standard output`: sends the `KIOCSOUND` ioctl to control the beeper. |
| 22 |
- requires running Furnace on a TTY. |
| 23 |
- `outb()`: uses the low-level kernel port API to control the beeper. |
| 24 |
- requires running Furnace as root, or granting it `CAP_SYS_RAWIO` to the Furnace executable: `sudo setcap cap_sys_rawio=ep ./furnace`. |
| 25 |
|
| 26 |
real hardware output only works on BIOS/UEFI (non-Mac) x86-based machines! attempting to do this under any other device **will not work**, or may even brick the device (if using `/dev/port` or `outb()`)! |
| 27 |
oh, and of course you also need the beeper to be present in your machine. some laptops connect the beeper output to the built-in speakers (or the audio output jack), and some other don't do this at all. |
| 28 |
|
| 29 |
## effects |
| 30 |
|
| 31 |
ha! effects... |
| 32 |
|
| 33 |
## info |
| 34 |
|
| 35 |
this chip uses the [Beeper](../4-instrument/beeper.md) instrument editor. |
| 36 |
|
| 37 |
## ROM export |
| 38 |
|
| 39 |
two ROM export options exist: |
| 40 |
|
| 41 |
- **iPod .tone alarm**: with the iPod _in disk mode,_ drag the export file into the `iPod_Control/Tones` folder. |
| 42 |
- **GRUB_INIT_TUNE**: use with the GRUB bootloader. |
| 43 |
- into the file `/etc/default/grub` add the following line with the text output copied and pasted where `text` is:\ |
| 44 |
`GRUB_INIT_TUNE="text"`\ |
| 45 |
then regenerate GRUB config. |
| 46 |
- **export binary file**: creates a binary file instead of text. in either the GRUB shell or the GRUB config file, use the `play` command followed by the exported file's name. |
| 47 |
|
| 48 |
## chip config |
| 49 |
|
| 50 |
the following options are available in the Chip Manager window: |
| 51 |
|
| 52 |
- **Clock rate**: sets the rate at which the chip will run. |
| 53 |
- **Speaker type**: select which speaker to use: |
| 54 |
- **Unfiltered**: raw square wave. |
| 55 |
- **Cone**: filter it to simulate the sound of a cone speaker. |
| 56 |
- **Piezo**: simulate the tiny speaker present in most PCs from the 2000s. |
| 57 |
- **Use system beeper**: use the actual PC speaker in your machine for output. only works on Linux! |
| 58 |
- **Reset phase on frequency change**: reset phase every time the frequency changes. many modern motherboards tend to do this. |