-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ALSA driver crash on USB sound card #51
Comments
I just got a kernel crash report that happened in 6 seconds after the WARNING: kernel BUG at mm/slab.c:3114! Internal error: Oops: 817 [#1] PREEMPT |
it is look like problem in dwc_otg driver. I put some debug messages in kernel and found that URB double freed on IRQ 120.248276 usb_disable_endpoint dev CD9FF800, epaddr 1 |
I did some patch ( https://gist.github.com/2973955 ) that work but I still see some possible problem in code: usb_hcd_check_unlink_urb use ep->urb_list that must be synchronized via hcd_urb_list_lock. But usb_hcd_check_unlink_urb does not use it and no way to do it outside hcd.c . I looked to another drivers and found that they just use private locks before calliing usb_hcd_check_unlink_urb. I did it but it is still wrong way because usb_hcd_flush_endpoint use SAME list at SAME time and they don't lock private locks because it called by usb core. |
Very glad to see that someone had found and fixed the issue. How does your patch get into the firmware updates? I have been using the rpi-update method, but if there is something else I need to do, that would be ok as well. I am working on a project that uses an external DAC via USB and it crashes on me a nearly 100% of the time. |
Second bryankemp, thanks a lot for helping solve this! Getting crashes after a few seconds of playing with a cambridge dac magic. |
ddv2005, this is so much better the e17 DAC is very happy now. Are you planning on submitting a pull request to have this added to the rpi/linux tree? I don't mind doing it if needed. |
+1 :) |
Well, I am happy to report that I tested by playing more than 12 hours of audio through the system. Using various formats, bit/sample rates, and it worked without a problem. There are some additional things to be done, but this is a great great start. I have not a response from ddv2005 and while I certainly do not want to take any credit for his efforts at debugging the issue and building a patch for it, the patch is now a little out of synch from the module code. I will post a more updated patch later today and I think I will go ahead and submit a pull request for the patch. ddv2005, if you would prefer I do not do that, please let me know and I will be more than glad to defer. |
Here is the patch for the latest dwc_otg code: https://gist.github.com/3068136 |
Thanks for patch. The pull request has been applied and pushed to rpi-update repo. |
Really, all the credit should go to DDV2005. He did the tough part. |
good job! It made my day. |
Works here too, thanks a lot mates! |
commit 105858e4506975bfb3e293f2e815d14eae40958c Author: Bryan Kemp <[email protected]> Date: Sat Jul 7 16:24:07 2012 -0500 Updating dwc_otg driver to fix issue releasing pcm stream see: raspberrypi/firmware#51 Gbp-Pq: Topic rpi Gbp-Pq: Name rpi_180_105858e4506975bfb3e293f2e815d14eae40958c.patch
Fix problem with kernel crash on closing USB ALSA devices. raspberrypi/firmware#51
Hello,
I have external USB sound card connected to the board.
But on "aplay -D plughw:0,0 -v ./beep.wav" I got an error:
76.571730 ------------ cut here ------------
76.576553 WARNING: at lib/kref.c:34 kref_get+0x40/0x48()
76.582179 Modules linked in: evdev snd_usb_audio snd_seq snd_pcm snd_timer snd_page_alloc snd_hwdep snd_usbmidi_lib snd_rawmidi snd_seq_device snd ipv6 last unloaded: scsi_wait_scan
76.599419 c00153d4 (unwind_backtrace+0x0/0xfc) from c03fba1c (dump_stack+0x20/0x24)
76.608193 c03fba1c (dump_stack+0x20/0x24) from c002d4b0 (warn_slowpath_common+0x5c/0x74)
76.617402 c002d4b0 (warn_slowpath_common+0x5c/0x74) from c002d4f4 (warn_slowpath_null+0x2c/0x34)
76.627329 c002d4f4 (warn_slowpath_null+0x2c/0x34) from c0251530 (kref_get+0x40/0x48)
76.636183 c0251530 (kref_get+0x40/0x48) from c02daafc (usb_get_urb+0x20/0x28)
76.644417 c02daafc (usb_get_urb+0x20/0x28) from c02d9cec (usb_hcd_flush_endpoint+0x110/0x160)
76.654064 c02d9cec (usb_hcd_flush_endpoint+0x110/0x160) from c02dc6ec (usb_disable_endpoint+0x60/0x90)
76.664514 c02dc6ec (usb_disable_endpoint+0x60/0x90) from c02dc768 (usb_disable_interface+0x4c/0x64)
76.674705 c02dc768 (usb_disable_interface+0x4c/0x64) from c02dcdac (usb_set_interface+0x168/0x244)
76.684934 c02dcdac (usb_set_interface+0x168/0x244) from bf0e16b8 (snd_usb_pcm_close.clone.2+0x48/0x74 snd_usb_audio)
76.696960 bf0e16b8 (snd_usb_pcm_close.clone.2+0x48/0x74 snd_usb_audio) from bf0e1728 (snd_usb_playback_close+0x20/0x24 snd_usb_audio)
76.710698 bf0e1728 (snd_usb_playback_close+0x20/0x24 snd_usb_audio) from bf0a6bc0 (snd_pcm_release_substream+0x64/0xb8 snd_pcm)
76.723831 bf0a6bc0 (snd_pcm_release_substream+0x64/0xb8 snd_pcm) from bf0a6c4c (snd_pcm_release+0x38/0x7c snd_pcm)
76.735788 bf0a6c4c (snd_pcm_release+0x38/0x7c snd_pcm) from c00f7f74 (fput+0xc0/0x218)
76.753002 c00f7f74 (fput+0xc0/0x218) from c00f43b4 (filp_close+0x78/0x90)
76.768920 c00f43b4 (filp_close+0x78/0x90) from c00f4488 (sys_close+0xbc/0x118)
76.785391 c00f4488 (sys_close+0xbc/0x118) from c000e140 (ret_fast_syscall+0x0/0x48)
76.802331 --- end trace b01813e49adb0423 ---
The text was updated successfully, but these errors were encountered: