From owner-freebsd-multimedia@FreeBSD.ORG Wed Apr 27 01:27:43 2011 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71092106566C for ; Wed, 27 Apr 2011 01:27:43 +0000 (UTC) (envelope-from marcelbonnet@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 40DBB8FC14 for ; Wed, 27 Apr 2011 01:27:43 +0000 (UTC) Received: by pvg11 with SMTP id 11so1147757pvg.13 for ; Tue, 26 Apr 2011 18:27:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=MylfSy3JV23+ZgnUYvWIU/TbeYpl8OjWe9lvuj0PuMA=; b=u3pEz+63Gusva3EOn+l3zFNasL9Ja3gdPq1g7MbwbipEsf0zlD4CGocsezeHwpypl3 1kcB5Bxv8I3otiMFc1JsqrDO7buohtDUyThFxPSpSjcwol+tkXYuxcM5ozy9T55QiHTU YWVMsdkwcD17mK+HALuWdv23PDwHVeYr3Ur4E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=wc44qAEfOJknXi4IHvvCMmXWJw9Uf3pWdHGIBUZYFjr251nEJCU/XwNIIjcv0EhH5x cWYY9WvOtk06Q4IAGvzEt3rbPihmspe1YAa6fzkGOxiQ6PzYRgx5GoUjyPTiWhoaGQfV y5qIJ/auwTQOPmqpV1ennb7RL7HSDEQQHoBpU= MIME-Version: 1.0 Received: by 10.68.19.3 with SMTP id a3mr1680175pbe.201.1303867662730; Tue, 26 Apr 2011 18:27:42 -0700 (PDT) Received: by 10.68.58.231 with HTTP; Tue, 26 Apr 2011 18:27:42 -0700 (PDT) In-Reply-To: <201104261047.01454.hselasky@c2i.net> References: <4DB67DED.1030906@ladisch.de> <201104261047.01454.hselasky@c2i.net> Date: Tue, 26 Apr 2011 22:27:42 -0300 Message-ID: From: Marcel Bonnet To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-multimedia@freebsd.org, Clemens Ladisch Subject: Re: uaudio, M-Audio FastTrack Pro device - sound distorted X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2011 01:27:43 -0000 On 26 April 2011 05:47, Hans Petter Selasky wrote: > On Tuesday 26 April 2011 10:10:21 Clemens Ladisch wrote: > > Marcel Bonnet wrote: > > > I'm using the M-AUDIO FastTrack Pro USB audio interface, but every time > I > > > play or record, the sound get distorted. > > > > > > uaudio0: Play: 44100 Hz, 2 ch, 16-bit S-LE PCM format > > > uaudio0: Record: 48000 Hz, 2 ch, 16-bit S-LE PCM format > > > > This device uses one internal sample rate; using different rates for the > > playback and capture interfaces won't work. > > > > AFAIK there are some undocumented constraints on which configurations > > and alternate settings can be used; and in some alternate settings, the > > device uses big-endian samples. This cannot be handled with the generic > > parts of the uaudio driver; it requires device-specific workarounds. > > > > There is an outdated patch that tries to make this device work on Linux > > on this page: > https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3249 > > > > > > Try to set: > > sysctl hw.usb.uaudio.default_rate=44100 > > Then replug the device. > > We could possible make a workaround for this. > Hey, that worked!! (guys, sorry for taking much time for responding, too much busy these days) Thanks, Hans Petter. I made 4 tests for keeping record of the way your trick works, hope it's usefull: (the trick #3 was the best 'cause I don't need to configure every boot) 1) NICE TRICK System booted with snd_uaudio_load="YES" M-AUDIO USB Device is disconnected (turned off) $ sysctl hw.usb.uaudio hw.usb.uaudio.default_channels: 0 hw.usb.uaudio.default_bits: 32 hw.usb.uaudio.default_rate: 0 hw.usb.uaudio.debug: 0 $ sudo sysctl hw.usb.uaudio.default_rate=44100 hw.usb.uaudio.default_rate: 0 -> 44100 M-AUDIO USB Device is now connected $ audacious The same MP3 (128kbps 44100 Hz) now played very clean. Sounds perfect. Closed the application. $ sudo sysctl hw.usb.uaudio.default_rate=0 hw.usb.uaudio.default_rate: 44100 -> 0 $ audacious The same MP3 still playing perfect. Closed the application. 2) NICE TRICK Another test, but the system maintains the last statet (not rebooted) M-AUDIO USB Device was disconnect (turned off) $ audacious The same MP3 sounds distorted. Closed the application. $ sudo sysctl hw.usb.uaudio.default_rate=44100 hw.usb.uaudio.default_rate: 0 -> 44100 $ audacious The same MP3 sounds distorted. Closed the application. 3) NICE TRICK System rebooted with snd_uaudio_load="YES" M-AUDIO USB Device is connected (powered on) Added entry to /boot/loader.conf: hw.usb.uaudio.default_rate=44100 $ dmesg | grep uaudio uaudio0: on usbus0 uaudio0: Play: 44100 Hz, 2 ch, 16-bit S-LE PCM format uaudio0: Record: 44100 Hz, 2 ch, 16-bit S-LE PCM format uaudio0: MIDI sequencer pcm0: on uaudio0 * without setting the default_rate the device announces itself as 44100 Hz for playback, 48000 for recording $ sysctl hw.usb.uaudio hw.usb.uaudio.default_channels: 0 hw.usb.uaudio.default_bits: 32 hw.usb.uaudio.default_rate: 44100 hw.usb.uaudio.debug: 0 $ audacious The same MP3 still playing perfect. Closed the application. 4) THE PROBLEM * The same happens if I don't change the default_rate. System rebooted with snd_uaudio_load="YES" M-AUDIO USB Device is connected (powered on) $ sysctl hw.usb.uaudio hw.usb.uaudio.default_channels: 0 hw.usb.uaudio.default_bits: 32 hw.usb.uaudio.default_rate: 0 hw.usb.uaudio.debug: 0 $ sudo sysctl hw.usb.uaudio.default_rate=44100 hw.usb.uaudio.default_rate: 0 -> 44100 $ audacious The same MP3 sounds distorted. Closed the application. -- Marcel Bonnet > > --HPS > * *