Re: The rate parameter in asound.conf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeffrey Barish wrote:
> I have some sound files which were playing at the wrong sample rate (the pitch
> was about a step high and the speed was elevated).  The sample rate of the
> files is 88.2 kHz.  I believe that they were playing at 96 kHz, judging from
> the pitch error.  My output device is HDA Intel PCH.
>
> I found that I could fix the problem by augmenting my /etc/asound.conf file with
> a rate specification:
>
> pcm.!default {
>     type hw
>     card 0
>     rate 192000
> }
>
> However, I do not understand what this change actually does.

That device now claims that its only supported rate is 192 kHz.

> When I play one  of the sound files now and then do
>
> cat /proc/asound/card0/pcm0p/sub0/hw_params
>
> I see that rate is 192000.  In fact, I see that same value for rate regardless
> of the sample rate of the sound file.

When a player program tries to play something with another rate, it must
choose between aborting with an error, or resampling to that rate.

> I understood that "type hw" meant that ALSA would send a file directly
> to the sound device without any processing, so why is the conversion
> happening and where?

If you had a "plughw" device, ALSA would be able to do the resampling.
With "hw", the player program must use its own resampler (if it has one).

> When I run the command
>
> speaker-test -D hw:CARD=PCH,DEV=0 -c2 -r 48000
>
> the sample rate that I read in hw_params corresponds to the value I specify in
> the command -- except when I specify 88200, which produces an "invalid
> argument" error.

Strange.

What is the output of this command:

  aplay -D hw:0 -t raw -f dat -r 88200 -d 3 -v /dev/zero


Regards,
Clemens

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user




[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux