Ubuntu

[USB-Audio - FastTrack Pro, recording] No sound at all

Reported by Martin Kaistra on 2013-01-02
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Undecided
David Henningsson

Bug Description

Since I upgraded to 12.04 Precise recording via the M-Audio Fast Track Pro does not work anymore. I tested with and without pulseaudio, so I believe this is a bug in alsa.
(There is another bug with the Fast Track Pro: https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/964461 https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/998331, that the device isn't loaded correctly at all, but even if I can see it in arecord -L or pavucontrol I get no sound input from this device)

If there is any more information you need, just let me know.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: alsa-base 1.0.25+dfsg-0ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-35.55-generic 3.2.34
Uname: Linux 3.2.0-35-generic x86_64
AlsaVersion:
 Advanced Linux Sound Architecture Driver Version 1.0.25.
 Compiled on Jan 2 2013 for kernel 3.2.0-35-generic (SMP).
ApportVersion: 2.0.1-0ubuntu15.1
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC1: martin 3740 F.... gnome-alsamixer
 /dev/snd/controlC0: martin 3725 F.... audacity
                      martin 3740 F.... gnome-alsamixer
                      martin 4081 F.... pulseaudio
Card0.Amixer.info:
 Card hw:0 'PCH'/'HDA Intel PCH at 0xf2520000 irq 23'
   Mixer name : 'Intel CougarPoint HDMI'
   Components : 'HDA:14f1506e,17aa21cf,00100002 HDA:14f12c06,17aa2122,00100000 HDA:80862805,80860101,00100000'
   Controls : 46
   Simple ctrls : 14
Card1.Amixer.info:
 Card hw:1 'Pro'/'M-Audio FastTrack Pro at usb-0000:00:1a.0-1.1, full speed'
   Mixer name : 'USB Mixer'
   Components : 'USB0763:2012'
   Controls : 2
   Simple ctrls : 0
Card1.Amixer.values:

Date: Wed Jan 2 15:29:53 2013
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
MarkForUpload: True
PackageArchitecture: all
SourcePackage: alsa-driver
Symptom: audio
Symptom_AlsaRecordingTest: ALSA recording test through plughw:Pro failed
Symptom_Card: M-Audio Fast Track Pro - FastTrack Pro
Symptom_DevicesInUse:
 3740 3725 3740 4081 martin F.... gnome-alsamixer
 /dev/snd/controlC0: martin F.... audacity
                      martin F.... gnome-alsamixer
                      martin F.... pulseaudio
Symptom_Type: No sound at all
Title: [USB-Audio - FastTrack Pro, recording] No sound at all
UpgradeStatus: Upgraded to precise on 2012-12-30 (2 days ago)
dmi.bios.date: 11/24/2011
dmi.bios.vendor: LENOVO
dmi.bios.version: 8AET55WW (1.35 )
dmi.board.asset.tag: Not Available
dmi.board.name: 4242PT4
dmi.board.vendor: LENOVO
dmi.board.version: Not Available
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: Not Available
dmi.modalias: dmi:bvnLENOVO:bvr8AET55WW(1.35):bd11/24/2011:svnLENOVO:pn4242PT4:pvrThinkPadT520:rvnLENOVO:rn4242PT4:rvrNotAvailable:cvnLENOVO:ct10:cvrNotAvailable:
dmi.product.name: 4242PT4
dmi.product.version: ThinkPad T520
dmi.sys.vendor: LENOVO

Martin Kaistra (djfun) wrote :
Raymond (superquad-vortex2) wrote :

http://cgit.freedesktop.org/pulseaudio/pulseaudio/log/src/modules/alsa/mixer/profile-sets/maudio-fasttrack-pro.conf

if it work with pulseaudio 0.9.x version
you have to send email to the author of these patches and the pulseaudio mailing list why it fail at pulseaudio 2.0

Raymond (superquad-vortex2) wrote :

22.631445] thinkpad_acpi: disagrees about version of symbol snd_ctl_add
[ 22.631449] thinkpad_acpi: Unknown symbol snd_ctl_add (err -22)
[ 22.631506] thinkpad_acpi: disagrees about version of symbol snd_card_register
[ 22.631509] thinkpad_acpi: Unknown symbol snd_card_register (err -22)
[ 22.631516] thinkpad_acpi: disagrees about version of symbol snd_card_free
[ 22.631518] thinkpad_acpi: Unknown symbol snd_card_free (err -22)
[ 22.631546] thinkpad_acpi: disagrees about version of symbol snd_ctl_new1
[ 22.631548] thinkpad_acpi: Unknown symbol snd_ctl_new1 (err -22)
[ 22.631571] thinkpad_acpi: disagrees about version of symbol snd_ctl_boolean_mono_info
[ 22.631573] thinkpad_acpi: Unknown symbol snd_ctl_boolean_mono_info (err -22)
[ 22.631598] thinkpad_acpi: disagrees about version of symbol snd_ctl_notify
[ 22.631600] thinkpad_acpi: Unknown symbol snd_ctl_notify (err -22)
[ 22.631649] thinkpad_acpi: disagrees about version of symbol snd_card_create
[ 22.631652] thinkpad_acpi: Unknown symbol snd_card_create (err -22)

