Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#3662 closed enhancement (fixed)

MediaMonitor may want to ignore some devices

Reported by: anonymous Owned by: Nigel
Priority: minor Milestone: 0.21
Component: mythtv Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

My frontend does not contain a hard drive. Instead, it boots from a flash drive and mounts / via NFS. The flash drive also contains the /usr partition which is mounted read only. When MythTV starts up, the media monitor detects that there is a removable device inserted and displays it's partitions in MythGallery. I find that annoying having to press escape multiple times to get to the main menu.

I can't just disable /dev/sda in udev because I need to be able to actually access the device to mount /usr. I also don't want to disable media monitor globally because I still want auto detection of optical media, SD cards, etc. There needs to be a way to tell the media monitor to ignore select devices.

This patch adds support for a new setting called IgnoreDevices? which can contain a comma separated list of devices to be ignored by MediaMonitorUnix?. The devices are specified in sysfs form, e.g. "/sys/block/sda".

Attachments (1)

mythtv-ignoredevices.patch (881 bytes) - added by Daniel Burr 17 years ago.

Download all attachments as: .zip

Change History (13)

Changed 17 years ago by Daniel Burr

Attachment: mythtv-ignoredevices.patch added

comment:1 Changed 17 years ago by Nigel

Am wondering if, instead of adding yet another database parameter to workaround a problem, we could automate this? Maybe only monitor drives that are 'noauto' in /etc/fstab? Or exclude any device that has a partition mounted as / ?

comment:2 in reply to:  1 Changed 17 years ago by anonymous

Replying to nigel:

Am wondering if, instead of adding yet another database parameter to workaround a problem, we could automate this? Maybe only monitor drives that are 'noauto' in /etc/fstab? Or exclude any device that has a partition mounted as / ?

Well, we can't do it the "noauto" way because sometimes media monitor will be detecting devices that don't have an entry in /etc/fstab (e.g. devices automatically mounted by hal in /media). Your second suggestion wouldn't be too helpful to me because I need to stop /usr from being detected, not /.

comment:3 Changed 17 years ago by Nigel

Owner: changed from Isaac Richards to Nigel
Status: newassigned

Fair enough. I will apply this. One last question, Daniel.
Your patch ignores based on /dev/blah (the device path) instead of the mountpoint (/usr). If you did something to change your boot sequence (added another drive on a higher priority USB socket) and rebooted, /dev/sda might become /dev/sdb. Would it be more sensible to check on the mountpoint, instead? (e.g. something in ::AddDevice())

comment:4 in reply to:  3 Changed 17 years ago by Daniel Burr

Replying to nigel:

Fair enough. I will apply this. One last question, Daniel.
Your patch ignores based on /dev/blah (the device path) instead of the mountpoint (/usr). If you did something to change your boot sequence (added another drive on a higher priority USB socket) and rebooted, /dev/sda might become /dev/sdb. Would it be more sensible to check on the mountpoint, instead? (e.g. something in ::AddDevice())

Yeah, I agree with what you've done in ticket #3666. Going by mountpoint OR device path gives the best of both worlds. However, I don't agree with having m_IgnoreList as a member because that means that the setting cannot be updated at runtime (requires media monitor to be restarted). I guess you've done it for performance reasons?

comment:5 Changed 17 years ago by anonymous

Correct. I think there are too many database lookups sprinkled through the code that don't need to be there. I guess the correct way to do it would be to add IgnoreDevices? into the Settings UI, and to delete/new (or update) the MediaMonitor? object if it (or MonitorDrives?) changes.

comment:6 Changed 17 years ago by Nigel

(In [13878]) Allow user to set a list of devices to NOT monitor. See #3662

comment:7 Changed 17 years ago by Nigel

Resolution: fixed
Status: assignedclosed

(In [13881]) UI for media manager ignore list. Closes #3662. Also adds some item grouping

comment:8 Changed 17 years ago by Jose Bernardo Silva <jose.bandos@…>

Stupid question - what is the format for IgnoreDevices? (/dev/*, mountpoint, /sys/block/*, ?), and is a mythtv-backend restart needed? From the discussion above it isn't clear what did you decide, and the text you added doesn't specify the format of the devices to be added to the list.

comment:9 Changed 17 years ago by Nigel

(In [13937]) A few missing parts in [13879]. See #3662. See #2598.

comment:10 Changed 17 years ago by anonymous

Hola! Jose. All those formats should be acceptable, and a frontend (not backend) restart is needed. I will try and add an example in the Setup help text, but I am not sure there will be enough room to also say "You need to start the frontend for a change here to take effect".
If it isn't working for you, try adding some debug, like this:

Index: mythmediamonitor.cpp
===================================================================
--- mythmediamonitor.cpp        (revision 13882)
+++ mythmediamonitor.cpp        (working copy)
@@ -539,6 +539,12 @@
         VERBOSE(VB_MEDIA, "Ignoring device: " + device->getDevicePath());
         return true;
     }
+    else
+    {
+        VERBOSE(VB_MEDIA, "Not ignoring: " + device->getDevicePath()
+                          + " / " + device->getMountPath());
+        VERBOSE(VB_MEDIA, "Paths not in: " + m_IgnoreList.join(", "));
+    }
 
     return false;
 }

comment:11 Changed 17 years ago by Nigel

When I said "all ... acceptable", they have to be actual device or mountpaths. Wildcards (/sys/block/*) won't work.

comment:12 Changed 17 years ago by anonymous

The devices are specified in sysfs form, e.g. "/sys/block/sda".

Note: See TracTickets for help on using tickets.