文档
Tune Bridge
将任意 USB DAC 变为网络音频端点。Bit-perfect、多房间、开源。
概述
什么是 Tune Bridge?
Tune Bridge 是一款轻量级音频接收器,它连接到你的 USB DAC,并通过网络使用 OAAT 协议从 Tune 服务器接收高解析度音频。可以把它理解为开源版的 Roon Bridge。
它支持最高 768kHz/32-bit 的 PCM、原生 DSD(视 DAC 而定,最高 DSD512,见 DSD)、FLAC 传输、无缝播放,以及亚毫秒级精度的同步多房间。
Tune Bridge 是一个单一二进制文件(约 8 MB),零依赖。将它安装在配有 USB DAC 的 Raspberry Pi 上,你就拥有了一台高端网络流媒体播放器。
系统要求
- 网络中运行着一台 Tune 服务器(v0.8.0+)
- 一个连接到运行 Tune Bridge 设备上的 USB DAC
- 与 Tune 服务器处于同一 LAN(多房间建议使用有线以太网)
支持的平台:
| 平台 | 架构 | 测试环境 |
|---|---|---|
| Linux (arm64) | aarch64 | Raspberry Pi 4(Debian 13,I2S DAC) |
| Linux (x86_64) | x86_64 | Ubuntu, Debian, Fedora |
| macOS (Apple Silicon) | aarch64 | M1/M2/M3/M4 Mac |
| macOS (Intel) | x86_64 | 2015 年及以后的 Mac |
在 Raspberry Pi 上,目前试过的配置是运行 Debian 13 的 Raspberry Pi 4,搭配 I2S DAC(I-Sabre Q2M)。DietPi 和 USB DAC 尚未验证。
Raspberry Pi 安装
面向发烧友使用的推荐配置。配有 USB DAC 的 Raspberry Pi 4 能以极低的成本提供出色的音质。
1. 下载二进制文件
# Download the latest release for ARM64 Linux
curl -L https://github.com/Tune-Audio/oaat/releases/download/v0.2.7/tune-bridge-v0.2.7-aarch64-unknown-linux-gnu.tar.gz -o tune-bridge.tar.gz
tar xzf tune-bridge.tar.gz
sudo mv tune-bridge /usr/local/bin/
chmod +x /usr/local/bin/tune-bridge2. 列出音频设备
aplay -l
tune-bridge endpoint --list-devices3. 启动 Tune Bridge
tune-bridge endpoint --name "Living Room DAC" --audio-device "plughw:CARD=D10,DEV=0"4. 安装为 systemd 服务
# The service user needs access to the sound card
sudo usermod -aG audio pi
sudo tee /etc/systemd/system/tune-bridge.service > /dev/null << 'EOF'
[Unit]
Description=Tune Bridge
After=network.target sound.target
[Service]
Type=simple
User=pi
ExecStart=/usr/local/bin/tune-bridge endpoint --name "Living Room DAC" --audio-device "plughw:CARD=D10,DEV=0"
Restart=on-failure
RestartSec=3
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now tune-bridge不要在 ExecStart 中加入 --daemon:使用 Type=simple 时,由 systemd 自己在后台运行 Tune Bridge。--daemon 会让进程 fork 后退出,systemd 因此认为服务已停止,并不断重启它。请把 pi 换成运行该服务的用户(例如 DietPi 上的 dietpi),并把设备名换成你自己的(见选择音频输出)。
macOS 安装
# Apple Silicon (M1/M2/M3/M4)
curl -L https://github.com/Tune-Audio/oaat/releases/download/v0.2.7/tune-bridge-v0.2.7-aarch64-apple-darwin.tar.gz -o tune-bridge.tar.gz
# Intel
curl -L https://github.com/Tune-Audio/oaat/releases/download/v0.2.7/tune-bridge-v0.2.7-x86_64-apple-darwin.tar.gz -o tune-bridge.tar.gz
tar xzf tune-bridge.tar.gz
sudo mv tune-bridge /usr/local/bin/
# Start
tune-bridge endpoint --name "My Mac DAC"Linux (x86) 安装
curl -L https://github.com/Tune-Audio/oaat/releases/download/v0.2.7/tune-bridge-v0.2.7-x86_64-unknown-linux-gnu.tar.gz -o tune-bridge.tar.gz
tar xzf tune-bridge.tar.gz
sudo mv tune-bridge /usr/local/bin/
# Install ALSA development libraries (if not already installed)
sudo apt-get install -y libasound2-dev
# Start
tune-bridge endpoint --name "My DAC" --audio-device "sysdefault:CARD=D10"配置
Tune Bridge 可通过命令行标志或 TOML 配置文件进行配置。
# Create config file
mkdir -p ~/.config/tune-bridge
cat > ~/.config/tune-bridge/config.toml << 'EOF'
[endpoint]
name = "Living Room DAC"
port = 9740
audio_device = "plughw:CARD=D10,DEV=0"
[capabilities]
pcm_max_rate = 384000
pcm_max_bits = 32
flac = true
dsd = true # native DSD, probed on the DAC (see the DSD section); false = the server converts DSD to PCM
channels_max = 2
[dac]
hardware_volume = false
EOF
# Start with config
tune-bridge endpoint --config ~/.config/tune-bridge/config.toml命令行标志:
| 标志 | 说明 | 默认值 |
|---|---|---|
--name | 显示名称(在 Tune 中显示) | Hostname |
--port | TCP 控制端口 | 9740 |
--audio-device | 音频设备名称。Linux 上:hw:、plughw:、default、sysdefault: | 检测到的 DAC,否则为 default(Linux,v0.2.7) |
--daemon | 转入后台运行(不要在 systemd 下使用) | false |
--dsd | 声明并播放原生 DSD,最高为 DAC 接受的采样率(最高 DSD512,ALSA DSD_U32_BE) | false |
--tls | 启用 TLS 1.3(自签名) | false |
--config | TOML 配置文件路径 | none |
--list-devices | 列出音频设备后退出 | — |
--no-web-ui | 禁用 Web 状态仪表板 | false |
选择音频输出
在 Linux 上,用 aplay -l 列出声卡,然后把声卡名称和设备编号传给 --audio-device(或配置文件 [endpoint] 部分中的 audio_device)。可接受的名称以 hw:、plughw:、default 或 sysdefault: 开头,其他任何名称都会被替换为 default,被拒绝的名称会记录到日志中。
aplay -l
# card 1: D10 [D10], device 0: USB Audio [USB Audio]
# -> card name: D10, device number: 0
tune-bridge endpoint --name "Living Room DAC" --audio-device "plughw:CARD=D10,DEV=0"在当前版本(v0.2.7)中,不指定 --audio-device 时,Tune Bridge 使用它检测到的 DAC:优先选择 USB DAC,其次是名称包含 DAC 的 I2S 声卡,绝不选择 HDMI。如果没有候选,或有多块无法区分的声卡,输出保持为 default。日志会显示 audio device auto-detected device=…。设备有多块声卡时,请指定 --audio-device。
使用 plughw: 时,如果 DAC 不接受原始格式或采样率,ALSA 会进行转换。hw: 直接打开声卡,不做任何转换。
DSD
原生 DSD 默认关闭。可用 --dsd 开启,或在配置文件的 [capabilities] 部分设置 dsd = true。
tune-bridge endpoint --name "Living Room DAC" --audio-device "plughw:CARD=D10,DEV=0" --dsd在 v0.2.7 中,启用 --dsd 时,Tune Bridge 会在启动时探测 DAC,并声明 DAC 接受的最高原生 DSD 采样率(最高 DSD512),格式为 ALSA DSD_U32_BE(不使用 DoP)。如果探测失败,或输出为 default,则声明 DSD64。日志会显示 native DSD rates probed dsd_max=…。播放 DSD 时,它以 hw: 模式打开声卡:plughw: 或 sysdefault:CARD= 名称会被改写为 hw:,default 则保持不变。DAC 必须在该设备上接受 DSD_U32_BE。未启用 --dsd 时,Tune 服务器会把所有 DSD 转换为 PCM。
尚未在真实的 USB DAC 上测试,也未测试 DSD512。
多房间设置
在 OAAT v0.2.7 中,多房间是完全动态的。你可以在音乐播放期间添加或移除端点、设置每台设备的音量,并监控端点健康状况。
1. 启动多个 Tune Bridge 实例
# On Raspberry Pi in the living room
tune-bridge endpoint --name "Living Room" --daemon
# On Raspberry Pi in the kitchen
tune-bridge endpoint --name "Kitchen" --daemon
# On a Mac in the bedroom
tune-bridge endpoint --name "Bedroom"2. 在 Tune 中创建群组
打开 Tune Web 客户端 → Zone Manager → OAAT Multi-Room Groups → New Group。按 IP 地址和端口添加端点。音频将在所有端点之间以亚毫秒级精度同步。
3. 每台设备的音量
每个端点在区域管理器中都有独立的音量滑块。主音量控制所有端点;每台设备的偏移量可用于平衡各房间(例如,让厨房比卧室更响)。
Web 状态界面
每个 Tune Bridge 实例都在 http://<bridge-ip>:9741 提供内置 Web 仪表板。它会显示:
- 当前播放状态(曲目、艺人、专辑、封面)
- 音频格式(采样率、位深、编解码器)
- 已连接的控制器名称
- 音频设备选择(无需重启即可切换 DAC)
- 音量级别
故障排查
未发现 Tune Bridge
- 确保两台设备处于同一子网
- 检查 mDNS(端口 5353 UDP)是否被防火墙阻止
- 尝试直接连接:在 Tune 中按 IP 手动添加端点
无音频输出
- 运行
tune-bridge endpoint --list-devices以确认已检测到你的 DAC - 在 Linux 上,检查 ALSA 权限:
sudo usermod -aG audio $USER - 尝试用
--audio-device显式指定设备
诊断
tune-bridge --version:已安装的版本,提交错误报告时请附上aplay -l:ALSA 看到的声卡和设备- 播放期间执行
cat /proc/asound/cardN/pcm0p/sub0/hw_params(N 为声卡编号):实际发送给 DAC 的格式、采样率和声道数 - 停止 Tune Bridge 后执行
aplay -D hw:CARD=D10,DEV=0 --dump-hw-params /dev/zero:DAC 接受的格式和采样率(按 Ctrl+C 停止)
多房间同步问题
- 使用有线以太网以获得最佳同步精度(< 100 us)
- Wi-Fi 会引入抖动——同步精度预计为 2-5 ms
- 在 Web 界面仪表板中检查时钟同步健康状况
API 参考
OAAT 群组管理可通过 Tune 服务器 REST API 使用:
| 方法 | 端点 | 说明 |
|---|---|---|
GET | /api/v1/zone-manager/oaat-groups | 列出所有 OAAT 群组 |
POST | /api/v1/zone-manager/oaat-groups | 创建新群组 |
GET | /api/v1/zone-manager/oaat-groups/:id | 获取群组状态(端点、音量、流传输状态) |
DELETE | /api/v1/zone-manager/oaat-groups/:id | 删除群组 |
POST | /api/v1/zone-manager/oaat-groups/:id/endpoints | 添加端点(后续加入) |
DELETE | /api/v1/zone-manager/oaat-groups/:id/endpoints/:ep_id | 移除端点 |
PUT | /api/v1/zone-manager/oaat-groups/:id/volume | 设置主音量 |
PUT | /api/v1/zone-manager/oaat-groups/:id/endpoints/:ep_id/volume | 设置每台设备的音量 |
# Example: create a group
curl -X POST http://tune-server:8888/api/v1/zone-manager/oaat-groups \
-H "Content-Type: application/json" \
-d '{"name": "Downstairs", "endpoints": [
{"host": "192.168.1.50", "port": 9740},
{"host": "192.168.1.51", "port": 9740}
]}'
# Example: add endpoint to existing group (late-join)
curl -X POST http://tune-server:8888/api/v1/zone-manager/oaat-groups/oaat-mr-123/endpoints \
-H "Content-Type: application/json" \
-d '{"host": "192.168.1.52", "port": 9740}'
# Example: per-device volume
curl -X PUT http://tune-server:8888/api/v1/zone-manager/oaat-groups/oaat-mr-123/endpoints/abc-def/volume \
-H "Content-Type: application/json" \
-d '{"level": 60}'