udev dev/dvb/adapter video

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

udev dev/dvb/adapter video

Postby mengoshmink » Sat Dec 07, 2013 8:03 pm

Hi,

I must admit this is a "problem" I haven't researched much so the answer could be really simple.

$ dmesg | grep dvb
DVB: registering new adapter (SAA716x dvb adapter)
DVB: registering new adapter (SAA716x dvb adapter)
dvb-usb: found a 'Hauppauge Nova-T 500 Dual DVB-T' in warm state.
dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
dvb-usb: schedule remote query interval to 50 msecs.
dvb-usb: Hauppauge Nova-T 500 Dual DVB-T successfully initialized and connected.
usbcore: registered new interface driver dvb_usb_dib0700


I run a MythTV server and normally all is well. After a passing comment in #mythtv-users it has become clear that I am running my MythTV backend with a security window. I'm aware you shouldn't run things as root unless absolutely necessary but I just accepted that when I installed MythTV via ATrpms that everything was as it should / needed to be.

ps auxw | grep mythbackend tells me my backend is being run as root. When I looked in /etc/init.d/mythbackend I found this:
# Does not work on Red Hat, do to to missing audio/video groups.
# daemon --user mythtv $binary $OPTIONS


So I was told to do the following, I have paraphrased what wagnerrp said:
add the groups and adjust your udev rules to create the device nodes with the proper permissions
http://www.reactivated.net/writing_udev ... #ownership
all you need to do is configure the rule that creates those device nodes to specify a group and mode
if they're currently set to root, then there should be no issue setting them to some group


So I went to that link and did some reading, plus here:
http://www.comp.lancs.ac.uk/~fittond/myth_tv_dvb-t.html
and here:
http://www.mythtv.org/wiki/Device_Filenames_and_udev
but my attempts so fr have failed.

The three things I have tried are:
nano /etc/udev/rules.d/10-dvb.rules
Attempt #1
Code: Select all
KERNEL=="dvb/adapter[0-9]*", NAME="adapter/%n", SYMLINK+="%k", GROUP="video"

Attempt #2
Code: Select all
dvb/adapter[0-3]*/*:root:video:0660

Attempt #3
Code: Select all
KERNEL=="dvb/adapter[0-9]*", GROUP="video"


Can anyone point me in the right direction?
Sharing knowledge is the best way to learn.
User avatar
mengoshmink
 
Posts: 9
Joined: Sun Oct 20, 2013 3:17 pm

Postby nelz » Sun Dec 08, 2013 10:59 am

First of all, it is best to not rename devices, leave the name alone at put your custom name as the symlink. Secondly, the individual entries under the adaptorN directory need to be set, not adaptorN itself. Instead of matchng on KERNEL, match on SUBSYSTEM. I have this in my default udev rules

Code: Select all
SUBSYSTEM=="dvb", GROUP="video"


The entries already have 660 permissions, if that's not the case for you, add MODE=660 to the above rule. And, of course, make sure the mythtv user is in the video group.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8468
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby mengoshmink » Sun Dec 08, 2013 6:43 pm

Thank you to my rescue (laziness) again nelz.

1st off, I didn't realize one of the rules would of renamed the device, good job it didn't work.

2nd, I forgot adapterN was a folder. The permissions were already 660 so all I had to do was add the correct udev rule to assign the video group and life is peachy.

If it helps anyone else this is what I did in full:

Code: Select all
# service mythbackend stop


I have a folder that contains all my storage groups (dbbackups, livetv, coverart etc) so I did a chgrp on that folder:
Code: Select all
chgrp mythtv -R dvr/


Add mythtv to the video group:
Code: Select all
# usermod -a -G video mythtv


Create and edit udev rule for my dvb cards:
Code: Select all
# nano /etc/udev/rules.d/10-dvb.rules

Containing:
SUBSYSTEM=="dvb", GROUP="video"


Edit the mythbackend init script to start the service as the mythtv user:
Code: Select all
# nano /etc/init.d/mythbackend

daemon --user mythtv $binary $OPTIONS


Start the service and tested by trying to watch a livetv program:
Code: Select all
# service mythbackend start


Thank you to wagnerrp, edman007 and nelz :D
Sharing knowledge is the best way to learn.
User avatar
mengoshmink
 
Posts: 9
Joined: Sun Oct 20, 2013 3:17 pm


Return to Help!

Who is online

Users browsing this forum: No registered users and 0 guests