pulseaudio-dlna icon indicating copy to clipboard operation
pulseaudio-dlna copied to clipboard

FLAC 24/96 streaming

Open arigit opened this issue 7 years ago • 7 comments

Using pulseaudio-dlna master.

Configured /etc/pulse/daemon.conf with: default-sample-format = s24le default-sample-rate = 192000

Starting pulseaudo-dlna with: pulseaudio-dlna --codec flac --bit-rate 96

Playing 24/96 media with audacious (on fedora 26), audacious set to output 24 bits

I can see in pulseaudio-dlna the following

pulseaudio_dlna.streamserver INFO Starting processes "parec --format=s16le -d kefls50wireless_dlna.monitor | flac - -c --channels 2 --bps 16 --sample-rate 44100 --endian little --sign signed -s"

The playback works, but clearly the flac codec is downsampling to 16/44.1 no matter what (tried removing --bit-rate 96 from pulseaudio-dlna option, to no avail).

Why is pulseaudio-dlna not streaming at 24/96 (or 24/192) - is this supported?

arigit avatar Jul 25 '17 06:07 arigit

For reference - capabilities reported by pulseaudio for the wireless DLNA speakers are 24/192 pulseaudio-dlna seems to ignore this and still do 16/44.1

pacmd list-sinks ... index: 4 name: <kefls50wireless_dlna> driver: <module-null-sink.c> flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY state: RUNNING suspend cause: priority: 1000 volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB balance 0.00 base volume: 65536 / 100% / 0.00 dB volume steps: 65537 muted: no current latency: 29.34 ms max request: 45 KiB max rewind: 45 KiB monitor source: 4 sample spec: s24le 2ch 192000Hz channel map: front-left,front-right Stereo used by: 1 linked by: 2 configured latency: 40.00 ms; range is 0.50 .. 2000.00 ms module: 32 properties: device.description = "KEF LS50 Wireless (DLNA)" device.class = "abstract" device.icon_name = "audio-card"

arigit avatar Jul 26 '17 04:07 arigit

@arigit : Jep you are right, it is not supported currently. Most speakers do not support those. But it shouldn't be too hard to implement. I would be happy to accept a PR for this!

masmu avatar Jul 26 '17 10:07 masmu

@masmu thanks - I think I can help out, I do have some python / pygtk experience - basic understanding to at least get started and give this a shot, hopefully ending in a PR. Actually I've already tried to play around with the code, I didn't get too far. I tried to tweak the ffmpeg backend but that probably wasn't the right start.

Can you give me some guidance on what you expect the PR to do and where to focus my effort/code study first. Where in the code would you expect sample_rate and bit_rate selection occur (for FLAC/WAV output)... any hint welcome

arigit avatar Jul 26 '17 13:07 arigit

@arigit Could you please provide me a full debug.log?

pulseaudio-dlna --debug 2>&1 | tee -a debug.log

I would like to take a look into your devices media specifications.

masmu avatar Aug 06 '17 11:08 masmu

Captured, please download it from here:

https://github.com/arigit/Misc-Temp/blob/master/debug-github.tar.xz

Please let me know once you download it so I can remove it from my repo.

Scenario: playing back a 96/24 FLAC with audacious, configured to use pulseaudio & 24 bit depth. Pulseaudio is configured with

default-sample-format = s24le default-sample-rate = 192000

Two devices should support HD Audio streaming: the KEF speakers (for sure) and also (I think) the raspberry running OSMC / Kodi (it plays back HD perfectly via NFS share, outputting to a DAC, the DAC reports HD)

arigit avatar Aug 06 '17 17:08 arigit

Got it, thanks! Will take a look at it tonight.

masmu avatar Aug 07 '17 06:08 masmu

Is there any plan to progress on higher bitrate support?

The Chromecast audio should support 24 bit / 192kHz also from what I read. Apparently mkchromecast can do it.

hmoffatt avatar Jul 11 '19 12:07 hmoffatt