[alsa-devel] [usb-audio] M-Audio FastTrack Pro giving invalid sample rates
Thibault Le Meur
Thibault.LeMeur at supelec.fr
Wed Nov 28 10:33:57 CET 2007
Lasse Kärkkäinen a écrit :
> Resending because nobody reacted the last time. This is still broken
> with 2.6.23.1, except for the fact that it doesn't seem to be possible
> to adjust bConfigurationValue anymore (this is not exposed under sysfs
> at least on my system), so I am stuck with configuration 1.
>
Peter Oehry once proposed a fix for this device and I think it is not
applied to HG yet (but I may be wrong): see thread "snd-usb-audio -
Driver for M-Audio Fast Track Pro".
The proposed patch is attached: I don't know if it would fix the issue
you're describing.
But one interesting comment may explain why it may have not been applied:
<quote>
+» » » /*·This·function·has·to·be·available·by·the·usb·core·module.·
+» » » ···if·it·is·not·avialable·the·boot·quirk·has·to·be·left·out·and·the
+» » » ···configuration·has·to·be·set·by·udev·or·hotplug·rules·*/
+» » » err=usb_driver_set_configuration(dev,2);
</quote>
I don't have this device and can't help more than that, sorry.
HTH,
Thibault
> Original message follows:
>
>
> This bug has been around for years...
>
> ALSA seems to think that the card supports a wide range of sampling
> rates, but it does not manage to set them in practice. I do not know
> which is faulty, ALSA rate setting or the USB info sent by the device,
> but the problem needs to be fixed.
>
> I did some measurements with the alsarate program, attached to my other
> post (subject: ALSA C++ API).
>
> Using bConfigurationValue=1 and measuring the actual rate with alsarate,
> I get
>
>
>>>> Testing playback
>>>>
> Opening ALSA device hw:0,1 at 44100 Hz.
> Got 44100 Hz, 2 channels, period 1.02 ms.
> 96.27 seconds, measured rate 45807 Hz.
>
>>>> Testing capture
>>>>
> Opening ALSA device hw:0,1 at 44100 Hz.
> Got 44100 Hz, 2 channels, period 1.02 ms.
> 97.29 seconds, measured rate 45330 Hz.
>
> As expected, 44.1 kHz works. The measured rate seems a bit higher than
> it should be, but I assume that this is an alsarate inaccuracy rather
> than an actual phenomenon.
>
>
>>>> Testing playback
>>>>
> Opening ALSA device hw:0,1 at 48000 Hz.
> Got 44100 Hz, 2 channels, period 1 ms.
> 96.27 seconds, measured rate 45808 Hz.
>
>>>> Testing capture
>>>>
> Opening ALSA device hw:0,1 at 48000 Hz.
> Got 48000 Hz, 2 channels, period 1 ms.
> 105.89 seconds, measured rate 45330 Hz.
>
> Using 48 kHz for playback is not possible, the
> snd_pcm_hw_params_rate_near returns a new rate of 44.1 kHz. This is all
> fine and the measured rate still is around 44.1 kHz as it should.
>
> In the capture part, we see the first problem: rate_near returned 48
> kHz, but the measured value hasn't changed. So, the application thinks
> that it is recording at 48 kHz, but ALSA only gives it data at 44.1 kHz.
> This is a bug in ALSA.
>
>
>>>> Testing playback
>>>>
> Opening ALSA device hw:0,1 at 8000 Hz.
> Got 44100 Hz, 2 channels, period 1.02 ms.
> 96.27 seconds, measured rate 45808 Hz.
>
>>>> Testing capture
>>>>
> Opening ALSA device hw:0,1 at 8000 Hz.
> Got 8000 Hz, 2 channels, period 2 ms.
> 17.66 seconds, measured rate 45309 Hz.
>
> Trying to use 8 kHz yields similar results to the 48 kHz test. No
> problems with playback, but the capture part reports that it is using 8
> kHz, even though it really uses 44.1 kHz.
>
>
>>>> Testing playback
>>>>
> Opening ALSA device hw:0,1 at 96000 Hz.
> Got 44100 Hz, 2 channels, period 1.02 ms.
> 96.27 seconds, measured rate 45808 Hz.
>
>>>> Testing capture
>>>>
> Opening ALSA device hw:0,1 at 96000 Hz.
> Got 48000 Hz, 2 channels, period 1 ms.
> 105.89 seconds, measured rate 45330 Hz.
>
> 96 kHz makes little difference. Now the capture rate is reported to be
> 48 kHz, but the actual rates are still always 44.1 kHz.
>
>
> That was all done using the default configuration. When using the other
> configuration, bConfigurationValue=2, the following results are gathered:
>
>
>>>> Testing playback
>>>>
> Opening ALSA device hw:0,1 at 44100 Hz.
> Got 44100 Hz, 2 channels, period 1.02 ms.
> 96.27 seconds, measured rate 45808 Hz.
>
>>>> Testing capture
>>>>
> Opening ALSA device hw:0,1 at 44100 Hz.
> Got 44100 Hz, 2 channels, period 1.02 ms.
> 97.29 seconds, measured rate 45330 Hz.
>
> 44.1 kHz is identical to that in the other configuration.
>
>
>>>> Testing playback
>>>>
> Opening ALSA device hw:0,1 at 48000 Hz.
> Got 48000 Hz, 2 channels, period 1 ms.
> 96.29 seconds, measured rate 49849 Hz.
>
>>>> Testing capture
>>>>
> Opening ALSA device hw:0,1 at 48000 Hz.
> Got 48000 Hz, 2 channels, period 1 ms.
> 97.29 seconds, measured rate 49339 Hz.
>
> 48 kHz now works properly for both playback and capture (note: measured
> rate over 49 kHz, but the measurements displaying about 1.5 kHz too high
> is consistent).
>
>
>>>> Testing playback
>>>>
> Opening ALSA device hw:0,1 at 8000 Hz.
> Got 8000 Hz, 2 channels, period 2 ms.
> 15.89 seconds, measured rate 50336 Hz.
>
>>>> Testing capture
>>>>
> Opening ALSA device hw:0,1 at 8000 Hz.
> Got 8000 Hz, 2 channels, period 2 ms.
> 16.22 seconds, measured rate 49313 Hz.
>
> 8 kHz still doesn't work. ALSA reports that it does, but in reality
> gives 48 kHz (within the bounds of the measurement accuracy).
>
>
>>>> Testing playback
>>>>
> Opening ALSA device hw:0,1 at 96000 Hz.
> Got 48000 Hz, 2 channels, period 1 ms.
> 96.29 seconds, measured rate 49849 Hz.
>
>>>> Testing capture
>>>>
> Opening ALSA device hw:0,1 at 96000 Hz.
> Got 48000 Hz, 2 channels, period 1 ms.
> 97.29 seconds, measured rate 49339 Hz.
>
> 96 kHz works kinda like it should, except for the fact that the hardware
> should support that rate as well.
>
>
> Summa summarum:
>
> Config 1 only uses 44.1 kHz, but claims to support 8-48 kHz on capture.
> Config 2 only uses 44.1 and 48 kHz, but claims to support 8-48 kHz on
> both capture and playback.
>
> The card in reality, according to specs, supports up to 96 kHz.
> According to lspci (attached), it supports everything within the 8-96
> kHz range.
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel at alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FastTrackPro.patch
Type: text/x-patch
Size: 3530 bytes
Desc: not available
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20071128/1f0c1e8b/attachment-0001.patch
More information about the Alsa-devel
mailing list