Martin Kaistra (djfun) wrote :

Thanks! With device-strings = hw:%f,1,0 in my maudio-fasttrack-pro.conf it works now. In earlier versions of Ubuntu I needed the hw:%f,0,0 hw:%f,1,0 from the patch of David Henningsson. I will send him an email about it.

Martin Kaistra (djfun) wrote :

One other question: is the maudio-fasttrack-pro.conf being used by alsa or why could I not record with deactivated pulseaudio?

David Henningsson (diwic) wrote :

> With device-strings = hw:%f,1,0 in my maudio-fasttrack-pro.conf it works now.

So, first it was "hw:%f,0,0", then it became "hw:%f,0,0 hw:%f,1,0" and now you're proposing we change it to just "hw:%f,1,0", is that correct?

What I'm afraid of is that there might be more than one model out there, and that if we fix one we break another. Or maybe it's different depending on what mode (different inputs?) the device is currently in?

> is the maudio-fasttrack-pro.conf being used by alsa

No. But PulseAudio is sometimes used by alsa, so many alsa programs by default route their audio through pulseaudio.

Martin Kaistra (djfun) wrote :

> So, first it was "hw:%f,0,0", then it became "hw:%f,0,0 hw:%f,1,0" and now you're proposing we change it to just "hw:%f,1,0", is that correct?

The older 2 versions "hw:%f,0,0" and "hw:%f,0,0 hw:%f,1,0" at least do not work here for me in Ubuntu 12.04 Precise. I can test these 2 with a USB live system of Ubuntu 11.10 with an older pulseaudio and alsa version, maybe there were some changes..

In 2010 I needed the "hw:%f,0,0 hw:%f,1,0" with the same device, so my assumption was, that it is not the device, that has changed, but as I cannot see inside, I might be mistaken.

David Henningsson (diwic) wrote :

I'm suspecting that ,0,0 records from SPDIF in your case and ,1,0 from analog. If so we could just try ,1,0 first and then ,0,0, i e the string becomes "hw:%f,1,0 hw:%f,0,0"

The question is if it is the other way around for other Fasttrack Pro devices, so this would regress behaviour for them. It would be good with confirmation from at least two more device owners before changing this.

Martin Kaistra (djfun) wrote :

After I read a bit through the changes Raymond linked in #9, I downloaded a snapshot of the alsa sources, changed the function
static int snd_usb_fasttrackpro_boot_quirk(struct usb_device *dev) in sound/usb/quirks.c to always return 0, compiled and installed alsa. Then, after reloading the snd-usb-audio module I detected that my Fast Track Pro was now functioning the way it was in Ubuntu Oneiric:
With both analog inputs working
Without problems when connecting it to the computer like in https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/964461 and https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/998331)

When I reverted my changes to quirks.c and compiled, installed and reloaded snd-usb-audio again, the problems started again!

So I think one should have a closer look at those changes..

Raymond (superquad-vortex2) wrote :

you have to send email to the author of the patch

i think the usage of the parameter device_setup should be put in

http://git.kernel.org/?p=linux/kernel/git/tiwai/sound.git;a=blob;f=Documentation/sound/alsa/ALSA-Configuration.txt;h=b9cfd339a6fa3d4e89cebb3316e5152f9ff0d252;hb=HEAD

and 0x80 is not documented

David Henningsson (diwic) wrote :

Looking a bit at the snd_usb_fasttrackpro_boot_quirk function, it calls usb_driver_set_configuration, which has the following comment:

  * Device interface drivers are not allowed to change device configurations.
  * This is because changing configurations will destroy the interface the
  * driver is bound to and create new ones; it would be like a floppy-disk
  * driver telling the computer to replace the floppy-disk drive with a
  * tape drive!

And then goes on that in special circumstances it might be needed anyway. So; it sounds like this creates a race somehow.

I'm not sure why we want to switch to configuration "2" in the first place, but if we are, it would make sense not to continue making the actual card but just quit out as early as possible.

