Connect a USB TV-Tuner to TS *39

Printers, HDDs, USB/eSATA drives, 3rd-party programs

Connect a USB TV-Tuner to TS *39

Postby druggo » Wed Aug 05, 2009 1:44 am

Hi there, i'm in the process of purchasing either a TS-239 or a TS-439, and the idea is to have to serve my clients with live TV, aswell and storing my family photos etc, I was wondering since it was based on ubuntu linux (right?) if one could plug in a tv-tuner on the usb port and have it recognized? dunno if the v4l subsystem is installed, but it is my understanding that one can tinker with these machines a bit? I read about someone installing DEbian on these, and that debian is supported by qnap, so that shouldn't be any problem is that's the case. However, before i my this investments i would like your opinion if this is doable or now, and perhaps someone out there have tried it already.

A bit off topic but my goal is to run either mythbackend or VDR on the qnap, thus not having to have another machine for doing this.

Regards,
Tobias
druggo
New here
 
Posts: 6
Joined: Wed Aug 05, 2009 1:39 am
NAS Model: TS-419U

Re: Connect a USB TV-Tuner to TS *39

Postby camh » Fri Aug 07, 2009 7:34 am

The QNAP firmware is a custom Linux distribution and not based on Ubuntu. I don't think you'll have much luck getting a TV tuner working with the stock QNAP firmware.

