LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-19-2012, 04:47 AM   #1
noiett
Member
 
Registered: May 2011
Distribution: Slackware64-14.2
Posts: 34

Rep: Reputation: 14
AverTV Volar Green HD


Hi,

I've been given this USB TV tuner and I'd like to install it on a slack64 13.37 running a linux 2.6.37 kernel.

lsusb returns this:
Quote:
Bus 002 Device 002: ID 07ca:a835 AVerMedia Technologies, Inc.
But dmesg says nothing about the device, so I understand the kernel doesn't recognize it.

I made it work on Ubuntu (there's a patch on internet) but I couldn't find information on how to do the same with Slackware.

Can you please give me advice?

Thanks
 
Old 01-19-2012, 06:07 AM   #2
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
It may need firmware, do you see it listed here:
http://linuxtv.org/wiki/index.php/AVerMedia
 
Old 01-19-2012, 06:26 AM   #3
noiett
Member
 
Registered: May 2011
Distribution: Slackware64-14.2
Posts: 34

Original Poster
Rep: Reputation: 14
Unfortunately my card is not listed there...

There's a thread on this device in Arch Linux forums:
https://bbs.archlinux.org/viewtopic.php?id=130457

They're installing the following driver on a linux 3.1.5 kernel.
http://xgazza.altervista.org/Linux/DVB/af9035.html

I've given it a shot (had to change KDIR line in Makefile to "KDIR = /usr/src/linux") but there may be something missing in my kernel:

Quote:
make -C /usr/src/linux SUBDIRS=/home/gerard/Downloads/AF9035_xgaz_3.0.0 modules
make[1]: Entering directory `/usr/src/linux-2.6.37.6'
CC [M] /home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.o
In file included from /home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.h:30:0,
from /home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.c:28:
/home/gerard/Downloads/AF9035_xgaz_3.0.0/include/dvb-usb.h:17:27: fatal error: media/rc-core.h: No such file or directory
compilation terminated.
make[2]: *** [/home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.o] Error 1
make[1]: *** [_module_/home/gerard/Downloads/AF9035_xgaz_3.0.0] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.37.6'
make: *** [default] Error 2
I'm pretty newbie on this stuff. Do you you think upgrading my kernel may help?

Thanks!
 
Old 01-19-2012, 07:12 AM   #4
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
You need to use kernel version 3.0.0.
 
1 members found this post helpful.
Old 01-20-2012, 02:56 AM   #5
noiett
Member
 
Registered: May 2011
Distribution: Slackware64-14.2
Posts: 34

Original Poster
Rep: Reputation: 14
Successfully compiled and installed my first kernel (3.0.0) but still getting an error:

Quote:
make[1]: Entering directory `/usr/src/linux-3.0.0'
CC [M] /home/gerard/Downloads/AF9035_xgaz_3.0.0/mxl5007t.o
/home/gerard/Downloads/AF9035_xgaz_3.0.0/mxl5007t.c:828:22: error: redefinition of 'mxl5007t_attach'
/home/gerard/Downloads/AF9035_xgaz_3.0.0/mxl5007t.h:85:36: note: previous definition of 'mxl5007t_attach' was here
make[2]: *** [/home/gerard/Downloads/AF9035_xgaz_3.0.0/mxl5007t.o] Error 1
make[1]: *** [_module_/home/gerard/Downloads/AF9035_xgaz_3.0.0] Error 2
make[1]: Leaving directory `/usr/src/linux-3.0.0'
make: *** [default] Error 2
Not sure whether the configuration of my kernel may have to do with it.

Maybe it just doesn't work.
 
Old 01-20-2012, 04:04 AM   #6
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
I would remove this section from 'mxl5007t.h':

Code:
#if defined(CONFIG_MEDIA_TUNER_MXL5007T) || (defined(CONFIG_MEDIA_TUNER_MXL5007T_MODULE) && defined(MODULE))
extern struct dvb_frontend *mxl5007t_attach(struct dvb_frontend *fe,
					    struct i2c_adapter *i2c, u8 addr,
					    struct mxl5007t_config *cfg);
#else
static inline struct dvb_frontend *mxl5007t_attach(struct dvb_frontend *fe,
						   struct i2c_adapter *i2c,
						   u8 addr,
						   struct mxl5007t_config *cfg)
{
	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
	return NULL;
}
#endif
 
Old 01-20-2012, 03:09 PM   #7
noiett
Member
 
Registered: May 2011
Distribution: Slackware64-14.2
Posts: 34

Original Poster
Rep: Reputation: 14
I had to do the same in tuner_tda18218.h but now af9035.c seems to be missing these headers in mxl5007t and tuner_tda18218:

Quote:
make -C /usr/src/linux SUBDIRS=/home/gerard/Downloads/AF9035_xgaz_3.0.0 modules
make[1]: Entering directory `/usr/src/linux-3.0.0'
CC [M] /home/gerard/Downloads/AF9035_xgaz_3.0.0/tuner_tda18218.o
CC [M] /home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.o
/home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.c: In function ‘af9035_tuner_attach’:
/home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.c:1066:9: error: ‘mxl5007t_attach’ undeclared (first use in this function)
/home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.c:1066:9: note: each undeclared identifier is reported only once for each function it appears in
/home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.c:1066:9: warning: type defaults to ‘int’ in declaration of ‘__a’
/home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.c:1066:3: warning: type defaults to ‘int’ in type name
/home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.c:1066:9: warning: cast from pointer to integer of different size
/home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.c:1066:3: warning: type defaults to ‘int’ in type name
/home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.c:1066:9: warning: cast from pointer to integer of different size
/home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.c:1066:9: error: called object ‘__a’ is not a function
/home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.c:1102:26: error: ‘tuner_tda18218_attach’ undeclared (first use in this function)
/home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.c:1102:26: warning: type defaults to ‘int’ in declaration of ‘__a’
/home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.c:1102:20: warning: type defaults to ‘int’ in type name
/home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.c:1102:26: warning: cast from pointer to integer of different size
/home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.c:1102:20: warning: type defaults to ‘int’ in type name
/home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.c:1102:26: warning: cast from pointer to integer of different size
/home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.c:1102:26: error: called object ‘__a’ is not a function
make[2]: *** [/home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.o] Error 1
make[1]: *** [_module_/home/gerard/Downloads/AF9035_xgaz_3.0.0] Error 2
make[1]: Leaving directory `/usr/src/linux-3.0.0'
make: *** [default] Error 2
I'm not an expert C programmer but I'm trying to figure it out myself.

Please tell me if you come up with any possible way to fix it.
 
Old 01-21-2012, 04:04 AM   #8
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Ok, I tested this and it compiles, delete these functions:

mxl5007t.c
Code:
struct dvb_frontend *mxl5007t_attach(struct dvb_frontend *fe,
				     struct i2c_adapter *i2c, u8 addr,
				     struct mxl5007t_config *cfg)
{
	struct mxl5007t_state *state = NULL;
	int instance, ret;

	mutex_lock(&mxl5007t_list_mutex);
	instance = hybrid_tuner_request_state(struct mxl5007t_state, state,
					      hybrid_tuner_instance_list,
					      i2c, addr, "mxl5007t");
	switch (instance) {
	case 0:
		goto fail;
	case 1:
		/* new tuner instance */
		state->config = cfg;

		mutex_init(&state->lock);

		if (fe->ops.i2c_gate_ctrl)
			fe->ops.i2c_gate_ctrl(fe, 1);

		ret = mxl5007t_get_chip_id(state);

		if (fe->ops.i2c_gate_ctrl)
			fe->ops.i2c_gate_ctrl(fe, 0);

		/* check return value of mxl5007t_get_chip_id */
		if (mxl_fail(ret))
			goto fail;
                       
               if (fe->ops.i2c_gate_ctrl)
                       fe->ops.i2c_gate_ctrl(fe, 1);

               ret = mxl5007t_write_reg(state, 0x04, state->config->loop_thru_enable);

               if (fe->ops.i2c_gate_ctrl)
                       fe->ops.i2c_gate_ctrl(fe, 0);

               /* check return value of mxl5007t_get_chip_id */
               if (mxl_fail(ret))
                       goto fail;
		break;
	default:
		/* existing tuner instance */
		break;
	}
	fe->tuner_priv = state;
	mutex_unlock(&mxl5007t_list_mutex);

	memcpy(&fe->ops.tuner_ops, &mxl5007t_tuner_ops,
	       sizeof(struct dvb_tuner_ops));

	return fe;
fail:
	mutex_unlock(&mxl5007t_list_mutex);

	mxl5007t_release(fe);
	return NULL;
}
tuner_tda18218.c
Code:
struct dvb_frontend *tuner_tda18218_attach(struct dvb_frontend *fe,
	struct i2c_adapter *i2c, struct tda18218_config *cfg)
{
	struct tda18218_priv *priv = NULL;
	u8 val;
	int ret;
	/* chip default registers values */
	static u8 def_regs[] = {
		0xc0, 0x88, 0x00, 0x8e, 0x03, 0x00, 0x00, 0xd0, 0x00, 0x40,
		0x00, 0x00, 0x07, 0xff, 0x84, 0x09, 0x00, 0x13, 0x00, 0x00,
		0x01, 0x84, 0x09, 0xf0, 0x19, 0x0a, 0x8e, 0x69, 0x98, 0x01,
		0x00, 0x58, 0x10, 0x40, 0x8c, 0x00, 0x0c, 0x48, 0x85, 0xc9,
		0xa7, 0x00, 0x00, 0x00, 0x30, 0x81, 0x80, 0x00, 0x39, 0x00,
		0x8a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xf6
	};

	priv = kzalloc(sizeof(struct tda18218_priv), GFP_KERNEL);
	if (priv == NULL)
		return NULL;

	priv->cfg = cfg;
	priv->i2c = i2c;
	fe->tuner_priv = priv;

	if (fe->ops.i2c_gate_ctrl)
		fe->ops.i2c_gate_ctrl(fe, 1); /* open I2C-gate */

	/* check if the tuner is there */
	ret = tda18218_rd_reg(priv, R00_ID, &val);
	dbg("%s: ret:%d chip ID:%02x", __func__, ret, val);
	if (ret || val != def_regs[R00_ID]) {
		kfree(priv);
		return NULL;
	}

	info("NXP TDA18218HN successfully identified.");

	memcpy(&fe->ops.tuner_ops, &tda18218_tuner_ops,
		sizeof(struct dvb_tuner_ops));
	memcpy(priv->regs, def_regs, sizeof(def_regs));

	/* loop-through enabled chip default register values */
	if (priv->cfg->loop_through) {
		priv->regs[R17_PD1] = 0xb0;
		priv->regs[R18_PD2] = 0x59;
	}

	/* standby */
	ret = tda18218_wr_reg(priv, R17_PD1, priv->regs[R17_PD1] | (1 << 0));
	if (ret)
		dbg("%s: failed ret:%d", __func__, ret);

	if (fe->ops.i2c_gate_ctrl)
		fe->ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */

	return fe;
}
I'm not an expert at C either, but it is saying that the functions are defined twice, maybe somewhere in the includes.
 
Old 01-22-2012, 03:58 AM   #9
noiett
Member
 
Registered: May 2011
Distribution: Slackware64-14.2
Posts: 34

Original Poster
Rep: Reputation: 14
I removed both functions, compiled, installed firmware and reboot:

Quote:
make -C /usr/src/linux SUBDIRS=/home/gerard/Downloads/AF9035_xgaz_3.0.0 modules
make[1]: Entering directory `/usr/src/linux-3.0.0'
CC [M] /home/gerard/Downloads/AF9035_xgaz_3.0.0/mxl5007t.o
/home/gerard/Downloads/AF9035_xgaz_3.0.0/mxl5007t.c:764:29: warning: ‘mxl5007t_tuner_ops’ defined but not used
/home/gerard/Downloads/AF9035_xgaz_3.0.0/mxl5007t.c:777:12: warning: ‘mxl5007t_get_chip_id’ defined but not used
CC [M] /home/gerard/Downloads/AF9035_xgaz_3.0.0/tua9001.o
CC [M] /home/gerard/Downloads/AF9035_xgaz_3.0.0/tuner_tda18218.o
/home/gerard/Downloads/AF9035_xgaz_3.0.0/tuner_tda18218.c:112:12: warning: ‘tda18218_rd_reg’ defined but not used
CC [M] /home/gerard/Downloads/AF9035_xgaz_3.0.0/af9035.o
LD [M] /home/gerard/Downloads/AF9035_xgaz_3.0.0/dvb-usb-af9035.o
CC [M] /home/gerard/Downloads/AF9035_xgaz_3.0.0/af9033.o
Building modules, stage 2.
MODPOST 5 modules
CC /home/gerard/Downloads/AF9035_xgaz_3.0.0/af9033.mod.o
LD [M] /home/gerard/Downloads/AF9035_xgaz_3.0.0/af9033.ko
CC /home/gerard/Downloads/AF9035_xgaz_3.0.0/dvb-usb-af9035.mod.o
LD [M] /home/gerard/Downloads/AF9035_xgaz_3.0.0/dvb-usb-af9035.ko
CC /home/gerard/Downloads/AF9035_xgaz_3.0.0/mxl5007t.mod.o
LD [M] /home/gerard/Downloads/AF9035_xgaz_3.0.0/mxl5007t.ko
CC /home/gerard/Downloads/AF9035_xgaz_3.0.0/tua9001.mod.o
LD [M] /home/gerard/Downloads/AF9035_xgaz_3.0.0/tua9001.ko
CC /home/gerard/Downloads/AF9035_xgaz_3.0.0/tuner_tda18218.mod.o
LD [M] /home/gerard/Downloads/AF9035_xgaz_3.0.0/tuner_tda18218.ko
make[1]: Leaving directory `/usr/src/linux-3.0.0'
Quote:
[ 8.478882] dvb-usb: found a 'Avermedia AverTV Volar HD & HD PRO (A835)' in cold state, will try to load a firmware
[ 8.519652] dvb-usb: downloading firmware from file 'dvb-usb-af9035-01.fw'
[ 8.946890] dvb-usb: found a 'Avermedia AverTV Volar HD & HD PRO (A835)' in warm state.
[ 8.955705] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[ 8.964979] DVB: registering new adapter (Avermedia AverTV Volar HD & HD PRO (A835))
[ 8.990379] af9033: firmware version: LINK:11.15.10.0 OFDM:5.48.10.0
[ 9.001627] DVB: registering adapter 0 frontend 0 (Afatech AF9033 DVB-T)...
[ 9.017574] usb 8-2: New USB device found, idVendor=046d, idProduct=c050
[ 9.026901] usb 8-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 9.030487] tuner_tda18218_attach: driver disabled by Kconfig
[ 9.030499] Registered IR keymap rc-empty
[ 9.030561] input: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:1d.7/usb2/2-4/rc/rc0/input4
[ 9.030621] rc0: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:1d.7/usb2/2-4/rc/rc0
[ 9.030623] dvb-usb: schedule remote query interval to 200 msecs.
[ 9.030625] dvb-usb: Avermedia AverTV Volar HD & HD PRO (A835) successfully initialized and connected.
[ 9.120406] usbcore: registered new interface driver dvb_usb_af9035
But neither Kaffeine nor VLC find any channels when scanning. The device works fine in a Windows7 partition.

I compared my dmesg with that in ArchLinux forum and there's a little difference:

They get: [17732.229761] tda18218: NXP TDA18218HN successfully identified.
instead of: [ 9.030487] tuner_tda18218_attach: driver disabled by Kconfig

Looks like the problem is that tuner_tda18218_attach function was removed. But I wonder why it is declared in two places when compiling and then missing when loading the driver. tuner_tda18218.c and tuner_tda18218.h are included in kernel-3.0.0 drivers (files are nearly the same) so they must be fine. May it have to do with the makefile? Or maybe the includes...

I'll try to check them all.

Last edited by noiett; 01-22-2012 at 04:00 AM.
 
Old 01-22-2012, 04:15 AM   #10
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
I think I understand what is going on now.

You have to compile the modules in the 3.0.0 kernel. So make sure you enable tda18218 and mxl5007t in the kernel as modules. Then you should try to compile these external drivers. If it finds them in the kernel, it won't try to compile them again and probably avoid this issue. So, just compile the kernel with these modules enabled and try compiling the external modules again without my modifications (should not be neccesary any more).

Last edited by H_TeXMeX_H; 01-22-2012 at 04:16 AM.
 
1 members found this post helpful.
Old 01-22-2012, 05:52 AM   #11
noiett
Member
 
Registered: May 2011
Distribution: Slackware64-14.2
Posts: 34

Original Poster
Rep: Reputation: 14
Smile

You were right, it works!

I previously tried enabling those modules but couldn't find them in the kernel configuration app. I turns out they were hidden because I had to activate Customize analog and hybrid tuner modules to build in Multimedia support. Then appears a section called Customize TV tuners and you can enable them.

Now it compiles and installs fine. Restarted the system and got this in dmesg:

Quote:
[ 8.885431] tda18218: NXP TDA18218HN successfully identified.
Kaffeine finds and plays channels now.

Thank you very very much for your help and prompt responses
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Tv card "Avermedia difi volar EX" won't work with zenwalk 6.2 deathalele Linux - Hardware 1 04-02-2010 04:17 PM
How to change light green text color to dark green of xterm ? cola Slackware 13 01-03-2010 09:07 AM
LXer: 5 Ways to Save Green by going Green LXer Syndicated Linux News 0 05-15-2009 11:31 PM
LXer: The Green Penguin: Going Green With Google LXer Syndicated Linux News 0 10-08-2008 04:00 PM
avertv canyon289 Linux - Hardware 1 08-24-2005 09:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration