AVerMedia A828: Difference between revisions

From LinuxTVWiki
Jump to navigation Jump to search
No edit summary
Line 32: Line 32:
<pre>
<pre>
1. In aver/osdep.c :
1. In aver/osdep.c :
1.a If Kernel >= 2.6.37 then remove line :
1.a Replace :
#include <linux/smp_lock.h>
1.b Replace :
void SysLockKernel()
void SysLockKernel()
{
{
Line 55: Line 57:
}
}
1.c As per previous instructions (can't include because blocked by spam filter)
1.b Replace :
if(st_Mutex == type) {
init_MUTEX(tmp);
*sem = (pSemaphore) tmp;
}
else if(st_MutexLocked == type) {
init_mutex_locked(tmp);
*sem = (pSemaphore) tmp;
}
By :
if(st_Mutex == type) {
sema_init(tmp, 1);
*sem = (pSemaphore) tmp;
}
else if(st_MutexLocked == type) {
sema_init(tmp, 0);
*sem = (pSemaphore) tmp;
}


2. In aver/osdep_th2.c :
2. In aver/osdep_th2.c :
Line 80: Line 64:
Add :
Add :
#include "osdep.h"
#include "osdep.h"
2.b If Kernel >= 2.6.37 then remove line :
2.b Replace :
#include <linux/smp_lock.h>
2.c Replace :
lock_kernel();
lock_kernel();
By :
By :
SysLockKernel();
SysLockKernel();
2.c and Replace :
2.d and Replace :
unlock_kernel();
unlock_kernel();
By:
By:
SysUnlockKernel();
SysUnlockKernel();
3. In aver/osdep_v4l2.c :
3. In aver/osdep_v4l2.c :
After :
3.a After :
#include "debug.h"
#include "debug.h"
Add :
Add :
#define VFL_TYPE_VTX 3
#define VFL_TYPE_VTX 3
3.b If Kernel >= 2.6.37 then remove line :
4. run :
#include <linux/smp_lock.h>
4. In aver/osdep_dvb.c :
If Kernel >= 2.6.37 then remove line :
#include <linux/smp_lock.h>
5. Run :
sed -i 's/param_array_[gs]et/param_array_ops/g' *
sed -i 's/param_array_[gs]et/param_array_ops/g' *
sed -i 's/param_array_[gs]et/param_array_ops/g' aver/*
sed -i 's/param_array_[gs]et/param_array_ops/g' aver/*


5. Run :
6. Run :
make
make


6. Run :
7. Run :
sudo modprobe dmx3191d
sudo modprobe dmx3191d
sudo modprobe v4l2-common
sudo modprobe v4l2-common
Line 108: Line 99:
sudo insmod ./averusba828.ko
sudo insmod ./averusba828.ko
sudo insmod ./a828.ko
sudo insmod ./a828.ko

8. To make modules ./averusba828.ko and ./a828.ko available after reboot :
cp ./averusba828.ko /lib/modules/`uname -r`/kernel/drivers/media/dvb/dvbusb
cp ./a828.ko /lib/modules/`uname -r`/kernel/drivers/media/dvb/dvbusb
</pre>
</pre>

Revision as of 13:09, 30 October 2011

AVermedia DVB-T A828 was compatible with Linux until the version 2.6.37 of the kernel. Since this version, the Big Kernel Lock (BKL) is disabled by default. Thus, many of drivers using it have to be updated. The Linux driver for A828 belongs to this kind of driver. We will see above how to ensure the compatibility with it.


Warning

This tipp have only been tested by me. I am not friendly with V4L nor with driver coding. It would be great if someone can test, give feedback, and correct if necessary. Thanks in advance.

Download And Prepare the installation

First, if you hadn't download it yet, download the driver from this page : http://www.avermedia.com/avertv/support/Download.aspx?Type=APDriver&tab=APDriver&id=31

Extract the archive where you want to. Then, run a terminal, and type those commands :

  cd /where/you/put/A828_Installer_...
  sudo sh AVERMEDIA-Linux-x64-A828-0.28-beta.sh

You will be asked if you want the normal installation or the expert one. Choose Expert.

Choose a directory for the output... Then :

 cd /where/you/put/A828-expert-install/

Now, we will apply the modifications.


Modifications to bring

1. In aver/osdep.c : 
        1.a If Kernel >= 2.6.37 then remove line :
                #include <linux/smp_lock.h>
	1.b Replace : 
		void SysLockKernel()
		{
			lock_kernel();
		}

		void SysUnlockKernel()
		{
			unlock_kernel();
		}
		
	  By : 
		static DEFINE_MUTEX(dvbdev_mutex);
		void SysLockKernel()
		{
			mutex_lock(&dvbdev_mutex);
		}

		void SysUnlockKernel()
		{
			mutex_unlock(&dvbdev_mutex);
		}
	
	1.c As per previous instructions (can't include because blocked by spam filter)	

2. In aver/osdep_th2.c :
	2.a After : 
		#include "osdep_th2.h"
	    Add : 
		#include "osdep.h"
        2.b If Kernel >= 2.6.37 then remove line :
                #include <linux/smp_lock.h>
	2.c Replace : 
		lock_kernel();
	    By : 
		SysLockKernel();
	
	2.d and Replace : 
		unlock_kernel();
	    By:
		SysUnlockKernel();
		
3. In aver/osdep_v4l2.c :
	3.a After : 
		#include "debug.h"
	    Add : 
		#define VFL_TYPE_VTX    3
        3.b If Kernel >= 2.6.37 then remove line :
                #include <linux/smp_lock.h>
4. In aver/osdep_dvb.c :
        If Kernel >= 2.6.37 then remove line :
                #include <linux/smp_lock.h>
5. Run : 
	sed -i 's/param_array_[gs]et/param_array_ops/g' *
	sed -i 's/param_array_[gs]et/param_array_ops/g' aver/*

6. Run : 
        make

7. Run : 
	sudo modprobe dmx3191d
	sudo modprobe v4l2-common
        sudo modprobe dvb-core
	sudo insmod ./averusba828.ko
	sudo insmod ./a828.ko

8. To make modules ./averusba828.ko and ./a828.ko available after reboot :
        cp ./averusba828.ko /lib/modules/`uname -r`/kernel/drivers/media/dvb/dvbusb
        cp ./a828.ko /lib/modules/`uname -r`/kernel/drivers/media/dvb/dvbusb