You are not logged in.

#1 2014-12-07 13:49:44

Fackamato
Member
Registered: 2006-03-31
Posts: 579

How do I make 24/96 is used for all audio playback?

edit2: It looks like you have to enable resampling in daemon.conf and Pulseaudio will resample every incoming sound. I'm not sure how to verify if this is being done, however.

$ grep sample daemon.conf
resample-method = speex-float-10
default-sample-format = s24le
default-sample-rate = 96000
alternate-sample-rate = 48000
default-sample-channels = 2

The problem: How do I ensure mpd plays back at 24/96 to the Pulseaudio server? I think the PA server is already playing back at 24/96 but I'm not sure. Details below:

Sound card: O2+ODAC combo

/etc/pulse/daemon.conf

default-sample-format = s24le
default-sample-rate = 96000
default-sample-channels = 2

acmd list-sinks

$ pacmd list-sinks
1 sink(s) available.
  * index: 0
	name: <alsa_output.usb-Binary_Audio_UAC1_DAC-01-DAC.analog-stereo>
	driver: <module-alsa-card.c>
	flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY FLAT_VOLUME 
	state: RUNNING
	suspend cause: 
	priority: 9049
	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: 99.20 ms
	max request: 56 KiB
	max rewind: 56 KiB
	monitor source: 0
	sample spec: s24le 2ch 96000Hz
	channel map: front-left,front-right
	             Stereo
	used by: 1
	linked by: 1
	fixed latency: 100.00 ms
	card: 0 <alsa_card.usb-Binary_Audio_UAC1_DAC-01-DAC>
	module: 7
	properties:
		alsa.resolution_bits = "24"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "USB Audio"
		alsa.id = "USB Audio"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "0"
		alsa.card_name = "UAC1 DAC"
		alsa.long_card_name = "Binary Audio UAC1 DAC at usb-0000:00:1a.0-1.5.4.2, full speed"
		alsa.driver_name = "snd_usb_audio"
		device.bus_path = "pci-0000:00:1a.0-usb-0:1.5.4.2:1.1"
		sysfs.path = "/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5.4/1-1.5.4.2/1-1.5.4.2:1.1/sound/card0"
		udev.id = "usb-Binary_Audio_UAC1_DAC-01-DAC"
		device.bus = "usb"
		device.vendor.id = "1852"
		device.vendor.name = "GYROCOM C&C Co., LTD"
		device.product.id = "7022"
		device.product.name = "UAC1 DAC"
		device.serial = "Binary_Audio_UAC1_DAC"
		device.string = "front:0"
		device.buffering.buffer_size = "57600"
		device.buffering.fragment_size = "14400"
		device.access_mode = "mmap"
		device.profile.name = "analog-stereo"
		device.profile.description = "Analog Stereo"
		device.description = "UAC1 DAC Analog Stereo"
		alsa.mixer_name = "USB Mixer"
		alsa.components = "USB1852:7022"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-usb"
	ports:
		analog-output: Analog Output (priority 9900, latency offset 0 usec, available: unknown)
			properties:
				
	active port: <analog-output>

aplay -L

$ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
default
    Default ALSA Output (currently PulseAudio Sound Server)
sysdefault:CARD=DAC
    UAC1 DAC, USB Audio
    Default Audio Device
front:CARD=DAC,DEV=0
    UAC1 DAC, USB Audio
    Front speakers
surround21:CARD=DAC,DEV=0
    UAC1 DAC, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=DAC,DEV=0
    UAC1 DAC, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=DAC,DEV=0
    UAC1 DAC, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=DAC,DEV=0
    UAC1 DAC, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=DAC,DEV=0
    UAC1 DAC, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=DAC,DEV=0
    UAC1 DAC, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=DAC,DEV=0
    UAC1 DAC, USB Audio
    IEC958 (S/PDIF) Digital Audio Output

Playing music in mpd and trying to play this 24/96 sample:

$ aplay -Dpulse naim-test-1-wav-24-96000.wav 
Playing WAVE 'naim-test-1-wav-24-96000.wav' : Signed 24 bit Little Endian in 3bytes, Rate 96000 Hz, Stereo
aplay: set_params:1233: Sample format non available
Available formats:
- U8
- S16_LE
- S16_BE
- S32_LE
- S32_BE
- FLOAT_LE
- FLOAT_BE
- MU_LAW
- A_LAW

cat /proc/asound/card0/stream0 while mpd is playing:

Binary Audio UAC1 DAC at usb-0000:00:1a.0-1.5.4.2, full speed : USB Audio

