[alsa-devel] Kernel module build workflow (Re: Logitech USB headset not working in 3.6-rc3)

Takashi Iwai tiwai at suse.de
Sun Aug 26 14:46:04 CEST 2012

At Sat, 25 Aug 2012 07:16:21 -0500,
Bruno Wolff III wrote:
> On Sat, Aug 25, 2012 at 08:13:27 -0400,
>    Josh Boyer <jwboyer at redhat.com> wrote:
> >On Sat, Aug 25, 2012 at 07:07:40AM -0500, Bruno Wolff III wrote:
> >> On Sat, Aug 25, 2012 at 14:02:51 +0200,
> >>   Daniel Mack <zonque at gmail.com> wrote:
> >> >
> >> >Can you revert commit e9ba389c5 ("ALSA: usb-audio: Fix
> >> >scheduling-while-atomic bug in PCM capture stream") and see if that
> >>
> >> I can try that, but it takes a long time to build a new kernel on my
> >> old hardware.
> >
> >I started a scratch build of a kernel with that patch reverted (via
> >patch -R).  You'll find it here when it finishes:
> >
> >http://koji.fedoraproject.org/koji/taskinfo?taskID=4421817
> >
> >josh
> I'll test it when it finishes. Thanks. It takes me a long time to build 
> kernels locally, and I wasn't sure how to do a scratch build on koji without 
> committing stuff remotely.

Actually you don't have to rebuild the whole kernel at all just for
debugging this usb-audio bug.  The workflow below is what I do often
for debugging a driver problem on a distro kernel.

1. Prepare the compile-ready kernel source tree corresponding to your
   running kernel.  This may depend on distro; in the case of SUSE,
   kernel-default-devel.rpm must be installed for kernel-default.rpm,
   for example.

2. Copy sound/usb subdirectory of the kernel source tree locally
   anywhere else, say, $HOME/usb.  It can be a normal user

3. Apply the patch to that local directory.

4. Build modules as a normal user like
	% make -C /lib/modules/$(uname -r)/build M=$HOME/usb modules

5. Make an extra update directory in the module directory once, e.g.
	# mkdir /lib/modules/$(uname -r)/updates

6. Copy *.ko files to there
	# cp $HOME/usb/*.ko /lib/modules/$(uname -r)/updates

7. Run depmod once
	# /sbin/depmod -a

8. Reload snd-usb-audio module.

If you want to take back to the original module, just remove updates
module directory and run depmod again.  Pretty convenient, eh?



More information about the Alsa-devel mailing list