The posts about installing Debian on a QNAP are all for the TS*09/*19 boxes, which run a non-x86 CPU (MIPS? ARM? I've forgotten), so it needs a bit a fiddling to get Debian installed.

For a TS239/439 - these are Atom based, so you can load the stock x86 Debian installation. I have just posted my success story in another thread, so have a look for that. If you do load Debian, be aware that you will lose the QNAP firmware and web functionality. Much of the functionality is still available from the Debian command line, but you will want to have more than a little linux experience to run that way. If you do load Debian, you should have no trouble using the USB TV stick, assuming it is supported by Linux.

It may be possible to extract TwonkyMedia from the default QNAP install (or install 3.1 to get the latest). That may be able to run under Debian. Although if your goal is to run MythTV, you probably dont need TwonkyMedia. It may be a nice addition to a media server though.
camh
Starting out
 
Posts: 19
Joined: Thu Jun 18, 2009 4:41 am
Location: Melbourne
NAS Model: TS-419U

Re: Connect a USB TV-Tuner to TS *39

Postby druggo » Fri Aug 07, 2009 8:22 pm

Hi,

great, thanks for your success story, I'm used to linux sw raid so reinstalling it to some linux (there can't be only debian that's supported?) sounds like the ideal for my situation, just a question, is it possible to boot from usb stick?

Regards,
druggo
New here
 
Posts: 6
Joined: Wed Aug 05, 2009 1:39 am
NAS Model: TS-419U

Re: Connect a USB TV-Tuner to TS *39

Postby camh » Fri Aug 07, 2009 9:51 pm

druggo wrote:just a question, is it possible to boot from usb stick?

Yes. I installed Debian from a usb stick. Plug it in before rebooting and go into the BIOS. From there, you should be able to change the boot order so that the usb stick comes first.

If it doesn't work plugged into the front, plug it into the back. I had trouble with the front port, but that was my first couple of boots and I may have got something wrong, but I didn't see it in the BIOS. After that I just used a rear port and had no troubles.
camh
Starting out
 
Posts: 19
Joined: Thu Jun 18, 2009 4:41 am
Location: Melbourne
NAS Model: TS-419U

Re: Connect a USB TV-Tuner to TS *39

Postby druggo » Wed Aug 12, 2009 2:19 am

Hi again, i have now received my TS-239 and have since i received it started to install Arch Linux 2009.08 x86 onto it.

A couple of questions if you could bear with me,

My setup:
TS-239

2x1.5TB in RAID1 using MD (linux software raid)
md0 -> /dev/sda1,/dev/sdb1 (100mb) /boot
md1 -> /dev/sda2,/dev/sdb2 (8000mb) /
md2 -> /dev/sda3,/dev/sdb3 (2000mb) swap
md3 -> /dev/sda4,/dev/sdb4 (1.3TB) /home

/dev/sdc (untouched FLASH qnap drive)

Boot from USB stick, Kingston never booted so i used a no-name and booted using front USB.

Backup for Recovery
========
I tried the to cat /dev/mtdblock0,1,2 but my qnap reported that no such file existed, I read in your other post that you dd'ed for backup reasons, after some investigation i found that the 239 uses /dev/sdx as the equivalent to mtdblock (or atleast, that's what I think and are hoping) so i did a cat /dev/sdx1 > sdx1, and the same for 2 and 3. I hope that this will allow be to restore the box if i ever want to go back to qnap's firmware, is this the correct way, can my images be used for a system restore?


GRUB
====
One other problem from what i've read in your post is that you couldn't install GRUB onto the harddrives, since they haven't spin up yet.
I am now in the phase where one should install grub, and from what i've heard, GRUB2 is the way to go if you use sw-raid using md, which i have.
the only problems seems to be that the first partition on the flash (/dev/sdc) is too small, so grub complaints about that. Now i must make a decision, to either:

a) move the /boot from the sw-raid onto the FLASH drive and install grub onto it.

b) wipe the partitions from the FLASH drive and install grub2 onto it.

One question that comes to my mind before i wipe the partitions on the flash is if the system restore, handles my deletion and creation of the partitions on the flash? If i get an answer on that matter i don't have any problems in wiping the flash drives partitions, to be able to install grub2 onto it.

Phew, quite a lengthy post, I hope i didn't lose you in the middle :)

Regards,
Druggo
druggo
New here
 
Posts: 6
Joined: Wed Aug 05, 2009 1:39 am
NAS Model: TS-419U

Re: Connect a USB TV-Tuner to TS *39

Postby camh » Wed Aug 12, 2009 7:10 am

To backup the DOM from within the QNAP firmware:
Code: Select all
dd if=/dev/sdx of=qnap-sdx.img

That copies the entire DOM, not just individial partitions. They way you did it means you would have to repartition the DOM correctly before restoring. You also missed sdx5 and sdx6. The above dd command will get the lot and save the partition information and the MBR too.

To restore this, boot into Linux and ensure that the DOM is not mounted, then run
Code: Select all
dd if=qnap-sdx.img of=/dev/sdc

and reboot. The QNAP firmware should run, and will reinitialise the HDDs (so make sure you save any data you want). On my system, the DOM is /dev/sda, not /dev/sdc, so make sure you have the right device.

I put /boot on the DOM. I created a single partition to be /boot, and installed grub (legacy) on the MBR of that device.

My setup looks like this:
Code: Select all
/dev/md0               3842296   1106284   2696976  30% /
/dev/sda1               117171      7159    110012   7% /boot
/dev/md2             956626436 468418976 488207460  49% /srv

Swap is on /dev/md1.
camh
Starting out
 
Posts: 19
Joined: Thu Jun 18, 2009 4:41 am
Location: Melbourne
NAS Model: TS-419U

Re: Connect a USB TV-Tuner to TS *39

Postby flamaest » Fri Jun 04, 2010 2:21 am

Hi Guys,

Could someone PLEASE explain how they made their TS-239 boot form the hard drive after installing Ubuntu from a USB flash drive? I am looking in the BIOS and I only see two options in the pull-down menu for selecting which boot device can be chosen, and it does not seem to include the hard drives.

I used "UNetbootin" to create the bootable Ubuntu ISO onto a USB flash drive for the installation; after doing the backup recommended above.


HOW DO YOU DO THIS STEP below???

"""
I put /boot on the DOM. I created a single partition to be /boot, and installed grub (legacy) on the MBR of that device.
"""

Thanks,
Fabian.
flamaest
Starting out
 
Posts: 25
Joined: Mon Jan 18, 2010 2:59 pm
NAS Model: TS-109/209

Re: Connect a USB TV-Tuner to TS *39

Postby camh » Sun Jun 06, 2010 12:28 pm

The DOM appears as a /dev/sd? device when you install. In my example above, it was /dev/sda (from some reason for druggo above, it was /dev/sdc, so check what device it appears for you before blindly partitioning it). So I partitioned /dev/sda into one partition (/dev/sda1), and mounted that at /boot.

For the boot device, I selected /dev/sda.

What this means is that you are NOT booting from the HDD. You are booting from the DOM. You can still put the root partition on the HDD, but the bootloader and kernel go on the DOM.

It may be that you can also put the kernel on the HDD. Just GRUB goes on the DOM, since by the time that GRUB is running, the HDDs will be available. From recollection, the HDDs are not spun up until after the BIOS loads the boot loader, so the boot loader cannot be on the HDD.
camh
Starting out
 
Posts: 19
Joined: Thu Jun 18, 2009 4:41 am
Location: Melbourne
NAS Model: TS-419U

Re: Connect a USB TV-Tuner to TS *39

Postby flamaest » Mon Jun 07, 2010 6:27 am

Sorry to re-ask the question.. :)

So, for Debian then, [not ubuntu, sorry for the confusion]

What were the steps exactly for putting /boot on the DOM [and then installing grub on the MBR of that device]?

Thanks,
Fabian.
flamaest
Starting out
 
Posts: 25
Joined: Mon Jan 18, 2010 2:59 pm
NAS Model: TS-109/209

Re: Connect a USB TV-Tuner to TS *39

Postby druggo » Mon Jun 07, 2010 1:28 pm

Hi fabian, its just a matter of specifying /boot to the DOM during install, and the install grub onto it. Use Manual partitioning during ubuntu setup and specify the /boot partition to ext2, and the DOM of course. Don't forget to set it bootable.

I hope this helps you.
druggo
New here
 
Posts: 6
Joined: Wed Aug 05, 2009 1:39 am
NAS Model: TS-419U

Re: Connect a USB TV-Tuner to TS *39

Postby flamaest » Thu Jun 10, 2010 3:32 am

OK, did the manual install with /boot to the DOM as ext2..

I think I forgot to set the bootable flag because all I got was a blinking curser on the next DOM boot..

was getting late and I had to get some sleep..

will set the DOM partition to to bootable tonight after work and reboot.. fingers crossed.. :)

F.
flamaest
Starting out
 
Posts: 25
Joined: Mon Jan 18, 2010 2:59 pm
NAS Model: TS-109/209

Re: Connect a USB TV-Tuner to TS *39

Postby flamaest » Fri Jun 11, 2010 12:52 am

Thanks all, the boot flag was what I was missing.. :)

I am able to boot from the DOM now.

Thanks again,
Fabian.
flamaest
Starting out
 
Posts: 25
Joined: Mon Jan 18, 2010 2:59 pm
NAS Model: TS-109/209


Return to Hardware & Software Compatibility

Who is online

Users browsing this forum: No registered users and 3 guests