Radio channels showing under "Live TV" and not "Radio"
#1
Hi all..

For some reason using mythtv as my backend, my radio stations are showing under LIve TV and not under Radio, TVHead split them out automatically, is there a setting or something that flags the channel not being a tv channel? I've tried adding them to a group called "Radio"' in the hope that it would flag them as radio channels - it didn't work...
Reply
#2
Ok, no one? So i presume the "Radio records" are flagged as Radio somehow in the Kodi Database? I’ve looked at the channel table in the Myth DB and the records are flagged as "audio" (i think that was the field name, i can't recall) appropriately.

I was looking at this: http://kodi.wiki/view/Databases to see if there was some kind of Channels/EPG Table within Kodi, but couldn’t find anything relevant. The data must be held somewhere in Kodi, I just need to identify it and flag it accordingly, don’t i?
Reply
#3
How are you getting the radio stations? Through a tuner or streaming via the web?? What's your setup?

I would like to have live radio in Kodi myself..
Reply
#4
Hi,

Via a DVB S tuner, in the UK they are broadcasted via satalite using the Freesat platform, you can also get the Radio channels using DVB T via the Freeveiw platform.

I'm recieveing the radio channels ok, but they're grouped under my Live TV menu where as I'd prefer them under a separate heading.

I found a TV24.DB file (I think it was 24?) under .Kodi/userdata/databases and with in one of the tables was a field called BlnRadio (or somthing very similar), I flagged the radio records as true . In the hope that this would make Kodi recognise that they are Radio channels.... But still no joy. I'm not even sure that doing what I want to do is possible with the Mythtv addon!
Reply
#5
At present mythtv backend does not have a Services API method which identifies a channel as Radio or TV, so pvr.mythtv sets all channels as TV in Kodi.

If you really want to have Radio under a separate group, still within Kodi TV section, you could achieve this by setting up different Video sources in Mythtv backend, say Freesat-Radio and Freesat-TV with only the channels you want in each Video source. Kodi will then allow you select which group to view within TV channels.

I have two Video sources set in my mythtv backend Freesat and Freeview

Mike
Reply
#6
Mike - that's great thanks, I thought I was going mad!

I shall try out your suggestion, I was planning on adding another DVBT tuner so I can view the additional Freeveiw channels that arnt included in the Freesat lineup anyway.
Reply
#7
Looking at the MythTV addon code I think it could be modified to allow "Radio" stations to be moved to the Radio section as a workaround.  Here is what I'm thinking:

1. In the channel configuration add a tag to the channel name such as "[RADIO]". for example if you have a channel called "WLS-FM" rename it to "WLS-FM[RADIO]"
2. Update the Addon code to have the IsRadio() and Name() function look for this tag and handle it appropriately.
3. The IsRadio() function could be like:
cpp:
bool MythChannel::IsRadio() const
{
    if (m_channel)
    {
        std:Confusedtring theName = m_channel->channelName;
        std:Confusedtring keyword = "[RADIO]";
        std:Confusedize_t found_radio = theName.find(keyword);
        if (found_radio != std:Confusedtring::npos) {
            return true;
        }
        else {
            return false;
        }
    }
    else {
        return false;
    }
}
This would look for the tag and return true if it's found.

4. Name() as:
cpp:
std:Confusedtring MythChannel::Name() const
{
    if (m_channel) 
    {
        std:Confusedtring theName = m_channel->channelName;
        std:Confusedtring keyword = "[RADIO]";
        std:Confusedize_t found_radio = theName.find(keyword);
        if (found_radio != std:Confusedtring::npos) {
            return theName.replace(found_radio, keyword.length(), "");
        }
        else {
            return theName;
        }
    }
    else {
        return "";
    }
  //return (m_channel ? m_channel->channelName : "");
}

This would look for the tag and remove it so that the name would get sent to Kodi as the base name without the tag.  

Unfortunately I haven't been able to compile test versions yet to see how it will work.  I'll keep working on getting a development environment setup, but in the meantime does anyone with a working dev setup want to give it a whirl.  

Dave
Reply
#8
I was able to compile and test under Ubuntu.  It works how I was hoping.  

Now I need to figure out how to get it into the Android Build.
Reply
#9
This made it into the pvr.mythv client since December 2017 (4.16.0 and later).
Channels with a Callsign including -[RADIO^] are now identified as radio channels in kodi :-).

Here in the UK this doesn't appear to happen by default, so you'd need to edit the channel callsigns manually in channel editor or execute an SQL command when logged into the mythconverg sql database.

First check you have a pattern that finds just the radio channels you want to change first, e.g.:
sql:
select channum,callsign,name from channel where callsign like "%Radio%"; 

then when you're happy the 'where' clause is finding just radio channels, change their callsigns... 
sql:
update channel set callsign=concat (callsign, ' -[RADIO^]') where callsign like "%Radio%"; 

... restart mythbackend to make sure it is using the new callsigns and you're away.
(NB: you will need to re-do this process after re-scanning channels as it will reset the callsigns)

I haven't managed to convince this WIKI to print RADIO in square brackets without a ^ before the ] character because it then thinks it is some kind of formatting. You will need to remove all the ^ characters from the SQL in this post before it works sense. Sorry....
Reply
#10
A better solution for those of us in the UK on DVB-S or DVB-S2, as all radio stations are given a channum in the 700 series:

sql:
update channel set callsign=concat (left(callsign,12), '-[RADIO^]') where channum like "7__";

(Same note about square brackets and the ^ character applies)
Reply
#11
Just spotted an error with my two previous posts. There was a space between the - and [RADIO which meant radio stations weren't being recognized. Posts fixed.
line of code which does this is: 
Code:
bool MythChannel::IsRadio() const
{
  // Check for keyword to move channel to "Radio" group in the channel's callsign
  // If "-[RADIO]" is found then return true else return false
  return (m_channel ? ((m_channel->callSign.find("-[RADIO^]") != std::string::npos) ? true : false) : false);
}
(and yet again I have to add a ^ character to keep the wiki happy. Anyone know how to fix this?)
Reply
#12
Many thanks to those who have contributed to this thread - I now have my 'radio' and 'tv' channels nicely separated :-D

One more question / issue though - last night I set a couple of radio programmes to record, and this morning I see that the recordings are shown in the 'tv/recordings' section, and my 'radio/recordings' section is empty.

Is anyone else seeing this? Any ideas on a resolution?

George
Reply
#13
(2018-05-16, 09:23)georgep56 Wrote: I know this is an old thread. However I think there is a different solution implemented in MythTv to identify the various services. The channel table now includes a column Service_type.
This is the associated ticket for MythTV: https://code.mythtv.org/trac/ticket/8774. The hack to change the callsign is not very elegant (but I understand at the time it was the best solution) as MythWeb is using the callsign to identify a channel. And the callsign is only 20 characters length, so it's not alway possible to append [RADIO] to the callsign without truncating the real callsign. 
Reply

Logout Mark Read Team Forum Stats Members Help
Radio channels showing under "Live TV" and not "Radio"0