Bug 479566

Summary: gnome-volume-control excessive CPU usage after USB sound card is unplugged
Product: [Fedora] Fedora Reporter: Vladimir Kotal <vlada>
Component: gnome-mediaAssignee: Bastien Nocera <bnocera>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 10CC: bnocera, davidz, jboggs, notting
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-22 14:12:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vladimir Kotal 2009-01-11 11:54:16 UTC
Description of problem:
After USB sound card is unplugged, gnome-volume-control begins looping, eating CPU cycles until killed.

Version-Release number of selected component (if applicable):
gnome-media-2.24.0.1-2.fc10.i386

How reproducible:
connect USB sound card, launch gnome-volume-control and disconnect the sound card.

Steps to Reproduce:
1. connect USB sound card (e.g. web camera with integrated sound card)
2. double click on the gnome sound volume applet and select the USB card tab
3. disconnect USB sound card
  
Actual results:
after disconnecting USB sound card, gnome-volume-control starts eating the CPU making the system unusable

Expected results:
gnome-volume-control should handle the disconnect event gracefully

Additional info:

pstack outputs when the process becomes CPU hungry:

# pstack 4525
Thread 2 (Thread 0xb7d0eb90 (LWP 4527)):
#0  0x0082409e in __pthread_mutex_unlock_usercnt () from /lib/libpthread.so.0
#1  0x009fe94e in g_static_rec_mutex_unlock () from /lib/libglib-2.0.so.0
#2  0x00fbee39 in gst_element_class_get_pad_template_list ()
#3  0x057f9d33 in ?? () from /usr/lib/libgstreamer-0.10.so.0
#4  0x00a00306 in ?? () from /lib/libglib-2.0.so.0
#5  0x009fec6f in ?? () from /lib/libglib-2.0.so.0
#6  0x0082151f in start_thread () from /lib/libpthread.so.0
#7  0x0075704e in clone () from /lib/libc.so.6
Thread 1 (Thread 0xb8071760 (LWP 4525)):
#0  0x00110416 in __kernel_vsyscall ()
#1  0x0074c777 in poll () from /lib/libc.so.6
#2  0x009d7772 in ?? () from /lib/libglib-2.0.so.0
#3  0x009d7e02 in g_main_loop_run () from /lib/libglib-2.0.so.0
#4  0x0022f459 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#5  0x0804dc7e in gtk_button_box_get_type ()
#6  0x006896e5 in __libc_start_main () from /lib/libc.so.6
#7  0x0804c3c1 in gtk_button_box_get_type ()


# pstack 4525
Thread 2 (Thread 0xb7d0eb90 (LWP 4527)):
#0  0x00bd1ffa in pthread_key_create () from /lib/libgthread-2.0.so.0
#1  0x00bd2779 in pthread_key_create () from /lib/libgthread-2.0.so.0
#2  0x009feb5f in g_static_rec_mutex_lock () from /lib/libglib-2.0.so.0
#3  0x00fbedaf in gst_element_class_get_pad_template_list ()
#4  0x057f9d33 in ?? () from /usr/lib/libgstreamer-0.10.so.0
#5  0x00a00306 in ?? () from /lib/libglib-2.0.so.0
#6  0x009fec6f in ?? () from /lib/libglib-2.0.so.0
#7  0x0082151f in start_thread () from /lib/libpthread.so.0
#8  0x0075704e in clone () from /lib/libc.so.6
Thread 1 (Thread 0xb8071760 (LWP 4525)):
#0  0x00110416 in __kernel_vsyscall ()
#1  0x0074c777 in poll () from /lib/libc.so.6
#2  0x009d7772 in ?? () from /lib/libglib-2.0.so.0
#3  0x009d7e02 in g_main_loop_run () from /lib/libglib-2.0.so.0
#4  0x0022f459 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#5  0x0804dc7e in gtk_button_box_get_type ()
#6  0x006896e5 in __libc_start_main () from /lib/libc.so.6
#7  0x0804c3c1 in gtk_button_box_get_type ()

