README
¶
Subpod - Sync your iPod to Subsonic, Jellyfin and Miniflux

Subpod is a fully stateless daemon that syncs classic iPods to self-hosted media and content servers.
It keeps an eye on your system's mount directory and when it detects an iPod, it syncs it to your media servers.
Since it is fully stateless you can run Subpod on any number of hosts, and as long as the host configuration is the same, you can sync your iPod to the same libraries. For example, you could run Subpod on your laptop as a systemd service and on your home server as a Docker container with the same configs, and your iPod will sync exactly the same when plugged into either of them.
Although fully functional and something I daily drive, there are still a lot of rough edges, so expect some hiccups. Feel free to report bugs to the issues section.
Features. [x] = working / [ ] = planned
- Syncing music from Subsonic (e.g. Navidrome)
- Starred tracks/albums/artists
- Specified playlists in config file
- Playlists with special comment to iPods
- Scrobbling tracks back to Subsonic
- Transcoding (incl. FLAC to ALAC)
- Sorting albums by recently added
- ReplayGain
- Gapless Playback
- Syncing podcasts/video podcasts from Miniflux
- Entire categories from config file
- Filtering to starred entries only
- Filtering to non-read entries
- Marking as "read" when listened to on iPod
- Transcoding videos for video capable iPods
- Transcoding audio
- Sync media from Jellyfin
- Films
- Shows
- Music
- Music Videos
- Playlists
- Sync favourites
- Sync playlists
- Sync only unwatched
- Marking as watched on Jellyfin
- Sync photos from Immich
- Device management
- Orphaned files cleanup
- Database cleanup
- Allow/disallow iTunes content
- Storage management (delete old stuff, etc.)
- CLI tool
- Sync iPod to directory containing properly tagged music
- List tracks currently stored in iPod
- Restore iPods
Quickstart with Docker
1. Restore your iPod (optional)
Your iPod needs to be on Apple's original firmware. Either restore it using iTunes or follow this guide (and probably this guide too) if you don't have access to iTunes.
2. Initialise your iPod for usage with Subpod
libgpod (and by extension Subpod) need some extra data to work well. The subpod command has a tool to do this initialisation step.
You can do it either with Docker or directly on your machine. This needs certain privileges, so you'll probably need to run it as root if you're not using Docker. You only need to do this once.
Connect your iPod and mount it. Take note of the mountpoint, the block device
and the last three digits of the serial number for your iPod. In the following
examples, I use /dev/sda as the block device, /run/media/user/IPOD as the
mountpoint and V9M for the serial number.
Make sure to choose the right mountpoint and block devices. This should not destroy a drive if the wrong values are passed, but please refer to the disclaimer in the license file.
Docker (recommended)
docker run -it --rm \
--cap-add SYS_ADMIN \
--device /dev/sda:/dev/ipod:rw \
-v /run/media/user/IPOD:/mnt/ipod:rw \
--entrypoint subpod \
rfranco0/subpod:latest \
init \
-device /dev/ipod \
-mountpoint /mnt/ipod \
-serial V9M
Locally
You'll need to run the following command. Probably as root.
go run ./cmd/subpod/main.go \
init \
-device /dev/sda \
-mountpoint /run/media/user/IPOD \
-serial V9M
This will create a few files in your iPod. One of them is subpod.yaml in the
root of your iPod. This is the configuration file for the device that you just
initialised. Make sure to take a look and customise it how you like. See the
example device config for some information on what
you can change in this file. Subpod is fully stateless, including its
configuration file, which means that per-device configuration is stored on the
device.
3. Enable automount for your iPod
Note: If you're using a desktop environment automounting might already be enabled. If you're doing this on a headless machine like a server, you'll need to set up automounting.
Use udisks and udiskie to set up automounting for your iPod.
Quick howto for Arch:
First install udisks2 and udiskie.
sudo pacman -Sy udisks2 udiskie
Create a new user service to start udiskie on login. Create the following file ~/.config/systemd/user/udiskie.service.
[Unit]
Description=Udiskie
[Service]
Type=simple
ExecStart=/usr/bin/udiskie
Restart=always
[Install]
WantedBy=default.target
And enable it:
systemctl --user enable --now udiskie
Be sure to check out man udiskie to see the options for the daemon. Now
whenever you plug in your iPod it should automount under
/run/{username}/{ipod_name}.
4. Run Subpod in Docker
Here's an example docker-compose service definition for Subpod.
services:
subpod:
image: rfranco0/subpod:latest
container_name: subpod
restart: unless-stopped
user: 1000:1000
volumes:
- /run/media/{username}/:/mnt
- ./config.yaml:/etc/subpod.yaml
devices:
- /dev/dri/card1
- /dev/dri/renderD128:/dev/dri/renderD128
Replace the username with your username and 1000:1000 with your user and group
IDs (check with id -a, it's uid and gid). Subpod will refuse to run as
root. The devices section is to give ffmpeg HW acceleration to encode videos.
Copy the example config file to ./config.yaml, and
modify it to suit your needs. Here's an example minimal config file.
log_level: info
root: /run/media/username/
sources:
check_interval_seconds: 30
subsonic:
enabled: true
server: https://navidrome.server
username: username
password: correct horse battery staple
client_name: Subpod
scrobble: true
miniflux:
enabled: true
server: https://miniflux.server
api_key: abcdefg
mark_as_read: true
jellyfin:
enabled: true
server: https://jellyfin.server
api_key: abcdefg
username: Somebody
5. Add media to your iPod
Subsonic
With the above configuration if you star a track, album or artist it will get copied to the iPod.
Additionally, playlists can be added directly from Subsonic without touching the config file. If you add a line to the playlist description with the following format:
subpod: ["iPod Video", "iPod Photo 32GB"]
The playlist will be added to devices "iPod Video" and "iPod Photo". These are the names in the device's config file.
You can also add the following line to the description:
subpod: *
And it will add the playlist to all iPods.
Miniflux
With the above configuration, Subpod will copy entries that are starred and under the "Podcasts" category.
If the podcast is just an audio file it will copy it to the podcasts section in your iPod. If it's a video podcast, it will transcode the video for your iPod.
Configuration file reference
Most of the configuration file is documented in the example config, but there are some things I'd like to clarify here.
Transcoding FLAC files from Subsonic
The iPod does not natively support FLAC files. In order to add them they need to be transcoded. There are two options:
- Lossy transcoding
- Lossless transcoding
When the configuration is set to flac: alac, the transcoding will be done by
Subpod using ffmpeg. Subpod will stream the file with the raw profile and
transcode it to ALAC, downsampling to 16bit if needed as the DAC in the iPod
doesn't do more than that.
The reason why this is the case is because I found it a little bit annoying to set this up on Navidrome and implementing transcoding here was pretty easy.
When the configuration is set to flac: <anything else>, the <anything else>
will be passed to Subsonic as the format option in the stream call. This
requires a transcoding profile to exist with that name in Subsonic.
Navidrome ships with two default profiles that are adequate for iPods: mp3 and
aac. The default mp3 profile will encode the flac as a 192kbps CBR MP3 file
and the aac profile will encode it as a 256kbps CBR AAC (ADTS) file.
iPod serial number
Subpod needs to identify the kind of iPod you have by giving it the last three digits of the serial number. Under the hood Subpod uses libgpod to talk to your iPod, and it requires the serial number for the model. Only the three last digits are required.
Make sure to get the serial number from the Settings section of your iPod and not the engraving in the rear housing, as the housing might have been replaced.
Acknowledgments
libgpod - An awesome C library to talk to iPods. There's no way in hell I would have made this without it.
ffmpeg - It's just great to work with it.
The go-subsonic package and this fork of it, (which I also forked).
taglib and this wasm-based binding package for Go.
The EFF for doing God's work.
iPod, iPhone and iTunes are trademarks of Apple, Inc.
No AI was or will ever be used in this project.
I do this for fun, and so that I don't forget how to write a fucking for loop.