You are not logged in.

#1 2023-01-27 21:42:37

9acca9
Member
Registered: 2017-02-03
Posts: 51

Alsa settings? and Pulseaudio.

Hi. I want to know if i can know the bits and khz from the sound playing with Alsa?
This is fine to know it?

cat /proc/asound/card0/pcm0p/sub0/hw_params

But, Alsa make resampling? i just want that what im playing goes to the soundcard without any modification.

For example i believe that with pulseaudio you can resample, etc. That is posible with Alsa?

I mean if the music is 24bit and 192khz exactly like that is how the operative system is sending. For example i have this with the cat hw_params

access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 96000 (96000/1)
period_size: 960
buffer_size: 19200

this is 24bit??? and 96khz?

Im asking this because in some operative system when i want "good audio quality" i have to make some changes in pulse audio daemon file. But, if i just have ALSA, i need to do something?

Last edited by 9acca9 (2023-01-27 21:53:24)

Offline

#2 2023-01-27 22:05:23

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Alsa settings? and Pulseaudio.

ALSA resamples to 48KHz by default.

I use this ~/.asoundrc to stop resampling:

pcm.Digital {
   type hw
   card A20
}

ctl.!default {
   type hw
   card A20
}

pcm.!default {
   type plug
   slave {
      pcm "Digital"
      rate "unchanged"
   }
}

That example is for a(n asynchronous) USB-attached audiolab M-DAC+ that is identified as "A20" in /proc/asound/cards.

EDIT: sorry, I didn't read the question properly. I'm a bit distracted atm. I wouldn't trust software resampling to improve the sound in any way, although there are many guides that claim otherwise.

Last edited by Head_on_a_Stick (2023-01-27 22:10:57)


Jin, Jîyan, Azadî

Offline

#3 2023-01-27 22:27:57

9acca9
Member
Registered: 2017-02-03
Posts: 51

Re: Alsa settings? and Pulseaudio.

Hi.
I have this in asound.conf:

pcm.!default {
  type hw card 0
}
ctl.!default {
  type hw card 0
}

so i need to change to this?

pcm.Digital {
   type hw card 0
}
ctl.!default {
  type hw card 0
}
pcm.!default {
  type hw	
  slave {
      pcm "Digital"
      rate "unchanged"
   }
}

And so, even if im seen that in cat /proc/asound/card0/pcm0p/sub0/hw_params im not really getting the original audio?
Thanks!

Last edited by 9acca9 (2023-01-27 22:47:11)

Offline

#4 2023-01-27 22:57:57

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Alsa settings? and Pulseaudio.

That "card 0" identifier might not be reliable. Use the name given in the square brackets in /proc/asound/cards. Not sure about that hw_params file though, sorry. There are other members here with a better grasp of audio stuff than me. I only know enough to get my fancy DAC working.

Last edited by Head_on_a_Stick (2023-01-27 23:06:24)


Jin, Jîyan, Azadî

Offline

#5 2023-01-27 23:28:42

9acca9
Member
Registered: 2017-02-03
Posts: 51

Re: Alsa settings? and Pulseaudio.

mmm, yep card 0 is not working with your config, and if i change to what i have here:

cat /proc/asound/cards
 0 [IQaudIODAC     ]: IQaudIODAC - IQaudIODAC
                      IQaudIODAC

"card IQaudIODAC" or just "IQaudIODAC"... also dont work.
mmmmm

Offline

#6 2023-01-27 23:57:09

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Alsa settings? and Pulseaudio.

I think it should be "card IQaudIODAC". Does the card accept a PCM (digital) input? The "DAC" in the name suggests so.


Jin, Jîyan, Azadî

Offline

#7 2023-01-28 01:15:09

9acca9
Member
Registered: 2017-02-03
Posts: 51

Re: Alsa settings? and Pulseaudio.

Hi. Now is working with your config. But, i get almost the same in hw_params that at the beginning. (almost the same, and the same...)

With a song of 24bit 192Khz i get this:

cat /proc/asound/IQaudIODAC/pcm0p/sub0/hw_params 
access: MMAP_INTERLEAVED
format: S24_LE
subformat: STD
channels: 2
rate: 192000 (192000/1)
period_size: 1920
buffer_size: 38400

With a song with 16bit 44Khz i get this:

cat /proc/asound/IQaudIODAC/pcm0p/sub0/hw_params 
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 441
buffer_size: 8820

The difference with the first of my post is this, with 24 bit 192khz:

access: MMAP_INTERLEAVED

But, with the 16bit 44khz, that difference is not consistent, i get:

access: RW_INTERLEAVED

mmmmm

EDIT: " Plugin: hw. This plugin communicates directly with the ALSA kernel driver. It is a raw communication without any conversions. The emulation of mmap access can be optionally enabled, but expect worse latency in the case."   mmmmmmm

Last edited by 9acca9 (2023-01-28 01:38:23)

Offline

Board footer

Powered by FluxBB