[USB-Audio - USB Sound Blaster HD, playback] fails after reboot

Bug #1191898 reported by Vasco Alves
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
PulseAudio
New
Undecided
Unassigned
alsa-driver (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

To get the sound card to work, I have to go through this complicated process of:

1) Starting the computer without the card plugged in;
2) Plugging it in;
3) At this point, it does NOT work. I have to select it in the audio settings, try to make it lay a test sound, which it fails, and then select the on-board sound;
4) Reboot with onboard sound selected. Just logging out does NOT work;
5) After reboot, select USB Analogue Output, and it will work, however
6) After a subsequent reboot, it will fail again, and I have to unplug the card and reboot again, starting the whole cycle over.

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: alsa-base 1.0.25+dfsg-0ubuntu4
ProcVersionSignature: Ubuntu 3.9.0-6.13-generic 3.9.6
Uname: Linux 3.9.0-6-generic x86_64
ApportVersion: 2.9.2-0ubuntu8.1
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: vasco 2151 F.... pulseaudio
 /dev/snd/controlC1: vasco 2151 F.... pulseaudio
 /dev/snd/pcmC1D0p: vasco 2151 F...m pulseaudio
Date: Mon Jun 17 18:57:29 2013
InstallationDate: Installed on 2012-01-20 (514 days ago)
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
MarkForUpload: True
PackageArchitecture: all
SourcePackage: alsa-driver
Symptom: audio
Symptom_Card: USB Sound Blaster HD - USB Sound Blaster HD
Symptom_Type: Sound works for a while, then breaks
Title: [USB-Audio - USB Sound Blaster HD, playback] fails after a while
UpgradeStatus: Upgraded to raring on 2013-05-06 (42 days ago)
dmi.bios.date: 05/24/2012
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 4.6.5
dmi.board.asset.tag: Tag 12345
dmi.board.name: W240EU/W250EUQ/W270EUQ
dmi.board.vendor: CLEVO CO.
dmi.board.version: V3.0
dmi.chassis.asset.tag: No Asset Tag
dmi.chassis.type: 10
dmi.chassis.vendor: No Enclosure
dmi.chassis.version: N/A
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr4.6.5:bd05/24/2012:svnCLEVOCO.:pnW240EU/W250EUQ/W270EUQ:pvrNotApplicable:rvnCLEVOCO.:rnW240EU/W250EUQ/W270EUQ:rvrV3.0:cvnNoEnclosure:ct10:cvrN/A:
dmi.product.name: W240EU/W250EUQ/W270EUQ
dmi.product.version: Not Applicable
dmi.sys.vendor: CLEVO CO.

Revision history for this message
Vasco Alves (vascofalves) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in alsa-driver (Ubuntu):
status: New → Confirmed
Revision history for this message
Vasco Alves (vascofalves) wrote :

I'm happy to report that upgrading to the 3.11 kernel packages from Saucy has solved this problem.

Revision history for this message
Vasco Alves (vascofalves) wrote :

Actually, it hasn't really solved it. It just made it happen slightly less often, but it still happens.

Revision history for this message
Simon (eierfrucht) wrote :
Download full text (5.6 KiB)

Currently I am running Kubuntu x64 14.04 LTS on Asus G750JX laptop and just until recently had been plagued by exactly the same bug with my Sound Blaster HD USB. Upgrading to a newer kernel and/or installing the latest unstable pulseaudio proved to decrease the probability of triggering the bug, but it just lingered on and didn't want to go.

Luckily I was able to find and test a workaround involving four simple components: a custom udev rule; a script to be launched upon triggering this rule; another script to properly load pulseaudio's equalizer modules; finally a session cleanup script to prevent device lockup on warm reboot.

After much error and trial I found that the USB Sound Blaster HD would hang when:

1. ...its corresponding ALSA sink is discovered by pulseaudio while pulseaudio simultaneously loads various modules. This causes the device randomly hang on system start.

2. ...its corresponding kernel module snd_usb_audio remains in use at the moment when the device receives an unbind command. This is even worse because once triggered, the device preserves its zombie state across warm reboots (unfortunately few PCs and laptops cycle USB power during a warm reboot)

3. Physical replugging recovers the device, but at least on a few occasions I observed the USB hub itself entering an abnormal state after triggering this bug. Because of this, even physical replugging does not always help. I had to power down the laptop completely.

I found that the best way to keep the device from hanging is to ensure that: 1. it remains unmounted until pulseaudio is up and running 2. its module is unloaded (immediately followed by an unbind command) early during system shutdown

THE FIX:

1. Create and make executable the following script in your user script folder:

#######################################

#!/bin/bash

# The following line makes udev behave differently
# depending on whether the rule is triggered before
# or after pulseaudio has started:

if ! $(ps ax | grep [p]ulseaudio > /dev/null )

# So if it's the first time the rule is triggered, let's unload
# the device's kernel module to ensure safe device removal

then

modprobe -r snd_usb_audio

# Now the module is no longer running, so
# we can safely issue an unbind command

echo $1 | tee /sys/bus/usb/drivers/usb/unbind

# Let's wait for pulseaudio to start...

while ! $(ps ax | grep [p]ulseaudio > /dev/null)

do
sleep 1
done

# ...then one extra second to let finish loading modules:

sleep 1

# Now we can safely bind the device:

echo $1 | tee /sys/bus/usb/drivers/usb/bind
fi

# At this point the rule is triggered again and the script
# has a second run, but does nothing so udev just proceeds
# to automatically load the snd_usb_audio module

#######################################

2. Create a udev rule that launches the script upon device discovery, passing its USB address as an argument:

#######################################

ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="041e", ATTRS{idProduct}=="30d7", ATTRS{manufacturer}=="Creative Technology", ATTRS{product}=="USB Sound Blaster HD", RUN+="/home/user/.scripts/load-usb-audio.sh $attr{busnum}-$attr{devpath}"

##################...

Read more...

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

This release of Ubuntu is no longer receiving maintenance updates. If this is still an issue on a maintained version of Ubuntu please let us know.

Changed in alsa-driver (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

This issue has sat incomplete for more than 60 days now. I'm going to close it as invalid. Please feel free re-open if this is still an issue for you. Thank you.

Changed in alsa-driver (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.