Skip to main content
Topic: High quality audio - no Pulse audio (Read 2628 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

High quality audio - no Pulse audio

Hello, and thank you in advance.

 I have been installing Artix XFCE S - 6.
 How to add high quality settings like this

Quote
default-sample-format = float32le
; alternate-sample-format = s24le
; default-sample-rate = 192000
; alternate-sample-rate = 96000
; default-sample-channels = 2
; default-channel-map = front-left,front-right
It's from period when I used pulseaudio.
 How to check which is my current sample format and sample rate in Alsa ? Thank you.


Re: High quality audio - no Pulse audio

Reply #2
Ok, but I don't know where to enter such parameters: default-sample-format = float32le ?
 For example, there is

defaults.pcm.dmix.rate 48000
defaults.pcm.dmix.format unchanged
defaults.pcm.dmix.card defaults.pcm.card


But no default and alternate sample rate.
 Link that you provided is about systemd and pulseaudio.

https://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html
I have installed alsa-plugins, but I don't know what to do next, in order to change bit depth, sample rate and default sample channels.
 How to check if file that I am playing, is played with correct bit depth ?
 

Re: High quality audio - no Pulse audio

Reply #3
Ok, but I don't know where to enter such parameters: default-sample-format = float32le ?
Sorry for giving you false hope.
I use alsa without looking much further.
However, I read this:

Quote
Alsa by default uses the same sampling rate and format as the source. It is however possible to force the sample rate up (or down).

Here is one way you could do it. (in /etc/asound.conf or ~/.asoundrc)

Code: [Select]
pcm.device{
        format S24_LE
        rate 96000
        type hw
        card 0
        device 0
}
https://unix.stackexchange.com/questions/74558/change-sampling-rate-in-alsa


Quote
Link that you provided is about systemd and pulseaudio.
Sorry  :-[

Quote
https://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html
I have installed alsa-plugins, but I don't know what to do next, in order to change bit depth, sample rate and default sample channels.
 How to check if file that I am playing, is played with correct bit depth ?
From what I understood we can define the conversion format in in /etc/asound.conf or ~ /.asoundrc
It is probably not useful to use plugins.

Sorry I couldn't tell you more, but here are two more threads worth reading:
https://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html
https://community.blokas.io/t/any-way-to-get-a-better-format-than-16bit-when-opening-an-output-in-alsa-with-sdl/1353/7



Re: High quality audio - no Pulse audio

Reply #4
In case someone is interested

cat /proc/asound/card1/pcm0p/sub0/hw_params


 (Change parameters according to your card)
 It displays current file, current bit depth and sample rate.

 It displays 32 bit and 48.000, no matter what I have been playing.
 It seems that S - 6 installed pipewire for me (??).
 

Re: High quality audio - no Pulse audio

Reply #5
I have to wonder why you want to set your sample rate this way when the standard for quality audio is 44.1 kHz and 48 kHz.

ALSA will default to 48 kHz for mixing purposes and use dmix with a possibly sub-standard process.

edit:

You can configure your music player to use direct device output, bypassing ALSA's resampling. This achieves easy and bit-perfect playback at the source samplerate, if your card supports it. In mpd, this segment of the configuration looks like:

Code: [Select]
audio_output {
      type   "alsa"
      name   "alsa"
      device "hw:0,0"
      auto_resample "no"
}

You won't play other audio sources simultaneously since there's no mixing being done. This is with the music player. Everything else will be resampled at the default 48kHz. Then in ~/.asoundrc, change the means that ALSA uses to resample (sox, speex, libsamplerate, etc) for best overall quality in other applications.

 

Re: High quality audio - no Pulse audio

Reply #6
I have many vinyl rips in 24 bit and in 96.000 and more hz.
 You mean that I should enter that in asoundrc ?
 Where I can find current bitrate and sample rate ?
 Is this correct ?
cat /proc/asound/card1/pcm0p/sub0/hw_params
 Thank you,

Re: High quality audio - no Pulse audio

Reply #7
I have many vinyl rips in 24 bit and in 96.000 and more hz.
You mean that I should enter that in asoundrc ?

My example shows an mpd configuration. It's configured in the music player you use, but the idea is the same - change output to hardware device.
 
Quote
Where I can find current bitrate and sample rate ?
Is this correct ?
cat /proc/asound/card1/pcm0p/sub0/hw_params

Yes.  Globbing may give more info (eg. `cat /proc/asound/card*/pcm*p/sub*/hw_params`). You want to see the sample rate adjusting per the source material.