You are not logged in.

#1 2015-11-11 20:52:25

luancristian
Member
Registered: 2015-09-12
Posts: 7

Change USB device's ID and trick kernel?

I have an analog USB TV Tuner that is not supported by Linux, I know though, that another similar (identical, really) device is supported.

This tutorial explains how to get it working, by just adding the device's ID to the a file in the kernel and then compiling/installing the new kernel.

My question is, can I simply "change" it's ID so that I don't need to compile a new kernel?

My device's lsusb output is:

Bus 003 Device 013: ID 1f71:3301

And I believe that if I were to change it to:

Bus 003 Device 013: ID 1b71:3002

it would work just fine. Is that possible?

Offline

#2 2015-11-11 21:08:55

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: Change USB device's ID and trick kernel?

Generally you can't, but check modinfo driver_name - some drivers have a parameter to add custom id.

Or maybe try this, but it may not work.

Offline

#3 2015-11-11 21:44:59

luancristian
Member
Registered: 2015-09-12
Posts: 7

Re: Change USB device's ID and trick kernel?

mich41 wrote:

Generally you can't, but check modinfo driver_name - some drivers have a parameter to add custom id.

Or maybe try this, but it may not work.

I didn't think I'd be able to actually change the ID that's hardcoded in it but  perhaps find a tool that can grab every input the device sends, simulate a new device with my chosen ID and redirect all the raw data there, something along those lines.

I'm on my cellphone and not being able to access the lwn.net article, that could be my university's network fault though, I'll try again soon when I'm home. Thanks.

Offline

#4 2015-11-11 22:09:08

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: Change USB device's ID and trick kernel?

Well, I'm not aware of any way to emulate a USB device in software and connect kernel drivers to it. It just wouldn't be that useful, most of the time smile

Offline

#5 2015-11-12 01:09:13

luancristian
Member
Registered: 2015-09-12
Posts: 7

Re: Change USB device's ID and trick kernel?

mich41 wrote:

Well, I'm not aware of any way to emulate a USB device in software and connect kernel drivers to it. It just wouldn't be that useful, most of the time smile

Yes, I agree.

I took a look at the article and indeed, it might help me me, but I'm no sure exactly how to proceed, could you help me?

I'm not sure where is the correct bind file I should echo the ID to.

Should it be this:?

echo -n "1f71:3301" > /sys/bus/media/drivers...

/sys/bus/media/drivers is an empty directory,

The file that needs changing (on the source) is usbtv-core.c

Also, if you are into kernel development, I've never sent a patch upstream but this looks like it could make it's way into the kernel, do you agree? I might try to learn how and then and submit my first patch.

Offline

#6 2015-11-12 09:35:25

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: Change USB device's ID and trick kernel?

See contents of /sys/bus/usb/devices/ and /sys/bus/usb/drivers/ and have a look at the article again smile You should be able to figure out which id to use with help of lsusb -t, the format of these ids is bus-port:configuration.interface.

As for submitting a patch, sure, this should fix it permanently. See Documentation/SubmittingPatches, scripts/get_maintainer.pl, scripts/checkpatch.pl. There may exist some shorter guide somewhere on the web smile

Offline

Board footer

Powered by FluxBB