Multiple improvements to OGG-FLAC format to better comply with xiph.org spec: ## Changes to streaming_ogg_flac_sink.rs ### 1. Fixed Identification Packet (BOS) Previously included entire FLAC header (all metadata blocks) in the identification packet. Now correctly extracts ONLY the STREAMINFO block. Format now complies with spec: - Bytes 0: 0x7F - Bytes 1-4: "FLAC" - Bytes 5-6: Version 0x01 0x00 - Bytes 7-8: Number of header packets = 1 (was 0, now corrected!) - Bytes 9-12: "fLaC" - Bytes 13+: STREAMINFO block only (38 bytes: type + length + 34 bytes data) Result: Identification packet is now 51 bytes (was 95 bytes) ### 2. Improved FLAC Data Packetization Changed from arbitrary 4KB chunks to 8KB chunks read directly from encoder. While not perfect (true spec compliance requires one FLAC frame per OGG packet), this reduces the chance of splitting frames and improves compatibility. Proper FLAC frame parsing would require implementing a FLAC frame header parser, which is complex. Current approach is a pragmatic compromise for streaming. ### 3. Added Debug Logging - Log STREAMINFO block length (should be 34 bytes) - Log extracted STREAMINFO size - Log final identification packet size - Helps verify spec compliance during development ## Testing - Compilation successful - Stream generates correct header size (141 bytes total: 51 + 90) - STREAMINFO correctly extracted as 38 bytes - Ready for VLC compatibility testing ## Known Limitations - Granule position still 0 (should increment with sample count) - FLAC frame boundaries not perfectly respected (would need frame parser) - These may be addressed in future iterations if needed for compatibility
Développement de l'application PMOMusic en RUST
🚀 Démarrage rapide
Installation des dépendances (environnement sans sudo)
Pour compiler PMOMusic dans un environnement sans privilèges sudo (comme Claude Code) :
# 1. Installation automatique de libsoxr et libasound2 (une seule fois)
./setup-deps.sh
# 2. Créer le fichier setup-env.sh (une seule fois, voir INSTALL_LIBSOXR.md pour le contenu)
cat > setup-env.sh << 'EOF'
#!/bin/bash
export PKG_CONFIG_PATH="$HOME/.local/usr/lib/x86_64-linux-gnu/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$HOME/.local/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH"
export RUSTFLAGS="-L $HOME/.local/usr/lib/x86_64-linux-gnu"
echo "Variables d'environnement configurées pour PMOMusic"
EOF
# 3. Configuration de l'environnement (à chaque nouvelle session)
source setup-env.sh
# 4. Compilation
cargo build
# 5. Test de l'exemple Radio Paradise
cargo run --package pmoparadise --example play_and_cache --features full -- 0
⚠️ Note : Le fichier setup-env.sh est dans .gitignore car il contient une configuration locale.
Documentation
- INSTALL_NOTES.md - Guide d'installation général
- INSTALL_LIBSOXR.md - Installation détaillée de libsoxr et ALSA
Création de la structure
mkdir pizzicato
cd pizzicato
jj git init
touch Readme.md
Maintenant on peu créer l'application PMOMusic
cargo new PMOMusic
On ajoute un fichier Cargo.toml décrivant le workspace pizzicato qui ne contient que notre nouvelle application
[workspace]
members = ["PMOMusic"]
On crée le package pmoupnp
cargo new pmoupnp --lib
Cela modifie automatiquement le fichier Cargo.toml créé juste avant.
Dans ce package un sous module statevariable
cd pmoupnp/src
mkdir statevariable
Petite expériences jujutsu
- Je veux voir l'historique
jj log
@ lkmlpmnk eric@coissac.eu 2025-09-12 09:48:38 a27b6a9a
│ On commence les states variables
○ mzvokmpk eric@coissac.eu 2025-09-12 09:32:27 926827f3
│ Retire le répertoir target du suivi
○ skknrvut eric@coissac.eu 2025-09-12 09:05:27 cbad5c34
│ Initialisation des l'arborescence de répertoires
◆ zzzzzzzz root() 00000000
- Je veux me mettre dans un commit:
jj edit mzvokmpk
je veux créer un nouveau commit à la suite d'un autre et m'y placer
jj new mzvokmpk
mzvokmpk peut être @ pour dans le commit courant ou @- pour dans le parent
- je veux arreter de suivre
- un fichier
jj file untrack <filename>
- un répertoire
find dirname -type f -exec jj file untrack {} \;
Dans tous les cas ne pas oublier d'inscrire le fichier ou le repertoire dans le .gitignore
- je veux déplacer un commit comme un sous commit d'un aute
jj rebase -d destination -r source
eventuellement faire un
jj resolve --all
jj rebase --continue
pour résoudre les conflits
Installer rust sur mac
brew install rustup-init
rustup-init
rustup default stable