The player always opened the system default output device. On a Raspberry Pi that default is often HDMI, so playback ran but nothing came out of the headphone jack or a USB/DAC -- "it plays but I hear no sound". Add an [audio] device option to crabidy-server.toml: a case-insensitive substring of the output device name (a memorable fragment is enough). The player engine opens the first matching device and falls back to the system default with a warning if none matches. Absent config keeps the system default, so existing setups are unchanged. To discover the names, a new `crabidy-server audio-devices` subcommand (also on `cbd`) lists the output devices and marks the one the current config selects, using the same match the server applies at startup. Plumbing: audio_player::output_device_names() enumerates via cpal; Player::new(Option<String>) replaces the device-less construction (Default = new(None)); Playback::new takes the device and serve() reads it from settings. cpal's name() is deprecated in favor of description(), but name() returns the ALSA-stable string users see in `aplay -l` and match against, so it is kept behind a documented #[allow(deprecated)]. README documents the [audio] device option under the Pi/config section. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| build.rs | ||