What if we made the function return an error instead? Could you try the attached patch and see if it helps?

Also, could you attach the output of lsusb -v for completeness?

Thanks!

Martin Kaistra (djfun) wrote :

The patch works. I get sound from the analog inputs when I have device-strings = hw:%f,1,0 hw:%f,0,0 or only hw:%f,1,0 in my maudio-fasttrack-pro.conf now.

I'll attach the output in syslog after the patch and the output of lsusb -v

Martin Kaistra (djfun) wrote :
Martin Kaistra (djfun) wrote :
tags: added: patch

A patch in the 3.2 kernel caused regression with hotplugging the
M-Audio Fast track pro, or sound after suspend. I don't have the
device so I haven't done a full analysis, but it seems userspace
(both udev and pulseaudio) got confused when a card was created,
immediately destroyed, and then created again.

However, at least one person in the bug report (martin djfun)
reports that this patch resolves the issue for him. It also leaves
a message in the log:
"snd-usb-audio: probe of 1-1.1:1.1 failed with error -5" which is
a bit misleading. It is better than non-working audio, but maybe
there's a more elegant solution?

BugLink: https://bugs.launchpad.net/bugs/1095315
Signed-off-by: David Henningsson <email address hidden>
---
 sound/usb/quirks.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

...oh, and if you end up taking this patch as it is, you should probably
add cc to stable (3.2+).

diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index acc12f0..e71fc8b 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -387,11 +387,13 @@ static int snd_usb_fasttrackpro_boot_quirk(struct usb_device *dev)
    * rules
    */
   err = usb_driver_set_configuration(dev, 2);
- if (err < 0) {
+ if (err < 0)
    snd_printdd("error usb_driver_set_configuration: %d\n",
         err);
- return -ENODEV;
- }
+ /* Always return an error, so that we stop creating a device
+ that will just be destroyed and recreated with a new
+ configuration */
+ return -ENODEV;
  } else
   snd_printk(KERN_INFO "usb-audio: Fast Track Pro config OK\n");

--
1.7.9.5

David Henningsson wrote:
> this patch resolves the issue for him. It also leaves a message
> in the log:
> "snd-usb-audio: probe of 1-1.1:1.1 failed with error -5"

I'd guess this is for an interface not claimed by the driver but
without an explicit QUIRK_IGNORE_INTERFACE entry.

Regards,
Clemens

David Henningsson (diwic) wrote :

On 01/04/2013 09:19 PM, Clemens Ladisch wrote:
> David Henningsson wrote:
>> this patch resolves the issue for him. It also leaves a message
>> in the log:
>> "snd-usb-audio: probe of 1-1.1:1.1 failed with error -5"
>
> I'd guess this is for an interface not claimed by the driver but
> without an explicit QUIRK_IGNORE_INTERFACE entry.

My patch causes this error because the quirk fails with an error, which
is later on turned into a -EIO. Any quirk_ignore_interface entry will
therefore be ignored. Using the quirk_ignore_interface entry *instead
of* my patch seems like an interesting option, but...

Looking at the code again, it seems like we have a more generic race
problem, unless I'm missing something:

  - the same ALSA sound card can contain more than one USB interface.
  - snd_card_register is called whenever a USB interface finishes probing.
  - snd_card_register fires off uevents, causing stuff to happen such as
volume restore (alsactl) and PulseAudio starts probing the device
  - so when userspace starts accessing the device, the device is not
fully functional, because not all USB interfaces have yet been probed
  - as a result, volumes might not get restored (if all mixer controls
do not belong to the first interface), and PulseAudio thinks the device
is not capable of all the stuff it actually can do (if all pcm streams
do not belong to the first interface).

I guess this is probably not a problem normally because the kernel is
faster than userspace, but it is revealed here because switching
configurations takes longer time than probing another interface.

--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic

David Henningsson (diwic) wrote :

On 01/04/2013 05:02 PM, David Henningsson wrote:
> A patch in the 3.2 kernel caused regression with hotplugging the
> M-Audio Fast track pro, or sound after suspend. I don't have the
> device so I haven't done a full analysis, but it seems userspace
> (both udev and pulseaudio) got confused when a card was created,
> immediately destroyed, and then created again.

Since there were no counter proposal patches and the below code actually
fixes a problem for users, would you mind committing it?

