Bug 116961 - USB audio totally hang system
Summary: USB audio totally hang system
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Jaroslav Kysela
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-22 19:24 UTC by Eugene Budanov
Modified: 2019-03-14 17:44 UTC (History)
4 users (show)

See Also:
Kernel Version: 4.1.19-nrj-desktop-3rosa-x86_64
Tree: Mainline
Regression: No


Attachments
journalctl logs (42.36 KB, application/octet-stream)
2016-04-22 19:24 UTC, Eugene Budanov
Details
Full log with urb_kill in dmesg (20.02 KB, application/gzip)
2017-08-29 16:33 UTC, Eugene Budanov
Details

Description Eugene Budanov 2016-04-22 19:24:55 UTC
Created attachment 213731 [details]
journalctl logs

A some months ago I bought external sound card Steinberg UR242. After updating to Pulse Audio 6.0 my system began periodically hang after booting KDE or during work. Situation arose almost every fourth and fifth boot when I can't open any multimedia app (SMplayer, DeaDBeeF, youtube in browser, etc) and my operating system hanging. If I shutting down the system, I see message «Saving sound card state» and my laptop can't executing power off or reboot procedure. Hard reset of power off only is possible.

In some causes I can save some of journalctl logs (attached) when system hanging not so much.

As can I see in logs — problems with USB and pulseaudio stack. 

Some of paste here:

окт 09 22:50:31 mjollnir su[26114]: (to root) roger on pts/3
окт 09 22:50:31 mjollnir kernel: audit: type=1100 audit(1444420231.921:231): pid=26114 uid=500 auid=4294967295 ses=4294967
окт 09 22:50:31 mjollnir kernel: audit: type=1101 audit(1444420231.921:232): pid=26114 uid=500 auid=4294967295 ses=4294967
окт 09 22:50:31 mjollnir kernel: audit: type=1103 audit(1444420231.921:233): pid=26114 uid=500 auid=4294967295 ses=4294967
окт 09 22:50:31 mjollnir su[26114]: pam_unix(su-l:session): session opened for user root by roger(uid=500)
окт 09 22:50:31 mjollnir kernel: audit: type=1105 audit(1444420231.925:234): pid=26114 uid=500 auid=4294967295 ses=4294967
...skipping...
окт 09 22:47:21 mjollnir kernel: current rate -1688731388 is different from the runtime rate 44100
окт 09 22:49:40 mjollnir kernel: INFO: task alsa-sink-USB A:9039 blocked for more than 120 seconds.
окт 09 22:49:40 mjollnir kernel:       Tainted: P        W  O 3.14.53-nrj-desktop-1rosa-x86_64 #1
окт 09 22:49:40 mjollnir kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
окт 09 22:49:40 mjollnir kernel: alsa-sink-USB A D ffff88062eb13180     0  9039      1 0x00000000
окт 09 22:49:40 mjollnir kernel:  ffff8805c70ebb60 0000000000000082 ffff8806099adff0 ffff8805ee9661c0
окт 09 22:49:40 mjollnir kernel:  0000000000013180 ffff8805c70ebfd8 0000000000013180 ffff8805ee9661c0
окт 09 22:49:40 mjollnir kernel:  ffff88058b6a5000 ffff8806099ae010 ffff88058b6a5000 0000000000000004
окт 09 22:49:40 mjollnir kernel: Call Trace:
окт 09 22:49:40 mjollnir kernel:  [<ffffffff8168b419>] schedule+0x29/0x70
окт 09 22:49:40 mjollnir kernel:  [<ffffffffa00c54d5>] usb_kill_urb+0x65/0xa0 [usbcore]
окт 09 22:49:40 mjollnir kernel:  [<ffffffff810af930>] ? prepare_to_wait_event+0x100/0x100
окт 09 22:49:40 mjollnir kernel:  [<ffffffffa00c4195>] usb_hcd_flush_endpoint+0xb5/0x190 [usbcore]
окт 09 22:49:40 mjollnir kernel:  [<ffffffffa00c71e7>] usb_disable_endpoint+0x57/0xc0 [usbcore]
окт 09 22:49:40 mjollnir kernel:  [<ffffffffa00c7295>] usb_disable_interface+0x45/0x60 [usbcore]
окт 09 22:49:40 mjollnir kernel:  [<ffffffffa00c77b4>] usb_set_interface+0x194/0x3b0 [usbcore]
окт 09 22:49:40 mjollnir kernel:  [<ffffffffa06a5829>] snd_usb_init_sample_rate+0x259/0x370 [snd_usb_audio]
окт 09 22:49:40 mjollnir kernel:  [<ffffffffa06aff0e>] snd_usb_pcm_prepare+0xbe/0x420 [snd_usb_audio]
окт 09 22:49:40 mjollnir kernel:  [<ffffffff815af8dd>] ? sock_sendmsg+0x8d/0xc0
окт 09 22:49:40 mjollnir kernel:  [<ffffffffa03fb417>] snd_pcm_do_prepare+0x17/0x30 [snd_pcm]
окт 09 22:49:40 mjollnir kernel:  [<ffffffffa03fae0f>] snd_pcm_action_single+0x2f/0x70 [snd_pcm]
окт 09 22:49:40 mjollnir kernel:  [<ffffffffa03fb1fe>] snd_pcm_action_nonatomic+0x6e/0x80 [snd_pcm]
окт 09 22:49:40 mjollnir kernel:  [<ffffffffa03fcc5a>] snd_pcm_common_ioctl1+0x6da/0xd20 [snd_pcm]
окт 09 22:49:40 mjollnir kernel:  [<ffffffffa03fd3a8>] snd_pcm_playback_ioctl1+0x108/0x2c0 [snd_pcm]
окт 09 22:49:40 mjollnir kernel:  [<ffffffffa03fd590>] snd_pcm_playback_ioctl+0x30/0x40 [snd_pcm]
окт 09 22:49:40 mjollnir kernel:  [<ffffffff811c94d8>] do_vfs_ioctl+0x2c8/0x4a0
окт 09 22:49:40 mjollnir kernel:  [<ffffffff811c9731>] SyS_ioctl+0x81/0xa0
окт 09 22:49:40 mjollnir kernel:  [<ffffffff8169761d>] system_call_fastpath+0x1a/0x1f
окт 09 22:50:31 mjollnir su[26114]: (to root) roger on pts/3
окт 09 22:50:31 mjollnir kernel: audit: type=1100 audit(1444420231.921:231): pid=26114 uid=500 auid=4294967295 ses=4294967
окт 09 22:50:31 mjollnir kernel: audit: type=1101 audit(1444420231.921:232): pid=26114 uid=500 auid=4294967295 ses=4294967
окт 09 22:50:31 mjollnir kernel: audit: type=1103 audit(1444420231.921:233): pid=26114 uid=500 auid=4294967295 ses=4294967
окт 09 22:50:31 mjollnir su[26114]: pam_unix(su-l:session): session opened for user root by roger(uid=500)
окт 09 22:50:31 mjollnir kernel: audit: type=1105 audit(1444420231.925:234): pid=26114 uid=500 auid=4294967295 ses=4294967

