Kodi Community Forum

Full Version: Icons from MythTV to kodi livetv
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I read several posts, unfortunately I'm still unable to get then icons from my MythTV backend icons to kodi livetv. Any suggestions would be greatly appreciated.
Raspberry pi2
Openelec from millhouse
Ubuntu with MythTV
HDHomeRun
Scheduledirect
This is a fun one that pops up all the time and even got me just the other day having rebuilt the master backend for the first time in ages so I'll share.

When running mythtv-setup to configure the backend and channels, it is executed in the context of the user currently logged in and stores the icons in '/home/<logged_in_user>/.mythtv/channels'. From 0.27 onwards, the myth DB no longer stores the path of the icons, only the filename. The backend now looks at the home directory of the user that runs the backend daemon. That user is typically 'mythtv' on Ubuntu systems.

First, be sure the icons really aren't hanging out in the proper directory with improper permissions or somesuch using:
Code:
sudo ls -l /home/<backend-user>/.mythtv/channels

If that spits out all the icons, the <backend-user> does not have read permissions on the icon files.
Simply fix the permissions and you are done. If that command returns nothing or a 'directory not found', continue on.

Assuming mythtv-setup was ran as the currently logged in user, verify that the icons are present:
Code:
ls -l ~/.mythtv/channels

If that returns all the expected icons, continue on. If not, log out and log back in as the user which was used to execute mythtv-setup and try the above command again. Do not continue until you are logged in as the user that originally ran mythtv-setup. NB: Running mythtv-setup as a user different from the one originally used can have unintentended consequences.

