dheijl / swyh-rs

Stream What You Hear written in rust, inspired by SWYH.
MIT License
354 stars 15 forks source link

No sound from AudioPro A26 #74

Open jakob-lilliemarck opened 2 years ago

jakob-lilliemarck commented 2 years ago

Hi, I'm trying to use your app to stream my computer sound to our AudioPro A26 wifi speakers. I've managed to stream to them using the bubbleupnp mobile app and using pulseaudio-dlna, but it was not without alot of lag - so trying this in hope that it'll be in sync :)

Anyway, I can build and run the app without issues on my laptop (Manjaro os). The speakers pop up as an available renderer and when I set the format option to FLAC and start streaming I can hear the speaker "turning on", like they're on but got no sound.

Looking at the debug log in the app it seems the streaming starts and immediatly turns off? See the last few lines:

Configuration { server_port: Some(5901), auto_resume: false, sound_source: "pulse", sound_source_index: Some(1), log_level: Info, ssdp_interval_mins: 1.0, auto_reconnect: false, disable_chunked: false, use_wave_format: false, bits_per_sample: Some(16), streaming_format: Some(Flac), monitor_rms: false, last_renderer: "WiiMu LinkPlayer AudioPro_A26_0695", last_network: "192.168.1.240", config_dir: "/home/jakob/.swyh-rs" }
*W*W*>Running DEBUG build => log level set to DEBUG!
Setup audio sources
Sorry, but you don't have permissions to raise priority...
Capturing audio from: pulse
Default audio SupportedStreamConfig { channels: 2, sample_rate: SampleRate(44100), buffer_size: Range { min: 3, max: 4194304 }, sample_format: F32 }
Discover networks
Starting SSDP discovery
The wave_reader is now receiving samples
The streaming server is listening on http://192.168.1.240:5901/stream/swyh.wav
Streaming sample rate: 44100, bits per sample: 16, format: FLAC
AV Start playing on AudioPro_A26_0695 host=192.168.1.130 port=49152 from 192.168.1.240 using AvTransport Play
AV Stop playing on AudioPro_A26_0695 host=192.168.1.130 port=49152
Received request /stream/swyh.wav from 192.168.1.130:51609
Streaming audio/FLAC, input sample format F32, channels=2, rate=44100, disable chunked=false to 192.168.1.130:51609

Thankful for any help - would be awesome to be able to use our wifi-speakers as a playback device for gaming, films, etc.

dheijl commented 2 years ago

While swyh-rs does not do any extra buffering, it will never be in sync with video or gaming, unless you can delay the video like VLC can do. By the time an audio buffer, typically 8 KB, has been captured by the OS and delivered to the swyh-rs call-back it is already out of sync, and then it has not even been transmitted to the receiving device.

But this does not explain why flac is not being played. Could you disable chunked transfer, enable the rms monitor, check that the rms monitor shows activity, and then attach a debug log here?