..skipping...
окт 12 00:07:39 mjollnir pulseaudio[16734]: [pulseaudio] memblockq.c: memblockq requested: maxlength=33554432, tlength=0, 
окт 12 00:07:39 mjollnir pulseaudio[16734]: [pulseaudio] memblockq.c: memblockq sanitized: maxlength=33554436, tlength=335
окт 12 00:07:39 mjollnir pulseaudio[16734]: [pulseaudio] sink-input.c: Updated resampler for sink input 83
окт 12 00:07:39 mjollnir pulseaudio[16734]: [pulseaudio] resampler.c: Forcing resampler 'copy', because of fixed, identica
окт 12 00:07:39 mjollnir pulseaudio[16734]: [pulseaudio] resampler.c: Resampler:
окт 12 00:07:39 mjollnir pulseaudio[16734]: [pulseaudio] resampler.c:   rate 44100 -> 44100 (method copy)
окт 12 00:07:39 mjollnir pulseaudio[16734]: [pulseaudio] resampler.c:   format float32le -> s24le (intermediate float32le)
окт 12 00:07:39 mjollnir pulseaudio[16734]: [pulseaudio] resampler.c:   channels 2 -> 2 (resampling 2)
окт 12 00:07:39 mjollnir pulseaudio[16734]: [pulseaudio] memblockq.c: memblockq requested: maxlength=33554432, tlength=0, 
окт 12 00:07:39 mjollnir pulseaudio[16734]: [pulseaudio] memblockq.c: memblockq sanitized: maxlength=33554436, tlength=335
окт 12 00:07:39 mjollnir pulseaudio[16734]: [pulseaudio] sink-input.c: Updated resampler for sink input 86
окт 12 00:07:39 mjollnir pulseaudio[16734]: [pulseaudio] resampler.c: Forcing resampler 'copy', because of fixed, identica
окт 12 00:07:39 mjollnir pulseaudio[16734]: [pulseaudio] resampler.c: Resampler:
окт 12 00:07:39 mjollnir pulseaudio[16734]: [pulseaudio] resampler.c:   rate 44100 -> 44100 (method copy)
окт 12 00:07:39 mjollnir pulseaudio[16734]: [pulseaudio] resampler.c:   format float32le -> s24le (intermediate float32le)
окт 12 00:07:39 mjollnir pulseaudio[16734]: [pulseaudio] resampler.c:   channels 2 -> 2 (resampling 2)
окт 12 00:07:39 mjollnir pulseaudio[16734]: [pulseaudio] memblockq.c: memblockq requested: maxlength=33554432, tlength=0, 
окт 12 00:07:39 mjollnir pulseaudio[16734]: [pulseaudio] memblockq.c: memblockq sanitized: maxlength=33554436, tlength=335