# pstack 4525
Thread 2 (Thread 0xb7d0eb90 (LWP 4527)):
#0  0x00110416 in __kernel_vsyscall ()
#1  0x0074c777 in poll () from /lib/libc.so.6
#2  0x00fbeda4 in gst_element_class_get_pad_template_list ()
#3  0x057f9d33 in ?? () from /usr/lib/libgstreamer-0.10.so.0
#4  0x00a00306 in ?? () from /lib/libglib-2.0.so.0
#5  0x009fec6f in ?? () from /lib/libglib-2.0.so.0
#6  0x0082151f in start_thread () from /lib/libpthread.so.0
#7  0x0075704e in clone () from /lib/libc.so.6
Thread 1 (Thread 0xb8071760 (LWP 4525)):
#0  0x00110416 in __kernel_vsyscall ()
#1  0x0074c777 in poll () from /lib/libc.so.6
#2  0x009d7772 in ?? () from /lib/libglib-2.0.so.0
#3  0x009d7e02 in g_main_loop_run () from /lib/libglib-2.0.so.0
#4  0x0022f459 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#5  0x0804dc7e in gtk_button_box_get_type ()
#6  0x006896e5 in __libc_start_main () from /lib/libc.so.6
#7  0x0804c3c1 in gtk_button_box_get_type ()


# pstack 4525
Thread 2 (Thread 0xb7d0eb90 (LWP 4527)):
#0  0x008229e0 in pthread_mutex_lock () from /lib/libpthread.so.0
#1  0x057f9e77 in ?? () from /usr/lib/libgstreamer-0.10.so.0
#2  0x00a00306 in ?? () from /lib/libglib-2.0.so.0
#3  0x009fec6f in ?? () from /lib/libglib-2.0.so.0
#4  0x0082151f in start_thread () from /lib/libpthread.so.0
#5  0x0075704e in clone () from /lib/libc.so.6
Thread 1 (Thread 0xb8071760 (LWP 4525)):
#0  0x00110416 in __kernel_vsyscall ()
#1  0x0074c777 in poll () from /lib/libc.so.6
#2  0x009d7772 in ?? () from /lib/libglib-2.0.so.0
#3  0x009d7e02 in g_main_loop_run () from /lib/libglib-2.0.so.0
#4  0x0022f459 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#5  0x0804dc7e in gtk_button_box_get_type ()
#6  0x006896e5 in __libc_start_main () from /lib/libc.so.6
#7  0x0804c3c1 in gtk_button_box_get_type ()




top output snapshot:

 4525 katka     20   0 72220  16m  11m S 93.3  1.1   2:47.27 gnome-volume-co                                     
 2652 root      20   0  339m  55m 9.9m R  2.1  3.6   6:20.64 Xorg                                                
 2994 katka     20   0 78672  31m  12m S  2.1  2.1   0:39.31 skype                                               
 3210 katka     20   0  499m 321m  28m S  2.1 21.2  13:16.40 firefox                                             
 4382 katka     20   0 63744  17m  11m R  2.1  1.1   0:02.33 gnome-terminal                                      
 4764 root      20   0  2428 1068  836 R  2.1  0.1   0:00.05 top                                                 
    1 root      20   0  2012  780  568 S  0.0  0.1   0:00.97 init                                                
    2 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 kthreadd                                            
    3 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 migration/0                                         
    4 root      15  -5     0    0    0 S  0.0  0.0   0:01.09 ksoftirqd/0                                         
    5 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/0                                          
    6 root      15  -5     0    0    0 R  0.0  0.0   0:00.20 events/0                                            
    7 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 khelper                                             
   80 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 kintegrityd/0                                       
   82 root      15  -5     0    0    0 S  0.0  0.0   0:00.13 kblockd/0                                           
   84 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 kacpid                                              
   85 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 kacpi_notify                                        
  165 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 cqueue                                              
  169 root      15  -5     0    0    0 S  0.0  0.0   0:01.64 ata/0                                               
  170 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 ata_aux                                             
  172 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 ksuspend_usbd

Comment 1 Joey Boggs 2009-05-14 17:31:08 UTC
Seeing this as well when using a usb headset, same scenario and results

Comment 2 Bastien Nocera 2009-09-22 14:12:53 UTC
This is a problem in the way the alsa volume control works in GStreamer. It doesn't know that the device has gone away, and tries, and re-tries to connect to it.

The problem doesn't exist in Fedora 11, and newer, where we replaced the GStreamer-based mixer by a PulseAudio one.