/* Fill buffer */
                vivi_fillbuff(dev,buf);
-       }
-       if (list_empty(&dma_q->active)) {
-               del_timer(&dma_q->timeout);
-       } else {
-               mod_timer(&dma_q->timeout, jiffies+BUFFER_TIMEOUT);
+
+               if (list_empty(&dma_q->active)) {
+                       del_timer(&dma_q->timeout);
+               } else {
+                       mod_timer(&dma_q->timeout, jiffies+BUFFER_TIMEOUT);
+               }
        }
        if (bc != 1)
                dprintk(1,"%s: %d buffers handled (should be 1)\n",__FUNCTION__,bc);
 
        dprintk(1,"thread started\n");
 
+       mod_timer(&dma_q->timeout, jiffies+BUFFER_TIMEOUT);
+
        for (;;) {
                vivi_sleep(dma_q);
 
                printk(KERN_ERR "vivi: kernel_thread() failed\n");
                return PTR_ERR(dma_q->kthread);
        }
+       /* Wakes thread */
+       wake_up_interruptible(&dma_q->wq);
+
        dprintk(1,"returning from %s\n",__FUNCTION__);
        return 0;
 }