Playback:
  Status: Running
    Interface = 3
    Altset = 2
    Packet Size = 582
    Momentary freq = 96000 Hz (0x60.0000)
  Interface 3
    Altset 1
    Format: S16_LE
    Channels: 2
    Endpoint: 3 OUT (ADAPTIVE)
    Rates: 44100, 48000, 96000
  Interface 3
    Altset 2
    Format: S24_3LE
    Channels: 2
    Endpoint: 3 OUT (ADAPTIVE)
    Rates: 44100, 48000, 96000

Capture:
  Status: Stop
  Interface 2
    Altset 1
    Format: S16_LE
    Channels: 2
    Endpoint: 2 IN (ADAPTIVE)
    Rates: 8000, 16000, 32000, 44100, 48000, 96000
  Interface 2
    Altset 2
    Format: S24_3LE
    Channels: 2
    Endpoint: 2 IN (ADAPTIVE)
    Rates: 8000, 16000, 32000, 44100, 48000, 96000

I changed from ALSA to PulseAudio in mpd.conf but that didn't change anything. How can I see the details of every Pulseaudio stream currently active? (pavucontrol doesn't give much details)



Edit: MPD doesn't look good, output from pacmd:

1 sink input(s) available.
    index: 5669
	driver: <protocol-native.c>
	flags: 
	state: RUNNING
	sink: 0 <alsa_output.usb-Binary_Audio_UAC1_DAC-01-DAC.analog-stereo>
	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
	        balance 0.00
	muted: no
	current latency: 245.00 ms
	requested latency: 100.00 ms
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	resample method: speex-float-1
	module: 13
	client: 51 <Music Player Daemon>
	properties:
		media.name = "My Pulse Output"
		application.name = "Music Player Daemon"
		native-protocol.peer = "UNIX socket client"
		native-protocol.version = "29"
		media.role = "music"
		application.icon_name = "mpd"
		application.process.id = "14017"
		application.process.user = "fackamato"
		application.process.host = "fackamato-fat"
		application.process.binary = "mpd"
		application.language = "C"
		window.x11.display = ":0"
		application.process.machine_id = "500bf114da244dde9f56c511268de1e6"
		application.process.session_id = "c1"
		module-stream-restore.id = "sink-input-by-media-role:music"

Last edited by Fackamato (2014-12-07 14:30:49)

Offline

#2 2014-12-07 14:30:44

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,999
Website

Re: How do I make 24/96 is used for all audio playback?

I think you can use options in mpd.conf to force the output:

audio_output_format "96000:24:2"

Jin, Jîyan, Azadî

Offline

#3 2014-12-07 14:32:45

Fackamato
Member
Registered: 2006-03-31
Posts: 579

Re: How do I make 24/96 is used for all audio playback?

Head_on_a_Stick wrote:

I think you can use options in mpd.conf to force the output:

audio_output_format "96000:24:2"

Thanks, I tried it to no effect (I think it applies to ALSA only? I don't think MPD can resample its output?)

1 sink input(s) available.
    index: 1
	driver: <protocol-native.c>
	flags: 
	state: RUNNING
	sink: 0 <alsa_output.usb-Binary_Audio_UAC1_DAC-01-DAC.analog-stereo>
	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
	        balance 0.00
	muted: no
	current latency: 235.95 ms
	requested latency: 100.00 ms
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	resample method: speex-float-10
	module: 13
	client: 4 <Music Player Daemon>
	properties:
		media.name = "My Pulse Output"
		application.name = "Music Player Daemon"
		native-protocol.peer = "UNIX socket client"
		native-protocol.version = "30"
		media.role = "music"
		application.icon_name = "mpd"
		application.process.id = "30308"
		application.process.user = "fackamato"
		application.process.host = "fackamato-fat"
		application.process.binary = "mpd"
		application.language = "C"
		window.x11.display = ":0"
		application.process.machine_id = "500bf114da244dde9f56c511268de1e6"
		application.process.session_id = "c3"
		module-stream-restore.id = "sink-input-by-media-role:music"

Offline

#4 2014-12-07 15:02:58

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: How do I make 24/96 is used for all audio playback?

mpd does resample its output.
the audio_output block has an option called format. http://www.musicpd.org/doc/user/config_ … tputs.html

But it shouldn't even be needed. Just set pulse's samplerate and alternative samplerate to the same value.
Pulse should then resample every incoming stream.
Problem with your 48000 alternative setting is that single apps (e.g. a browser) can play a stream at 48000 which will force any other application
to be played at 48000 too. (its needed to play all streams at the same samplerate otherwise you couldnt hear them at the same time)

Last edited by Rasi (2014-12-07 15:04:45)


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

Board footer

Powered by FluxBB