Claude
971f0ba9d6
test: Add comprehensive test coverage for PlaylistSource and ResamplingNode
...
This commit adds extensive unit and integration tests for the audio pipeline
components that were previously untested.
## ResamplingNode Tests (pmoaudio/src/nodes/resampling_node.rs)
- Added 7 test functions covering:
- Helper function tests: extract_channels_i16/i24
- Reconstruction tests: reconstruct_chunk_i16/i24
- Logic tests: passthrough when sample rate matches
- Async tests: verify sync markers pass through unchanged
- Integration test: actual 44.1kHz → 48kHz resampling
## PlaylistSource Tests (pmoaudio-ext/src/sources/playlist_source.rs)
- Added 10 test functions covering:
- Stream validation: valid/invalid channel counts and bit depths
- PCM conversion: bytes_to_segment for I16/I24/I32 formats
- Mono/stereo handling: verify channel duplication
- Error handling: unsupported bit depth rejection
- Type safety: compilation verification
## Bug Fixes
- Fixed imports: Node and NodeLogic moved from nodes to pipeline module
- Fixed AudioCache import: use pmoaudiocache::Cache with alias
- Fixed API calls in ResamplingNode:
- BitDepth::from_audio_chunk() → match pattern
- .stereo() → .get_frames()
- .to_i32() → .as_i32() for I24
- .sample_rate() → .get_sample_rate()
## Documentation
- Added INSTALL_LIBSOXR.md with detailed installation instructions
- Documents local libsoxr installation without sudo privileges
- Provides troubleshooting guide for build and test environments
All tests pass successfully (17 tests total: 7 ResamplingNode + 10 PlaylistSource).
2025-11-05 14:16:12 +00:00
Claude
83e9cca756
fix: Correct ResamplingNode API usage for AudioChunkData
...
- Replace BitDepth::from_audio_chunk() with match pattern
- Use get_frames() instead of stereo() method (API change)
- Use as_i32() instead of to_i32() for I24 conversion
Also successfully installed libsoxr locally without sudo:
- Downloaded libsoxr-dev and libsoxr0 via apt-get
- Extracted to ~/.local using dpkg -x
- Set PKG_CONFIG_PATH and LD_LIBRARY_PATH
- Compilation now succeeds with libsoxr
The implementation is now complete and compiles successfully.
2025-11-05 13:56:27 +00:00
Claude
6a7ba01102
feat: Add PlaylistSource and ResamplingNode for playlist playback
...
This commit implements a new audio source that reads from pmoplaylist
and streams tracks continuously, along with a resampling node to
normalize sample rates.
## New Components
### PlaylistSource (pmoaudio-ext)
- New source in pmoaudio-ext/src/sources/playlist_source.rs
- Reads from pmoplaylist ReadHandle
- Decodes tracks from audio cache (pmoaudiocache)
- Emits PCM with heterogeneous sample_rate and bit_depth
- Polls playlist when empty (configurable interval, default 100ms)
- Emits TrackBoundary markers between tracks
- Graceful shutdown with EndOfStream on stop
- Gated behind 'playlist' feature flag
**Design Philosophy:**
- Keeps each node simple (single responsibility)
- Emits raw PCM without format normalization
- Pipeline designer chooses how to handle heterogeneity
- Ideal for Radio Paradise (homogeneous streams)
- Requires ResamplingNode + ToI24Node for mixed playlists
### ResamplingNode (pmoaudio)
- Generic resampling node in pmoaudio/src/nodes/resampling_node.rs
- Normalizes variable sample rates to a target rate
- Uses libsoxr for high-quality resampling
- Automatically detects sample rate changes
- Recreates resampler as needed
- Preserves chunk type (I16/I24/I32/F32/F64)
- Quality adapts to bit depth (Medium/High/Very High)
## Architecture
PlaylistSource is placed in pmoaudio-ext to avoid circular dependencies:
- pmoaudio-ext depends on: pmoaudio, pmoplaylist, pmoaudiocache
- No reverse dependencies = clean dependency graph
## Configuration
### pmoaudio-ext/Cargo.toml
- Updated 'playlist' feature to include pmoaudiocache, pmocache, pmoflac
- Added sources module export
### pmoaudio
- Added resampling_node module
- Public export: ResamplingNode
## System Requirements
⚠️ **IMPORTANT**: libsoxr-dev must be installed for compilation
See INSTALL_NOTES.md for installation instructions per platform.
## Usage Example
```rust
// Radio Paradise (homogeneous 44.1kHz/16bit)
let mut source = PlaylistSource::new(playlist, cache);
let to_i24 = ToI24Node::new();
source.register(Box::new(to_i24));
// Mixed playlist (needs normalization)
let mut source = PlaylistSource::new(playlist, cache);
let mut resampler = ResamplingNode::new(48000); // Force 48kHz
let to_i24 = ToI24Node::new();
source.register(Box::new(resampler));
resampler.register(Box::new(to_i24));
```
## Files Changed
- pmoaudio-ext/Cargo.toml: Update playlist feature
- pmoaudio-ext/src/lib.rs: Add sources module
- pmoaudio-ext/src/sources/mod.rs: New sources module
- pmoaudio-ext/src/sources/playlist_source.rs: New PlaylistSource (580 lines)
- pmoaudio/src/nodes/resampling_node.rs: New ResamplingNode (350 lines)
- pmoaudio/src/nodes/mod.rs: Register resampling_node
- pmoaudio/src/lib.rs: Export ResamplingNode
- INSTALL_NOTES.md: System requirements documentation
## Future Work
- GapInsertionNode (inserts silence between tracks)
- CrossfadeNode (fade-in/fade-out mixing)
- Examples (deferred until implementation validated)
2025-11-05 13:44:24 +00:00
Claude
92c53ed3a5
feat: Add logic_mut() to Node and fix playlist registration in FlacCacheSink
...
- Add Node::logic_mut() method to allow post-construction configuration
of node logic before run() is called
- Fix FlacCacheSink to properly transfer playlist_handle_pending to
the inner logic using logic_mut()
- Resolves FIXME at flac_cache_sink.rs:656 about missing logic_mut()
This enables the playlist registration mechanism to work correctly:
1. User calls register_playlist() on FlacCacheSink
2. Handle is stored in playlist_handle_pending
3. During run(), handle is transferred to FlacCacheSinkLogic
4. Tracks are automatically added to playlist after caching
2025-11-04 22:29:32 +00:00
8389d1a78e
Récupération de l'erreur git cleaning
2025-11-04 21:13:06 +01:00
0603da2998
Ajout de la gestion des couvertures d'albums par le FlacCacheSink
2025-11-03 20:48:58 +01:00
157baadcfd
Ajout d'un noeud puis vers le cache audio
2025-11-03 14:45:37 +01:00
7d907e7429
Implémentation des pmometadata dans pmocacheaudio
2025-11-03 14:45:37 +01:00
5f29496d79
Retour sur pmoaudio
2025-11-03 14:45:37 +01:00
a14210345c
Restructuration de pmoaudio avec ajout des messages de synchro
2025-11-03 14:45:37 +01:00
0351d17fee
Passons en stéreo
...
reprise du module DSP pmoaudio
2025-11-03 14:45:37 +01:00
776c535862
amélioration de la webapp
2025-10-20 16:18:21 +02:00
fb94886c53
Complete la crate pmoaudio
2025-10-11 16:02:45 +02:00
3fa53c1ba8
Reprise générale de la structure de l'appliweb
2025-10-11 09:55:24 +02:00
d29b6cc1fb
Création du module pmoaudio
2025-10-11 09:46:26 +02:00