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

pulseaudio_dlna.streamserver provides wrong sample specs

Open Herzbergh opened this issue 2 years ago • 2 comments

hi, i want to stream audio for example in 192000hz 24bit to an external device through pulseaudio-dlna server but it does not work propely

I start the server with: pulseaudio-dlna &

After I play an audio track with strawberry (e.g. a particular track that has 192000hz and 24bit) the command that pulseaudio_dlna sends to parec is:

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

instead of e.g.:

12-11 23:15:39 pulseaudio_dlna.streamserver INFO Starting processes "parec --format=s24le -d n70a_dlna.monitor | ffmpeg -loglevel panic -ac 2 -ar 192000-f s24le -i - -strict -2 -f flac pipe:"

/home/user/.local/share/pulseaudio-dlna/devices.json

{ "uuid:5F9EC1B3-ED59-79BE-4522-745e1c8f8596": { "name": "N-70A", "flavour": "DLNA", "codecs": [

        {
            "rules": [],
            "sample_rate": 192000,
            "mime_type": "audio/flac",
            "identifier": "flac"
        },
        {
            "rules": [],
            "sample_rate": 44100,
            "channels": 2,
            "mime_type": "audio/L16;rate=44100;channels=2",
            "identifier": "l16"
        },
        {
            "rules": [],
            "sample_rate": 48000,
            "channels": 2,
            "mime_type": "audio/L16;rate=48000;channels=2",
            "identifier": "l16"
        },
        {
            "rules": [],
            "sample_rate": 44100,
            "channels": 1,
            "mime_type": "audio/L16;rate=44100;channels=1",
            "identifier": "l16"
        },
        {
            "rules": [],
            "sample_rate": 48000,
            "channels": 1,
            "mime_type": "audio/L16;rate=48000;channels=1",
            "identifier": "l16"
        }
    ],
    "rules": []
}

}

my etc/pulse/daemon.conf ( also the one in home /config folder ) looks like that:

default-sample-format = s24le default-sample-rate = 192000 alternate-sample-rate = 48000 default-sample-channels = 2 avoid-resampling = yes default-channel-map = front-left,front-right default-fragments = 2 default-fragment-size-msec = 125 #resample-method = speex-float-10 resample-method = soxr-vhq remixing-produce-lfe = no remixing-consume-lfe = no high-priority = yes nice-level = -11 realtime-scheduling = yes realtime-priority = 9 rlimit-rtprio = 9 daemonize = no flat-volumes = no


pacmd list-sinks says:

2 sink(s) available. index: 0 name: <alsa_output.pci-0000_04_00.6.analog-stereo> driver: <module-alsa-card.c> flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY state: IDLE suspend cause: (none) priority: 9039 volume: front-left: 95682 / 146% / 9,86 dB, front-right: 95682 / 146% / 9,86 dB balance 0,00 base volume: 65536 / 100% / 0,00 dB volume steps: 65537 muted: no current latency: 39,59 ms max request: 60 KiB max rewind: 60 KiB monitor source: 0 sample spec: s32le 2ch 192000Hz channel map: front-left,front-right Stereo used by: 0 linked by: 1 configured latency: 40,00 ms; range is 0,50 .. 2000,00 ms card: 1 <alsa_card.pci-0000_04_00.6> module: 7 properties: alsa.resolution_bits = "32" device.api = "alsa" device.class = "sound" alsa.class = "generic" alsa.subclass = "generic-mix" alsa.name = "ALC269VC Analog" alsa.id = "ALC269VC Analog" alsa.subdevice = "0" alsa.subdevice_name = "subdevice #0" alsa.device = "0" alsa.card = "1" alsa.card_name = "HD-Audio Generic" alsa.long_card_name = "HD-Audio Generic at 0xfe6c0000 irq 77" alsa.driver_name = "snd_hda_intel" device.bus_path = "pci-0000:04:00.6" sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:04:00.6/sound/card1" device.bus = "pci" device.vendor.id = "1022" device.vendor.name = "Advanced Micro Devices, Inc. [AMD]" device.product.id = "15e3" device.product.name = "Family 17h (Models 10h-1fh) HD Audio Controller" device.string = "front:1" device.buffering.buffer_size = "3072000" device.buffering.fragment_size = "1536000" device.access_mode = "mmap+timer" device.profile.name = "analog-stereo" device.profile.description = "Analog Stereo" device.description = "Family 17h (Models 10h-1fh) HD Audio Controller Analog Stereo" module-udev-detect.discovered = "1" device.icon_name = "audio-card-pci" ports: analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: yes) properties: device.icon_name = "audio-headphones" active port:

  • index: 1 name: <n70a_dlna> driver: <module-null-sink.c> flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY state: RUNNING suspend cause: (none) 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: 3,95 ms max request: 60 KiB max rewind: 60 KiB monitor source: 1 sample spec: float32le 2ch 192000Hz channel map: front-left,front-right Stereo used by: 1 linked by: 4 configured latency: 40,00 ms; range is 0,50 .. 2000,00 ms module: 22 properties: device.description = "N-70A (DLNA)" device.class = "abstract" device.icon_name = "audio-card"

sink index 1 is the one from interest.. sample spec: float32le 2ch 192000Hz is also different from the daemon config..

Any idea how i can force pulseaudio-dln to use parec with the correct/possible sample specs?

best,

Herzbergh avatar Dec 15 '22 15:12 Herzbergh

Been a while since I've used this, but think I'm right on saying that you just need to pass the right command line flags to set the output codec and spec. This remains constant, it doesn't change dynamically

netmindz avatar Dec 21 '22 09:12 netmindz

hi netmindz,

if i start with e.g.: pulseaudio-dlna -c flac --encoder-backend=ffmpeg & the settings of the config will not be used anymore, because according to Option --create-device-config: "A written config is loaded by default if the --encoder and --bit-rate options are not used".

and it is not also possible to use the options " --format=s16le" "flac - -c --channels 2 --bps 24 "--sample-rate 192000" with the pulseaudio-dlna

btw in my opinion it is very bad to provide the information "A written config is loaded by default if the --encoder and --bit-rate options are not used" under the --create-device-config setting.. because the config will be created automatically and if the config is fine you will not read the information for that option... and if you use the parameters -encoder and --bit-rate without that information you will get a bit confused....

Herzbergh avatar Dec 21 '22 15:12 Herzbergh