Skip to content

Lock in pcm_prepare #1

@dagargo

Description

@dagargo

Hello,

I've tried to get the module compiled and running properly on my PC but haven't succeeded.

Firstly, as there is no documentation provided, I assume that the module needs to be built from inside the kernel tree. So I copied it into the 5.2.9 version and it failed.

linux-source-5.2$ make M=sound/usb/misc modules
  CC [M]  sound/usb/misc/digitakt.o
sound/usb/misc/digitakt.c:27:10: fatal error: usbaudio.h: No such file or directory
 #include "usbaudio.h"
          ^~~~~~~~~~~~
compilation terminated.
make[1]: *** [scripts/Makefile.build:284: sound/usb/misc/digitakt.o] Error 1
make: *** [Makefile:1610: _module_sound/usb/misc] Error 2

I used the commit 44481bc (which only differs at the wrong includes) and it worked. But perhaps, there's another way to compile it.

Secondly, once inserted via modprobe, audio doesn't work but MIDI does. While inserted, the system becomes unstable; but if removed it becomes stable again. So it seems to be a lock somewhere.

If I try to run jackd (with pasuspender) I get the following.

[ 9547.064106] INFO: task pulseaudio:1656 blocked for more than 120 seconds.
[ 9547.064113]       Tainted: G           OE     5.2.9 #5
[ 9547.064114] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 9547.064117] pulseaudio      D    0  1656   1546 0x00000000
[ 9547.064121] Call Trace:
[ 9547.064132]  ? __schedule+0x2bb/0x660
[ 9547.064136]  schedule+0x29/0x90
[ 9547.064143]  pcm_prepare+0x142/0x190 [snd_digitakt]
[ 9547.064148]  ? finish_wait+0x80/0x80
[ 9547.064156]  snd_pcm_do_prepare+0x19/0x30 [snd_pcm]
[ 9547.064164]  snd_pcm_action_single+0x36/0x80 [snd_pcm]
[ 9547.064172]  snd_pcm_action_nonatomic+0x61/0x70 [snd_pcm]
[ 9547.064180]  snd_pcm_common_ioctl+0x541/0xb90 [snd_pcm]
[ 9547.064188]  snd_pcm_ioctl+0x23/0x30 [snd_pcm]
[ 9547.064193]  do_vfs_ioctl+0xa4/0x630
[ 9547.064197]  ksys_ioctl+0x60/0x90
[ 9547.064201]  __x64_sys_ioctl+0x16/0x20
[ 9547.064205]  do_syscall_64+0x53/0x130
[ 9547.064208]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 9547.064211] RIP: 0033:0x7ffa2c154427
[ 9547.064218] Code: Bad RIP value.
[ 9547.064219] RSP: 002b:00007ffce5f64ed8 EFLAGS: 00000202 ORIG_RAX: 0000000000000010
[ 9547.064222] RAX: ffffffffffffffda RBX: 00005582972adbc0 RCX: 00007ffa2c154427
[ 9547.064223] RDX: 00005582972acf70 RSI: 0000000000004140 RDI: 000000000000002f
[ 9547.064224] RBP: 00007ffce5f655f0 R08: 0000000000000000 R09: 00000000000012bd
[ 9547.064225] R10: 0000000000000004 R11: 0000000000000202 R12: 00005582972acda0
[ 9547.064226] R13: 00007ffce5f65784 R14: 0000000000000000 R15: 00007ffce5f65050

It seems that the pcm_prepare function is the one causing the lock.

Besides, I activated CONFIG_SND_DEBUG and CONFIG_SND_DEBUG_VERBOSE to see if I could throw some light on this issue and I observed the following:

  • At loading, looks like every time it is inserted it opens and closes the pcm port 13 times.
  • In the function playback_urb_complete, every call returns because urb->urb.status == -ENOENT.

But not sure if these mean anything.

However, thank you for this amazing project!

Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions