Score:1

How could I use my USB TV tuner under WSL2?

by flag

I'm completely clueless at this point. I've been trying to set up a TVheadend server through WSL2 (Ubuntu), but I can't get my TV tuner to work. (Astrometa DVB-T2)

I'm on the latest kernel, using USBIP. WSL2 sees the device when I check it with lsusb, but w_scan or TVheadend would't recognise it. I also tried rebuilding the kernel and turning on some DVB and Multimedia settings in the configuration menu, but it made no difference. I assume it is a driver issue, but I'm not sure how to install drivers onto this, I'm an absolute linux newbie. Tried doing it through this tutorial, but it failed due to a missing build script of some sort.

I've tested this setup on Hyper-V Ubuntu and it worked perfectly fine, so there should be no compatibility issues.

flex@DESKTOP-HB4QOSF:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 15f4:0131 HanfTek Astrometa DVB-T/T2/C FM & DAB receiver [RTL2832P]
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 15f4:0131 HanfTek Astrometa DVB-T/T2/C FM & DAB receiver [RTL2832P]
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x15f4 HanfTek
  idProduct          0x0131 Astrometa DVB-T/T2/C FM & DAB receiver [RTL2832P]
  bcdDevice            1.00
  iManufacturer           1 astrometadvbt2
  iProduct                2 dvbt2
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0022
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          4
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              5
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              5
fleXTCG avatar
by flag
For the Hyper-V setup I mentioned, I also used USBIP, so I assume that direct access shouldn't be a necessity. There are very little information on this topic, so I couldn't find anything on whether this is supported or not. The problem is, that since I know next to nothing about Linux, I don't know how to install the driver for the card and test it myself to find out if it would work with WSL2.
fleXTCG avatar
by flag
Could you please explain to me what are source headers for? I'm mainly a Windows user, but I have to use TVheadend to stream cable channels in my house over IP to where I can't put coaxial cables in. Tried DVBViewer, but it failed, since for some reason, it would only stream MPEG2 channels consistently, but not h264. It sometimes did, but it was completely random. MediaPortal is an absolute hassle to work with, not a flexible program at all, but I haven't found any alternatives other than these two. WSL2 would be perfect, if I could get this to work.
fleXTCG avatar
by flag
Hyper-V with USBIP does the job for now, but it's super sluggish to do all this in a virtual environment. I need something snappy, where if I restart the server PC, I can just turn the whole thing back on with 2-3 commands at max with the least amount of outages. I've seen people using webcams and such with the same USBIP method in WSL2, there is no way this can't be done with a regular TV tuner.
NotTheDr01ds avatar
vn flag
You're on the right track, I believe, with building your own kernel with modules that appear relevant. The problem is, of course, finding that magic combination of kernel modules necessary to enable.
fleXTCG avatar
by flag
I still have little to no idea what I'm doing, but I found out that the plugin/driver/module (I don't know what it is exactly) called "dvb_usb_v2" wouldn't show up in "dmesg" even if I turn it on when building the kernel. This is necessary for a DVB device to work with linux. Even if I manually install V4L, which I eventually was able to do in the end, it makes no difference. No clue why.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.