This problem I see beginning from kernel 3.14.x and to 4.1.x. 

Some additional information. I also noticed a few things:

1. Before hanging I usually strange behaves  sound card. For example, enabling sound after 8-10 seconds after the start of playback. File, video, etc. No matter what.
2. Very often the problem is easily caused when successively launch different applications working with sound card. At some point, the sound just does not happen switch and the situation described above.
Comment 1 Takashi Iwai 2016-04-28 13:04:04 UTC
Most likely a firmware bug on your device.

> окт 09 22:47:21 mjollnir kernel: current rate -1688731388 is different from
> the runtime rate 44100

This indicates that the device returns already a bogus value.  And reprogramming the sample rate causes a hang on the device and the system.
Comment 2 Eugene Budanov 2016-04-28 20:37:35 UTC
(In reply to Takashi Iwai from comment #1)
> Most likely a firmware bug on your device.
> 
> > окт 09 22:47:21 mjollnir kernel: current rate -1688731388 is different from
> the runtime rate 44100
> 
> This indicates that the device returns already a bogus value.  And
> reprogramming the sample rate causes a hang on the device and the system.

I'm not sure. As far as I remember, these problems started after the switch to PulseAudio 5 and higher. On PulseAudio 4 all was fine. But this may just a coincidence.  And as I remember, I see a similar problem on the Creative X-Fi External USB Card too (diffrent card, totally different sound chip). I can completely disable Steinberg UR-242 and use my old card for test this. Or try to disable PA and use ALSA only.
Comment 3 Eugene Budanov 2016-08-10 20:09:28 UTC
Hi! 

I tested another sound card on couple months. Yep, problem with my Steinberg UR242 only. On other card no freezes or any problems. 

As I found this card based on Yamaha SSP-2 sound chip (YC706A0 SSP2). Maybe is possible to invite author of this driver to this thread?
Comment 4 Eugene Budanov 2016-12-20 22:19:16 UTC
Up.

Same problem on kernel 4.4.38-nrj-laptop-1rosa-x86_64 x86_64 GNU/Linux.
Comment 5 Eugene Budanov 2017-06-18 19:01:08 UTC
Up. Same problem on 4.9.20-nrj-desktop-1rosa-x86_64 x86_64 GNU/Linux
Comment 6 Eugene Budanov 2017-08-29 16:31:53 UTC
Hi!

So, I localized problem. It's not a firmware bug. 

Some time ago was built special test kernel 4.9.20 with debug patch written by Vasily Khoruzhick (in CC). After another system hang we found in dmesg quite interesting information:

[40673.918366]  [<ffffffffb37d56c3>] ? __schedule+0x223/0x700
[40673.918370]  [<ffffffffb35a9487>] ? put_device+0x17/0x20
[40673.918372]  [<ffffffffb37d5bdd>] schedule+0x3d/0x90
[40673.918375]  [<ffffffffb365a787>] usb_kill_urb+0x57/0x90
[40673.918378]  [<ffffffffb30be200>] ? wake_up_atomic_t+0x30/0x30
[40673.918379]  [<ffffffffb365969e>] usb_hcd_flush_endpoint+0xae/0x170
[40673.918381]  [<ffffffffb328deef>] ? kernfs_find_ns+0x3f/0xd0
[40673.918383]  [<ffffffffb365c757>] usb_disable_endpoint+0x57/0xb0
[40673.918384]  [<ffffffffb365c7f5>] usb_disable_interface+0x45/0x60

Vasily suggested, that the problem was in USB host controller. So I disable USB 3 mode in EFI for controller. And problem was gone! I'm working more than three months without any problems.

Full log will be uploaded.
Comment 7 Eugene Budanov 2017-08-29 16:33:46 UTC
Created attachment 258147 [details]
Full log with urb_kill in dmesg
Comment 8 dfriberg23 2019-03-14 17:44:36 UTC
Have also occasionally encountered this problem for years (although for me only newer than 4.4 kernels), and only recently isolated an ancient Yamaha Audiogram 6 as the cause.

I have not found a way to produce useful logs of these crashes, unfortunately.

Note You need to log in before you can comment on or make changes to this bug.