>
> However, at least one person in the bug report (martin djfun)
> reports that this patch resolves the issue for him. It also leaves
> a message in the log:
> "snd-usb-audio: probe of 1-1.1:1.1 failed with error -5" which is
> a bit misleading. It is better than non-working audio, but maybe
> there's a more elegant solution?
>
> BugLink: https://bugs.launchpad.net/bugs/1095315
> Signed-off-by: David Henningsson <email address hidden>
> ---
> sound/usb/quirks.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> ...oh, and if you end up taking this patch as it is, you should probably
> add cc to stable (3.2+).
>
> diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
> index acc12f0..e71fc8b 100644
> --- a/sound/usb/quirks.c
> +++ b/sound/usb/quirks.c
> @@ -387,11 +387,13 @@ static int snd_usb_fasttrackpro_boot_quirk(struct usb_device *dev)
> * rules
> */
> err = usb_driver_set_configuration(dev, 2);
> - if (err < 0) {
> + if (err < 0)
> snd_printdd("error usb_driver_set_configuration: %d\n",
> err);
> - return -ENODEV;
> - }
> + /* Always return an error, so that we stop creating a device
> + that will just be destroyed and recreated with a new
> + configuration */
> + return -ENODEV;
> } else
> snd_printk(KERN_INFO "usb-audio: Fast Track Pro config OK\n");
>
>

--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic

Changed in alsa-driver (Ubuntu):
status: New → Triaged
Takashi Iwai (tiwai) wrote :

At Mon, 14 Jan 2013 08:21:56 +0100,
David Henningsson wrote:
>
>
> On 01/04/2013 05:02 PM, David Henningsson wrote:
> > A patch in the 3.2 kernel caused regression with hotplugging the
> > M-Audio Fast track pro, or sound after suspend. I don't have the
> > device so I haven't done a full analysis, but it seems userspace
> > (both udev and pulseaudio) got confused when a card was created,
> > immediately destroyed, and then created again.
>
> Since there were no counter proposal patches and the below code actually
> fixes a problem for users, would you mind committing it?

OK, applied now.

Takashi

>
>
>
> >
> > However, at least one person in the bug report (martin djfun)
> > reports that this patch resolves the issue for him. It also leaves
> > a message in the log:
> > "snd-usb-audio: probe of 1-1.1:1.1 failed with error -5" which is
> > a bit misleading. It is better than non-working audio, but maybe
> > there's a more elegant solution?
> >
> > BugLink: https://bugs.launchpad.net/bugs/1095315
> > Signed-off-by: David Henningsson <email address hidden>
> > ---
> > sound/usb/quirks.c | 8 +++++---
> > 1 file changed, 5 insertions(+), 3 deletions(-)
> >
> > ...oh, and if you end up taking this patch as it is, you should probably
> > add cc to stable (3.2+).
> >
> > diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
> > index acc12f0..e71fc8b 100644
> > --- a/sound/usb/quirks.c
> > +++ b/sound/usb/quirks.c
> > @@ -387,11 +387,13 @@ static int snd_usb_fasttrackpro_boot_quirk(struct usb_device *dev)
> > * rules
> > */
> > err = usb_driver_set_configuration(dev, 2);
> > - if (err < 0) {
> > + if (err < 0)
> > snd_printdd("error usb_driver_set_configuration: %d\n",
> > err);
> > - return -ENODEV;
> > - }
> > + /* Always return an error, so that we stop creating a device
> > + that will just be destroyed and recreated with a new
> > + configuration */
> > + return -ENODEV;
> > } else
> > snd_printk(KERN_INFO "usb-audio: Fast Track Pro config OK\n");
> >
> >
>
>
>
> --
> David Henningsson, Canonical Ltd.
> https://launchpad.net/~diwic
>

David Henningsson (diwic) wrote :

Hi djfun,

Just a quick question - when you tested my patch, was that on top of a 3.2 kernel or a later kernel?

Martin Kaistra (djfun) wrote :

It was on 3.2.0-35-generic.

David Henningsson (diwic) wrote :

This fix has now been committed upstream. Herton has announced in stable-queue for 3.5, and I got an email from someone who wanted to backport it to 3.2, so it will reach stable kernels in some time.

affects: alsa-driver (Ubuntu) → linux (Ubuntu)
Changed in linux (Ubuntu):
assignee: nobody → David Henningsson (diwic)
status: Triaged → Fix Committed
Luis Henriques (henrix) wrote :

This bug is awaiting verification that the kernel for Quantal in -proposed solves the problem (3.5.0-24.37). Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-quantal' to 'verification-done-quantal'.

If verification is not done by one week from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-quantal
Luis Henriques (henrix) wrote :

I'm tagging this bug as verified for Quantal as the fix came in from the stable update to 3.5.7.4.

