James' Tech Blog

Uncategorized

Acer E5-575-57a4

by on Dec.05, 2016, under Uncategorized

Running log of what I did:

BIOS set password and disable secure boot. Change touchpad to basic.

Per manual condition battery; 3 full charge cycles 

Boot System Rescue CD into cache. 

Unsquash dev loop into dev shm

While true; do tar cf – unsquashed/ pipe pigz -9 /dev/null

Leave a Comment more...

High battery usage mediaserver

by on Mar.26, 2013, under Uncategorized

I noticed on my gtab2 that the mediaserver process was using >37% of the battery. Searching the web doesn’t provide much, but that it’s probably hung up trying to scan some file. Great! I’ve got a bunch of MP3s on the SD card.
I wasn’t able to quickly determine what file it’s choking on. Online advice basically says you have to eliminate files 1by1. Very tedious for a large number of files!
I had a hunch it was the BMP cover art files I had on there. I deleted them all and the usage dropped to ~3%. Not bad! I can live without album art on there. Problem solved!

Leave a Comment : more...

How to update Mythvideo file titles

by on Sep.13, 2010, under Uncategorized

The title of the post is a little confusing, I’ll admit that straight away. Here is the problem. I had a bunch of series AVI files name as such: 101.avi 102.avi 103.avi … ad nauseum. This was great, but episode titles make it easier to pick out which one I really want to watch. Especially when I’m using UPNP. So I renamed all my files to be like 101.Rose.avi. Great, super easy to tell what the episode is about!

Good thing mythtv is smart and made hashes of all the files. Now it knows that 101.Rose.avi might as well be 101.avi. Awesome! If I had trailers, poster-art, and other metadata it would be right there with the files with new names. Unfortunately, what it didn’t change was the title. So when I look at my videos in mythfrontend 101.Rose.avi is called 101. The titles didn’t update. Well, this is good behavior. If we’re going to track which file is which by hashes, then we don’t want to change the title just because the filename changed (or path I’m presuming).

This is not the behavior I wanted though. I searched a little bit, but couldn’t find anything. I did find out the structure of videometadata though. That gave me the clue to just write a script to update the titles based on the filenames. Here we go, in glorious PHP:


//replace master_IP with your MySQL IP address and password with whatever your password is
$con = mysql_connect("master_IP","mythtv","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("mythconverg", $con);
//if you want all the files the next line is good. Otherwise see line after that
$myquery = "SELECT intid,title,filename FROM videometadata";
//I did it for a subset of files which is why I used LIKE to match part of the path in the filename field
//$myquery = "SELECT intid,title,filename FROM videometadata WHERE filename ". 'LIKE "%who%"';
$myquery_rows = mysql_query($myquery);
while ($myrow = mysql_fetch_array($myquery_rows)) {
//update query
$new_title = substr(basename($myrow['filename']), 0, strrpos(basename($myrow['filename']), '.'));
$up_query = "UPDATE videometadata SET title = '" . $new_title . "' WHERE intid = '" . $myrow['intid'] . "'";
print $up_query;
//mysql_query($up_query); //uncomment this after you're satisfied with the output
}
mysql_close($con);

To protect the innocent I have it just print what it would change the titles to. All you have to do is uncomment the mysql_query line. Sorry the code plugin I have squashed my tabs. Not a deal breaker, but it would be easier to read. Also, the code plugin doesn’t like php tags you’ll have to add them. The next script is probably the one you want to run first. It just prints the intid, title, and filename (which in my case included path) for each file. This is handy to see if the filenames/titles match. Also, to see if your update went well.


$con = mysql_connect("master_IP","mythtv","password");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_select_db("mythconverg", $con);

//if you want all the files the next line is good. Otherwise see line after that
$myquery = "SELECT intid,title,filename FROM videometadata";
//I did it for a subset of files which is why I used LIKE to match part of the path in the filename field
//$myquery = "SELECT intid,title,filename FROM videometadata WHERE filename ". 'LIKE "%who%"';
$myquery_rows = mysql_query($myquery);
while ($myrow = mysql_fetch_array($myquery_rows)) {
  print $myrow['intid'] . " | " . $myrow['title'] . " | " . $myrow['filename'] ."\n";
  }
mysql_close($con);

Please don’t go running amok in your database and blame me for it getting screwed. Use mysqldump before running the update script. Although it should be pretty innocuous because you can always use mythfrontend to rebuild the videometadata database. Though you would lose any metadata you had input for your files. Happy hunting! Maybe I’ll port this to a proper scripting language like PERL or python. Or maybe someone’s nice enough to do it for the rest of us???

Leave a Comment :, more...

Western Digital Elements

by on Jul.11, 2010, under Uncategorized

So I bought a Western Digital Elements 1TB drive last week. For some reason it’s a mystery what’s inside these devices. I decided to disassemble, open up, take apart, dismantle, autopsy or whatever you call it so that I can document what’s inside. Mine which has the model number “wdbaau001hbk-01” on the bottom has a “wd10ears-00y5b1” drive in it, WD Caviar Green SATA/64MB cache 5400RPM. I think it’s a pretty enclosure, but not at all necessary. I apologize, I can’t find where I found instructions to open it. It’s pretty straight forward. Use a knife or something with a good edge to pry it open a little. Then I used a guitar pick to go around the edge and pry the clips along the inside. I’m going to do some crazy stuff to it, more to come. Maybe some pictures!

1 Comment : more...

Mythvideo now compiled

by on Mar.14, 2010, under Uncategorized

So, I switched to myth-0.22 awhile back because I finally got a sane database. No thanks to the mythtv guys, many thanks to the Gentoo guys for pointing out the bad behavior of mythtv not checking encoding formats and just assuming. I had been trying out the SVN version because 0.22 was broken in Portage. Long story short I haven’t been able to build mythvideo for months. Today I finally tried looking at the build log and internet searching. For reference here are the first few errors in the log file:
In file included from metadata.cpp:8:
/usr/local/include/mythtv/mythcontext.h:9:22: error: qptrlist.h: No such file or directory
In file included from main.cpp:18:
/usr/local/include/mythtv/mythcontext.h:9:22: error: qptrlist.h: No such file or directory
/usr/local/include/mythtv/mythcontext.h:13:23: error: qnetwork.h: No such file or directory
/usr/local/include/mythtv/mythcontext.h:13:23: error: qnetwork.h: No such file or directory
I stumbled upon someone else who couldn’t build that was getting similar errors to mine http://mythtv.org/pipermail/mythtv-users/2008-November/238546.html The problem was that the prefix for SVN is /usr/local/ whereas the ebuild prefix is /usr/ The quick and dirty solution:


mv /usr/local/include/mythtv /usr/local/include/mythtv-old
ln -snf /usr/include/mythtv /usr/local/include/mythtv

That solved the problem immediately, but I think the real problem is the ebuild. I checked the mythtv ebuild and the prefix is defined as /usr/, but the mythvideo ebuild does not have a prefix defined. I believe the solution is to define the prefix in the ebuild or make the symlink in the ebuild for mythtv.

Either way, I’m super-stoked! Now I can get back to encoding everything to something besides MPEG2 and watching it with mythtv instead of xine or mplayer.

Leave a Comment :, more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...