# Audio transfers and laptop backups

The working path is laptop USB-C audio output to Apple cassette IN. We used it to create and boot the Merlin program disk. The reverse path remains unverified, so no work on the Apple is automatically backed up to this laptop.

## Preserved transfer files

| File | Purpose | Duration |
| --- | --- | --- |
| `audio/merlin-a.wav` | Formats and writes Merlin Pro 2.33 disk A | 155.144 seconds |
| `audio/merlin-b.wav` | Formats and writes optional companion disk B | 218.910 seconds |
| `audio/cassette-input-test.wav` | Alternating silence and test tone | 12 seconds |

Both disk WAV files are 48 kHz. Each original disk image is exactly 143,360 bytes. Do not convert these WAV files to MP3 or another lossy format.

## Reproduce the conversion

Source files were fetched from the `master` branch of [datajerk/c2t](https://github.com/datajerk/c2t) during the session. The exact commit was not recorded; the copied files and their checksums preserve the source actually used. The source subset includes the upstream generated `c2t.h`, so rebuilding this converter does not require regenerating the Apple loader with cc65.

From this project directory, compile the preserved source:

```sh
cd tools/c2t-src
cc -I. -O2 -w -o ../c2t-96h c2t-96h.c -lm
cd ../..
```

The first compile attempt omitted `-I.` and failed to locate `fake6502.h`. Adding the local include directory fixed it.

Generate the transfer audio:

```sh
./tools/c2t-96h disks/Merlin-proProdos2.33-a.dsk audio/merlin-a.wav
./tools/c2t-96h disks/Merlin-proProdos2.33-b.dsk audio/merlin-b.wav
```

These commands overwrite the corresponding local WAV files. They do not communicate with the Apple until the resulting audio is played.

## Write a floppy through audio

The generated loader formats and overwrites **slot 6, drive 1**. Use a floppy whose contents can be erased. Save any unsaved work before restarting the Apple.

1. Remove floppies from both drives and restart the Apple.
2. Identify the boot drive by its activity light; the transfer assumes the standard slot 6 configuration used successfully here.
3. Press Control–Reset to reach the Applesoft `]` prompt.
4. Insert the target floppy into drive 1 and close the latch. Leave drive 2 empty.
5. Keep the USB-C adapter connected to cassette IN.
6. Type `LOAD` and press Return. The Apple waits for audio.
7. Play the correct WAV from its beginning through the USB-C device.
8. Wait for completion and for disk activity to stop. Follow the loader's reboot instruction.

The observed sequence for disk A was loading INSTA-DISK, formatting, loading data, and then a successful Merlin boot. Loading and writing alternate; an ETA can apply to only the current segment. Do not restart, eject, or stop playback merely because a segment countdown finishes.

On this laptop, the verified sink name was:

```text
alsa_output.usb-Google_USB-C_to_3.5mm-Headphone_Adapter_FLK71002052020A79V03BCE-00.analog-stereo
```

Check it with `pactl list sinks short` after reconnecting hardware. When the Apple is waiting at `LOAD`, this command selects that output explicitly:

```sh
paplay \
  --device=alsa_output.usb-Google_USB-C_to_3.5mm-Headphone_Adapter_FLK71002052020A79V03BCE-00.analog-stereo \
  --volume=65536 \
  audio/merlin-a.wav
```

The successful transfer used 100% USB sink volume as well as full application volume, with the competing Firefox stream muted. The command above controls only the application's volume; it does not change the sink volume or silence other applications. Keep notifications, music, and browser audio out of the transfer output. Record and restore any audio settings changed for a transfer, as we did in the session.

Do not play disk B into the Merlin floppy unless intentionally replacing it. Disk B is optional and should use another floppy.

If a later transfer fails, confirm the destination, cable, volume, and lack of competing audio before changing methods. The upstream tools also offer a slower 8000 bps option using `c2t -8`; it was not needed or tested here. [c2t instructions](https://github.com/datajerk/c2t#quick-start)

## Save work to the laptop

The proposed workflow uses **ADTPro** to transfer disk images:

```text
Merlin source and object files
             |
             v
       Apple work floppy
             |
        ADTPro audio
             |
             v
  Laptop backup image in backups/
```

Save your source in Merlin before switching to ADTPro. ADTPro copies disk contents, not unsaved editor memory. A timestamped backup filename such as `work-2026-09-30.dsk` can preserve a snapshot. To restore, send that image to a spare floppy and load the source in Merlin. Keep multiple snapshots rather than continually replacing the only backup.

The cabling required is:

```text
Laptop USB-C headphone OUT  -> Apple cassette IN   verified
Laptop external audio IN   <- Apple cassette OUT  unverified
```

The Google USB adapter exposes no capture endpoint. The laptop's built-in audio provides a headset-microphone choice, but its selected input remained the internal microphone. The plug type and any headset splitter are still unknown. A normal TRS stereo lead plugged into a combined TRRS headset socket may not reach the microphone contact.

Before recording a backup, establish the correct physical input, select that input, and verify reception. ADTPro's audio client emits test packets while its **? About** screen is open. Its host should report an increasing count of received audio signals. This is the planned return-path test; it has not been run. [ADTPro audio connection and testing instructions](https://raw.githubusercontent.com/ADTPro/adtpro/main/doc/src/site/apt/connectionsaudio.apt)

Merlin's ordinary Save Source command does not save to cassette. Recording arbitrary sound on the laptop does not create a usable Merlin backup by itself. The whole-disk ADTPro workflow avoids having to manually export Merlin's banked editor memory.

## Other options discussed

[Apple II Disk Server](https://asciiexpress.net/diskserver/) provides ready-made browser audio for other Merlin versions, including ProDOS 2.55. We did not use it because the requested archive's 2.33 images were converted directly. The DOS 3.3 Merlin Pro 2.23 image in the archive was also not used or copied into this project.