Finally, ensure sure the target does not already exist, adjust permissions so the backend can see the icons, and create a symbolic link to where the backend expects the icons:
Code:
sudo rm /home/<backend-user>/.mythtv/channels/* && sudo rmdir /home/<backend-user>/.mythtv/channels
chown -R :<backend-user> ~/.mythtv/channels && chmod -R g+r ~/.mythtv/channels
sudo ln -s ~/.mythtv/channels /home/<backend-user>/.mythtv

Check the results for good measure, noting the trailing slash which is necessary to list the contents of a linked directory rather than the link itself:
Code:
sudo ls -l /home/<backend-user>/.mythtv/channels/

If pvr.myth has been setup properly, the icons will be automagically pulled in. It is worth mentioning that the backend will take some time to recognize that the icons have been linked to the proper directory and may even do so piecemeal so have a cuppa if they don't all show up at once. For missing channel icons, try the built-in webserver to help diagnose
Code:
http://<backend_IPaddr>:6544/Guide/GetChannelIcon?ChanId=<chanid>
.

The mythtv wiki has a section in the Channel Icons page but makes reference to re-running mythtv-setup as the backend-user. Having two seperate backend configs (the .mythtv dir) will at the least make future troubleshooting awkward and worst, depending on your distribution, may break things in the backend. My method will also carry forward any icons added by mythtv-setup without any further steps needed.
Thanks for your detailed explanation, I tested it yesterday, it sounds like I have permission issues, I created the login user as mythtvuser, sorry being new to Linux, what is the proper command to fix it, should I also be part of a Linux group for permissions?
Thanks
Try adding the channel icon folder to your directory paths...
(2015-03-30, 18:39)mikebetz42 Wrote: [ -> ]Try adding the channel icon folder to your directory paths...

The OP indicated he was a new linux user so this solution might be a roundabout way to accomplish this. I'll follow up his last msg with a more direct answer.
(2015-03-30, 16:55)alphatech69 Wrote: [ -> ]Thanks for your detailed explanation, I tested it yesterday, it sounds like I have permission issues, I created the login user as mythtvuser, sorry being new to Linux, what is the proper command to fix it, should I also be part of a Linux group for permissions?
Thanks

First off, no apoligies needed, we all start somewhere. In fact, you should take pride in what you've accomplished so far. Kodi can be a lot for a new user to take in. Furthermore, MythTV is the 800 pound gorilla of the media/PVR world. I tip my hat to you sir. With that said...

We now know that your regular login user is 'mythtvuser'. You asked "what is the proper command to fix it?" While we could change the regular login users name, that would create a lot of other work in the long run so we'll just leave it be. To add some context to my instructions above, a little explanation is in order. In linux/unix, whenever you see a tilda (~), that's just *nix shorthand for '/home/<logged_in_user>' or in your case, '/home/mythtvuser'. Effectively, where the above instructions say 'ls -l ~/.mythtv/channels' we are really telling it 'ls -l /home/mythtvuser/.mythtv/channels'

Moving on, we need a little more info about how myth was installed. You'd indicated that you are using Ubuntu. Did you:
  1. install Ubuntu and then install mythtv, perhaps following a guide, or did you
  2. use the mythbuntu distribution which automates the install of myth/mysql/apache/etc?
If you used b) mythbuntu, the automated install creates a system user and group, both named 'mythtv'. When you copy/paste the code from my original post, you would replace all instances of '<backend-user>' with 'mythtv' (don't type the " ' " marks).

If you used method a) to set up myth, replace <backend-user> with whatever user the guide had specified myth to install and run as.

A simple way to determine the backend-user is to glean its name from the list of home directories with:
Code:
ls -l /home

Another way we can determine the backend-user is by trying the command:
Code:
cat /etc/passwd | grep myth
which translates to "show me the contents (cat) of the users file (/etc/passwd) but only show me the entries that have the string 'myth' in them ( | grep myth)." You will definitely see your regular user, mythtvuser, and likely see the <mythtbackend-user> in the output as well.

Running all the commands in my above post while logged in as 'mythtvuser' will solve the channel icon issue with no further changes needed.

Lastly, you'd asked "should I also be part of a Linux group for permissions?" While this isn't necessary, adding your regular user to the system user which runs the mythbackend can be helpful down the road. This is accomplished with:
Code:
sudo adduser mythtvuser mythtv
would add regular user 'mythhtvuser' to the backend system group 'mythtv' using the assumption that the backend is running as the user/group 'mythtv'. adjust the group accordingly if you've determined it is running as something else. NB: adding a user to a group will only take effect after you logout and back into and/or reboot the system.

To see all the groups on your system, use:
Code:
more /etc/group
...where the more command, like cat, shows you the contents of a file but only as much as your current window allows, pausing until you tell it to show you more of the file. Use the enter key to advance through the file one more line at a time or spacebar to see the next screen's worth. The syntax of the output is group_name:password:GID:user_list. Passwords are typically encrypted and denoted with the letter 'x' when this is so, GID is the group id # (<1000 are system groups, >=1000 are user groups), and user_list can be nonexistent, a single user, or a comma-seperated list of several users.

Now here comes the hardest part for new users to wrap their heads around. Adding a user to a group gives you the permissions of the group, not the groups owner. Example: the home directory of the user 'mythtv' has permissions 755, the user 'mythtvuser' is a member of the group 'mythtv'. mythtvuser gets group member permissions rwxr-xr-x (read and execute), as opposed to the directory owner permissions which gets rwxr-xr-x (read, write, and execute). If the group member mythtvuser also needed write access to the directory and all of it's subdirectories...
Code:
sudo chmod -R g+w /home/mythtv
...would accomplish this. It's worth noting that not only would mythtvuser gain the new priviliges but so would every member of the mythtv group.

Fun, right? It get's better...an alternate way to do the very same thing is instead of 'g+w', using the octal notation '775'. Why? Because....reasons. I only bring that up because you are bound to run into a tutorial which uses octal versus explicit.

For an in depth look at chmod (or any other linux command for that matter) use:
Code:
man <command>
The usefulness of the man command cannot be stressed enough. The output will seem arcane at first but you will get used to it and will become your goto helper. When you are told to RTFM, the man command is what they are refering to in the *nix world. Protip: Googling "man <command>" may yield prettier output than running man in your shell but always remember that google may yield stale results or even no results. Your system is always the authoritative answer. That said, I google-man often to ease my eyeballs.

HTH. I apologize for the verbose writeup but it's purpose is not only to help solve your particular problem but also serve as a reference to other new linux users that come down this road and for my growing knowledge base of linux tuts. From what I've been seeing on the XBMC, Kodi and RaspberryPi forums and subreddits, were getting quite a few more new users than ever before. If it came off as a bit condescending, that was purely a function of my assumption you are completely new at this and we all know the risk of making assumptions.
I have to confess this is one of the few posts that I have much enjoyed reading. You showed a dedication to teach other people in a very simple way, understood exactly my struggle and showed me step by step how to fix it. Thanks again for all your help.

On a side note, I have a VMware, and I installed it using the ubuntumythtv already built. I could reinstall it again if you think in the long run I will be better off. For now, I will use your instructions and post back on it.
You're most welcome. When I started down the open source path over a decade ago, my successes were only possible due to the very nature of an open and sharing community although it didn't hurt to have had some rudimentary admin experience with some pre-cambrian era commercial *nixes <insert GetOffMyLawn! joke here>. But in all seriousness, I'm at a point in my life where I now have time to spare so I've registered on this and a few other fora and will be much more active giving back to the communities I have benefitted so greatly from in the past.

With regards to a reinstall, if you're up for it, do it. Here's why: You clearly show an eagerness to try something new (especially having tackled a vmware approach), the aptitude to effectively solve problems and a willingness to stuff it all and try over. If you go for a "do over" you're going to learn a whole lot more. If you have a spare machine, I recommend you forego the vmware and try a distro on bare metal because you'll be exposed to more steps of the install and config process and learn much more than you would with the virtualized "out-of-the-box" experience. Virt is usually reserved for either doing risky things or just dipping your toe in the water to see if you like the temperature of an app or new distro. You jumped into the deep end, IMO, and kept afloat. You're ready for the real thing.

No need to go balls-out and gentoo/debian crazy as the developers do. You would learn more but have an extremely steep learning curve. Stick with what you've already gleaned and crank up a mythbuntu install on a spare box* with a reasonable hard drive (200gig will do) to get it rolling. This will bring up a proper linux/apache/mysql/php (LAMP) environment with a ready-to-configure mythtv install. Get that to running to where you have a functioning schedule using mythweb, can record some shows, and play them back with the myth-frontend. Myth is a monster compared to Kodi and can get your head spinning when you start to factor in storage, recording and playback groups, especially pre-planning to use with Kodi (hint: recording groups are going to be exposed to the kod.pvr.myth connector). All during this learning phase, you should *not* plan on using it as a daily driver because you will break it. Repeatedly. If what you currently have running in vmware is working for you now and can afford the processor cycles and leave it on 24/7, leave it as your daily driver.

Hint: when installing mythbuntu, use 'myth' rather than 'mythtvuser' as your regular user login. your fingers will be sooooo thankful. AnotherHint: when setting up the myth backend, completely ignore it's music, photo and video plugins configuration/storage. Don't even mess with the default storage groups for them. Kodi will handle all those much better. All you want from myth is a PVR/liveTV backend. When you're at a comfortable place with a solid myth config, you can add monster storage into the mix either remotely with NFS or Samba to another machine/NAS or add a multi-terabyte drive to your fstab. I use a combination of both. My recordings/livetv are locall to the backend, all of my docs/photos/music/personalvids are on a remote NAS where I have the expensive enterprise-class drives with a proper backup config.

NOW you can feel free to add Kodi to it as a frontend if that's how you want to use the machine. Just keep in mind that if you are storing recordings locally on the master backend machine you'll need to take into account the noise of the harddrive heads seeking around all the time. that may or may not be a deal breaker. Adding Kodi is a snap. Just do a 'sudo apt-add-repository PPA:team-xbmc/stable' to pull in Kodi from ubuntu's Launchpad (Kodi is not in the official *buntu repos) and do the same Janbar's pvr.mythtv PPA. Pull them in with 'sudo apt-update && sudo apt-install kodi kodi-pvr-myth', launch Kodi, season to taste.

A good tech or engineer will always divvy up a job into logical tasks, consider how each will impact the other, prioritize them and then focus on just the one at hand. Well, in my experience, the successful ones that value their time do.

* the most common newbie mythtv question to date on the mythtv-users-l is "What's the minimum hardware requirements?" which is of course a loaded question. following is an example of what is a bare-minimum machine for my situation: master backend with apache/mysql capturing from a motorola DCH-3200 cable box over firewire and a 1st gen Silicon Dust HDHR dual-tuner ATSC with an antenna in my attic ~15 miles from the John Hancock and Sears Tower. it is also a part-time, lightly used Kodi frontend. the hardware is a measly single core Athlon64 +3800 clocked at 2.2GHz on a funky-ass nForce-4 motherboard loaded with an ancient 80GB western digital JB as /boot, swap and /, a western digital 1TB green for /media/recordings and /media/livetv, 2GB of low-end DDR2 ram and an nvidia 9800GT flawlessy driving an HDMI hi-def display and 5.1 receiver via passthrough spdif all fed by a seasonic 340 watt power supply. it will floor the CPU and heat up the crawl space (it and the cable box are remoted next to the basement guest room) when playing 1080 because even though the 9800GT is the bare minumum for GPU accelerated playback (VDPAU), this one is AGP which doesn't have the bandwidth for VDPAU. with that said, *any* Intel NUC with comparable RAM and 4500 or greater graphics could do the very same job although i'd lose my crawl space heater and half the airfare to my next carribean dive trip Sad
I learned more from you in two days than in 2 months of my own. Very much appreciated. You also make people comfortable asking questions. If you don't mind I will continue to ask more questions until you have enough of it Confused
I have built another VM before your comments about it, although I agree with you that I should start with simple, I already have one VM in place. I installed another ubuntumuthtv with 8 cpu, 32 ram, what I found interesting was that with same configuration other than more hd, ram and cpu, live TV on rpi2 was shuttering while this one that I have right not is not. Do you know what it could be?
Do you recommend any good Linux books, especially in pdf?
Feel free to ask away (refer back to paragraph 1 in Post #8) but we've wandered very far away from missing channel icons. Straying off topic is frowned upon in just about any forum or mailing list. From here on it would be good form to open a new thread for each specific problem in the appropriate place so that a) other contributors can see them and weigh in and b) other users can easily find answers to same or similar issues (some tips below). Unlike some other new users that wander in like a snarling wet dog at a picnic, you've shown you are willing and able to help us help you which is A Big Thing. I've added you to my buddy list so as to keep tabs on your progress and offer advice when I can :thumbsup:

Moving on, it looks like you are comfortable virtualizing, which is fine, esp if you have tall hardware to run VMs on. My recommendation still stands, though. How about building your very own vm container from scratch using the tips from above? Best of both worlds...no new hardware, lots of new experience! You'll still have the safety net of making snaphots before making radical changes. By creating an empty machine and building a mythbuntu instance from ISO, you still don't have to worry about the intricacies of bringing up apache, then mysql, then php, NFS/samba/vnc/adnauseum 'cuz mythbuntu's got that covered. You can dive into those individually another time maybe using a different distro if learning stuff is your end goal. And before I forget, you may want to have a look at this reddit thread regarding vmware configs. Depending on your host hardware, you may be able to make some significant optimizations.

With regards to your RPi question, I'm a little confused. Is it a physical, real world Pi or is it a VM? If so, is it a container you obtained off the net or did you create one from scratch? What version of Kodi is on it? I could give direct answers straight away if that info were already here. On the up side, you did provide much of the requisite info in post 1 for the missing channel icons so here's your Scoobie snack:
  • Give the Kodi FAQ for each environment you plan on working with a complete read so you have an idea of what's been repeatedly asked/answered in the past
  • Do the same with the MythTV FAQ and MythBuntu support page
  • Before posting a topic when you have a new issue, give the applicable FAQs a quick re-read, check the Stickies section of each applicable (sub)forum, give the Forum Search a try (usually located in the top right of most forum software) or better yet, try a google search in the form "site:forum.kodi.tv search+criteria+here"
  • Search and consider joining a projects mailing list if it exists...the MythTV forums are barely a year old while the mythtv-users-l goes back to 2003 (not a typo, that's 12 years worth)
  • When searching doesn't provide the solution to your issue, first try to identify whether it's a Kodi problem, a Myth problem, a pvr.myth addon problem, or an Ubuntu/other distribution problem and post your topic in the corresponding forum
  • Give the forum rules a good read, esp. section 2.3 on posting and section 3 on asking smart questions. Richard Stallman's quintessential take on this can be a bit droll and over the top but it's there if you want
  • When you do create a new topic, check the forum or subforum stickies for posting requirements such as @allthekiller's excellent guidelines in the Linux subforum (adjust accordingly when posting on myth/ubuntu/other sites)
  • Have a look at the MyCode markup reference to se how easy it is to type tags straight into your posts rather than using the mouse and toolbar
How about: You open a new topic at Raspberry Pi subforum with a title something like "[VMware] LiveTV Stuttering on RPi2 VM" where - as penance for letting this thread wander so far - I put up some tutorials in the appropriate places with links back to this thread for historical context. That way, the useful yet off-topic users/groups/permissions/mythbuntu information isn't buried within a thread titled Icons from MythTV to kodi livetv.

edit: same disclaimer as before, the verbosity isn't meant to be condescending as I'm fairly certain you are already versed in netiquette, rather this seemed like an opportunity to put thoughts on paper for future use elsewhere
edit2: I just noticed that Edit Signature has finally appeared in my user control panel. Oddly, it was not there until just a bit ago..maybe it was post-count restricted. I'll be adding my hardware/distro/kodi/myth/blah info down there so in the future I won't need to re-type all that when I have issues that need asking
(2015-03-30, 20:54)StrvnMrvn Wrote: [ -> ]
(2015-03-30, 18:39)mikebetz42 Wrote: [ -> ]Try adding the channel icon folder to your directory paths...

The OP indicated he was a new linux user so this solution might be a roundabout way to accomplish this. I'll follow up his last msg with a more direct answer.

Sorry, I ment storage group...

MythTV Drive #1:
Directories: myth-dvr:/home/myth-dvr/.mythtv/channels, myth-dvr:/var/lib/mythtv/livetv
Thanks to all for the fantastic help.
(2015-04-01, 18:46)alphatech69 Wrote: [ -> ]Thanks to all for the fantastic help.

I agree. I asked here and in several different forums and after several months, finally gave up. Within 10-15 minutes I was up and running

Thanks for asking and thanks for the replies
After 2 hours this post fixed it for me.

http://forum.kodi.tv/showthread.php?tid=...thtv+icons

Basically just open mythtv backend setup and create a storage group called "ChannelIcons" that links to .mythtv/channels

Restart and everything works.

Apparently in mythtv .27 the storage group was removed and the kodi client still looks there.
(2015-09-09, 05:06)Vinnie881 Wrote: [ -> ]After 2 hours this post fixed it for me.

http://forum.kodi.tv/showthread.php?tid=...thtv+icons

Basically just open mythtv backend setup and create a storage group called "ChannelIcons" that links to .mythtv/channels

Restart and everything works.

Apparently in mythtv .27 the storage group was removed and the kodi client still looks there.

Hi, not exactly. The kodi client asks icons from your backend using the api services, so it doesn't look in a hardcoded path.

Migrating your backend from 0.26 to 0.27 , all yours channel icons path was invalidated because 0.27 no longer uses the old storage group "ChannelIcons". But now you have re-created the storage group which was deleted by the mythtv upgrade. To resolve your issue with the right way, you should remove again the old storage group, and update the icon path for yours channels using myth-setup or directly in the database.
I had the same issue 2 years ago and i had to update the path for all of my channel icons: Since 0.27 don't specify any path, and simply the field "icon" should contain the name of the icon file without any path. By default the backend will have a look in folder .mythtv/channels.