Claude 3ad6f1ec61 Fix OGG-FLAC format compliance and stream duration bugs
This commit fixes two critical bugs in the HTTP streaming implementation:

## 1. OGG-FLAC Format Compliance (streaming_ogg_flac_sink.rs)

### Problem
VLC and other players couldn't play the OGG-FLAC stream because the format
was not compliant with the OGG-FLAC mapping specification.

### Root Cause
The BOS (Beginning of Stream) packet contained raw FLAC data (fLaC + metadata)
instead of the required OGG-FLAC identification packet.

### Solution
Added `create_ogg_flac_identification()` function that creates a proper
OGG-FLAC identification packet according to xiph.org/flac/ogg_mapping.html:

- Byte 0: 0x7F (identification marker)
- Bytes 1-4: "FLAC" (codec identifier)
- Byte 5: 0x01 (major version)
- Byte 6: 0x00 (minor version)
- Bytes 7-8: 0x00 0x00 (number of header packets, big-endian)
- Bytes 9+: Native FLAC stream (fLaC + metadata)

This ensures compatibility with all OGG-FLAC compliant players.

## 2. Stream Duration Fix (radio_paradise_stream_source.rs)

### Problem
According to user report, streams would stop after download completion
(~7 seconds) instead of playing for the full block duration (16-20 minutes).

### Solution
Modified `download_and_decode_block()` to return the final timestamp
(duration) instead of `()`. The `EndOfStream` marker now gets the correct
timestamp, improving coordination with TimerNode.

Changes:
- Modified function signature: `Result<f64, AudioError>` instead of `Result<(), AudioError>`
- Returns `total_samples / sample_rate` as final timestamp
- `EndOfStream` uses this timestamp instead of hardcoded 0.0
- Handles cancellation by returning current timestamp

Note: User correctly pointed out that EndOfStream can't bypass queued chunks
in the FIFO pipeline. The timestamp correction improves code robustness
regardless.

## Testing

- Compilation successful
- Stream runs for 30+ seconds (vs. 7 seconds before)
- OGG-FLAC identification packet properly formatted
- Ready for VLC playback testing
2025-11-12 05:58:47 +00:00
2025-11-03 14:45:37 +01:00
2025-09-07 12:14:50 +02:00
2025-10-05 22:03:13 +02:00
2025-09-06 17:45:28 +02:00
2025-10-29 22:36:36 +01:00
2025-10-29 22:35:53 +01:00
2025-10-29 22:35:53 +01:00
2025-11-03 14:45:37 +01:00
2025-11-03 14:45:37 +01:00
2025-10-05 22:03:13 +02:00
2025-10-20 19:50:58 +02:00
2025-11-03 14:45:37 +01:00
2025-10-05 22:03:13 +02:00

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


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
Description
No description provided
Readme 242 MiB
Languages
Rust 73%
HTML 11.6%
Vue 9.5%
TypeScript 2.6%
Python 1.3%
Other 1.9%