tags: added: verification-done-quantal
removed: verification-needed-quantal

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Launchpad Janitor (janitor) wrote :
Download full text (28.9 KiB)

This bug was fixed in the package linux - 3.5.0-24.37

---------------
linux (3.5.0-24.37) quantal-proposed; urgency=low

  [Luis Henriques]

  * Release Tracking Bug
    - LP: #1117492

  [ Tim Gardner ]

  * [Config] CONFIG_ALX=m for x86 only
    - LP: #927782

linux (3.5.0-24.36) quantal-proposed; urgency=low

  [Luis Henriques]

  * Release Tracking Bug
    - LP: #1116501

  [ Adam Lee ]

  * [Config] Enable RTSX_PCI modules
    - LP: #1057089

  [ Andy Whitcroft ]

  * [Config] enable various HVC consoles
    - LP: #1102206

  [ Brad Figg ]

  * Revert "SAUCE: samsung-laptop: disable in UEFI mode"
    - LP: #1111689

  [ Herton Ronaldo Krzesinski ]

  * [Config] updateconfigs for 3.5.7.3 stable update
  * d-i: Add mellanox ethernet drivers to nic-modules
    - LP: #1015339

  [ Kamal Mostafa ]

  * SAUCE: alx driver import script
    - LP: #927782

  [ Qualcomm Atheros, Inc ]

  * SAUCE: alx: Update to heads/master
    - LP: #927782

  [ Seth Forshee ]

  * SAUCE: samsung-laptop: Add quirk for broken acpi_video backlight on
    N250P
    - LP: #1086921

  [ Stefan Bader ]

  * (config) Move 9p modules into generic package
    - LP: #1107658

  [ Tim Gardner ]

  * [debian] Remove dangling symlink from headers package
    - LP: #1112442
  * [config] CONFIG_ALX=m
    - LP: #927782
  * [Config] Add alx to d-i nic-modules
    - LP: #927782

  [ Upstream Kernel Changes ]

  * Revert "8139cp: revert "set ring address before enabling receiver""
    - LP: #1102417
  * Revert "ath9k_hw: Update AR9003 high_power tx gain table"
    - LP: #1102417
  * Revert "drm/i915: no lvds quirk for Zotac ZDBOX SD ID12/ID13"
    - LP: #1102417
  * Revert "ALSA: hda - Shut up pins at power-saving mode with Conexnat
    codecs"
    - LP: #1106966, #886975
  * be2net: don't call vid_config() when there's no vlan config
    - LP: #1083088
  * be2net: cleanup be_vid_config()
    - LP: #1083088
  * be2net: do not modify PCI MaxReadReq size
    - LP: #1083088
  * be2net: fix reporting number of actual rx queues
    - LP: #1083088
  * be2net: do not use SCRATCHPAD register
    - LP: #1083088
  * be2net: Fix driver load for VFs for Lancer
    - LP: #1083088
  * be2net: Explicitly clear the reserved field in the Tx Descriptor
    - LP: #1083088
  * be2net: Regression bug wherein VFs creation broken for multiple cards.
    - LP: #1083088
  * be2net: Fix to trim skb for padded vlan packets to workaround an ASIC
    Bug
    - LP: #1083088
  * be2net: Fix Endian
    - LP: #1083088
  * be2net: Fix error while toggling autoneg of pause parameters
    - LP: #1083088
  * be2net : Fix die temperature stat for Lancer
    - LP: #1083088
  * be2net: Fix initialization sequence for Lancer
    - LP: #1083088
  * be2net: Activate new FW after FW download for Lancer
    - LP: #1083088
  * be2net: Fix cleanup path when EQ creation fails
    - LP: #1083088
  * be2net: Enable RSS UDP hashing for Lancer and Skyhawk
    - LP: #1083088
  * be2net: dont pull too much data in skb linear part
    - LP: #1083088
  * be2net: Fix VF driver load for Lancer
    - LP: #1083088
  * be2net: Ignore physical link async event for Lancer
    - LP: #1083088
  * be2net: Fix to parse RSS hash from Receive compl...

Changed in linux (Ubuntu):
status: Fix Committed → Fix Released
Brad Figg (brad-figg) on 2013-03-02
tags: added: verification-needed-precise
Brad Figg (brad-figg) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed' to 'verification-done'.

If verification is not done by one week from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

Luis Henriques (henrix) wrote :

Tagging as verified for Precise as the fix came from an upstream stable update (kernel 3.2.38).

tags: added: verification-done-precise
removed: verification-needed-precise
To post a comment you must log in.