View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 14 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject: R5F27 MythFM / MythRadio
PostPosted: Tue Nov 20, 2007 12:29 am 
Offline
Joined: Sat Mar 18, 2006 3:21 pm
Posts: 70
Location: West Fargo, ND
Ok, I made lots of headway with MythFM. The implementation in the patch file is not perfect, so I'm considering redoing the implementation entirely with MythMusic.

This work is based on the work published here.

radio.diff.gz contains the main updated patch file.
radio10.diff.gz contains the main updated patch file, with frequency numbers divided by 10 so they are less than 65535, the maximum size of type integer.

Look at that Radio_Dickinson.fmd file. The FMD files are the only way to choose your radio station currently, and they need to be placed in your Music files directory.

v4l-dvb-1387dc197077.tar.bz2 is http://linuxtv.org/hg/v4l-dvb/archive/1 ... 77.tar.bz2
kmyth-0-20-fixes contains the SVN tree that exists in KnoppMyth R5F27.
For radio.diff.gz, 92100 represents 92.1 FM.
For radio10.diff.gz, 9210 represents 92.1 FM.

Some of the problems I'm experiencing with the current patches is that once I listen to the radio, my TV recordings on that card have no audio until I reboot. Even LiveTV on that card will contain no audio (I have 2 PVR-350's).

You can get the complete tarball that I'm working on and some patches from here.
If you would consider mirroring this stuff, please let me know.
Here is an explaination of the tree structure:

Code:
kmyth-0-20-fixes/                                          # SVN release-0-20-fixes base against revision 14463M.
kmyth-0-20-fixes/.svn/                                     # SVN info about branch
kmyth-0-20-fixes/kmfixes/                                  # Directory with various patches
kmyth-0-20-fixes/kmfixes/clearcache.patch                  # ClearCache patch
kmyth-0-20-fixes/kmfixes/icons1.zip                        # MythWeather icons #1
kmyth-0-20-fixes/kmfixes/icons2.zip                        # MythWeather icons #2
kmyth-0-20-fixes/kmfixes/icons3.zip                        # MythWeather icons #3
kmyth-0-20-fixes/kmfixes/icons4.zip                        # MythWeather icons #4
kmyth-0-20-fixes/kmfixes/mythweather-kmsvn.patch           # MythWeather patch
kmyth-0-20-fixes/kmfixes/knoppmyth_plugins-0.20.0-3.diff   # KnoppMyth Plugins patch
kmyth-0-20-fixes/kmfixes/old/                              # Files that are not to be used.
kmyth-0-20-fixes/kmfixes/knoppmyth_tv_0.20.0-11_km.diff    # KnoppMyth MythTV patch
kmyth-0-20-fixes/kmfixes/radio.diff                        # MythFM / MythRadio plugin patch
kmyth-0-20-fixes/kmfixes/radio10.diff                      # MythFM / MythRadio plugin patch with my customizations
kmyth-0-20-fixes/myththemes/                               # MythTV Themes (unchanged)
kmyth-0-20-fixes/mythplugins.cfg.sh                        # Script used for mythplugins ./configure
kmyth-0-20-fixes/mythplugins.orig/                         # MythTV Plugins (unchanged)
kmyth-0-20-fixes/mythplugins.km/                           # MythTV Plugins with KnoppMyth & MythWeather patches applied
kmyth-0-20-fixes/mythplugins/                              # MythTV Plugins with KnoppMyth, MythWeather, & MythFM patches applied
kmyth-0-20-fixes/mythtv.cfg.sh                             # Script used for mythtv ./configure
kmyth-0-20-fixes/mythtv.orig/                              # MythTV base (unchanged)
kmyth-0-20-fixes/mythtv.km/                                # MythTV branch with KnoppMyth patches applied.
kmyth-0-20-fixes/mythtv/                                   # MythTV branch with ClearCache & KnoppMyth patches applied.


If you want to help out in anyway with getting a good working version of this, please post here. I'm open to any patches or many other forms of assistance provided.


Top
 Profile  
 
 Post subject: Myth Radio
PostPosted: Tue Nov 20, 2007 10:23 am 
Offline
Joined: Mon Apr 23, 2007 1:45 pm
Posts: 405
Location: Fargo, ND, USA
ayourk
I have been interested a AM/FM radio function for KM also. For my use I was looking at RadioShark. Here are a couple of links that sparked my interest.
They may or not be usefully to your project.

Kradio a KDE radio application
http://kradio.sourceforge.net/index.html
Myth Kradio module Note: this is the same guy that wrote Mythfm
http://www.mythtv.org/pipermail/mythtv-users/2004-December/063460.html

RadioShark in Linux
http://javier.rodriguez.org.mx/index.php/2006/06/10/griffin-radio-shark-icecast2-on-debian-gnulinux/
Audio for RadioShark
http://wiki.linuxquestions.org/wiki/Audio

RadioMan
http://www.timespace.org/2004/12/14/radio-man-software/
RadioMan Java
http://freshmeat.net/projects/radiomanjava/

TVBox
Why not Minot?

_________________
TVBox
LinHES R8.6.1


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 20, 2007 2:20 pm 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi,

While all are trying to help ayourk, the link to the mythtv wiki has a simple hack that works with the 350 card. It says it was for the 150.
http://mythtv.org/wiki/index.php/Fm_radio

At least you can listen while you work :) but no level control, I had to open an xterm for alsamixer.

I don't think the x50 cards have AM tuners and besides the computer noise would be brutal.

Mike


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 21, 2007 8:24 pm 
Offline
Joined: Wed Mar 07, 2007 9:51 am
Posts: 173
Location: Uniontown, PA
ayourk,

Thanks in advance for working on the missing piece of the Myth puzzle! Ever since I've been tinkering with KM, I've been wanting to use the FM tuner on my Hauppauge 401 board.

Please keep us posted on your progress! :D


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 02, 2007 11:55 am 
Offline
Joined: Sat Mar 11, 2006 6:06 pm
Posts: 2
Any news on this?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 02, 2007 1:58 pm 
Offline
Joined: Fri Oct 20, 2006 12:04 pm
Posts: 905
Location: LA, CA
I had planned on doing some testing, but I'm unable at the moment. ayourk might need some testers...


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 02, 2007 3:37 pm 
Offline
Joined: Mon Nov 07, 2005 10:09 am
Posts: 153
I am busy for the next few weeks, but ... for years during basketball season I have the urge to record the video of the game with the audio from the radio.

I've never heard of anyone doing this and be able to watch and listen in near real time and with the audio synced due to different delays.

I've done it manually after the fact but sports aren't as fun if you have to wait until the end of the game to watch. Anyway, it seems like mythtv might already have what's needed with the built in audio sync controls.

I would like to help in a few weeks if I can. At least I could run some tests.


Top
 Profile  
 
PostPosted: Sun Dec 02, 2007 4:36 pm 
Offline
Joined: Sat Mar 18, 2006 3:21 pm
Posts: 70
Location: West Fargo, ND
I had heard reports that my webserver is inaccessible. If that is the case, I'd like to be sure I have everything on my side setup correctly. An 'nslookup www.cabrage.net' of the IP address of the webserver should be 71.32.26.140.

If this happens to you, please contact me because your IP address might be blacklisted or in a blacklisted IP address range in my OpenBSD firewall.


Last edited by ayourk on Mon Mar 03, 2008 7:53 pm, edited 2 times in total.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 02, 2007 8:08 pm 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi,

After following the link posted earlier that took me to the mythtv wiki where there are some little things that one can try for fm. The wiki said it was for the 150 card however, the fm tuner in the 350 card works also. It seems there is some control built into the ivtv driver already.

What I did was make a folder in my home mythtv called FMRadio, creative huh? In it I put a copy of the library.xml which I modified with a new button selection.

I added this to the bottom of the library.xml entries:
<button>
<type>MUSIC</type>
<text>FM Radio</text>
<action>MENU fmmenu.xml</action>
</button>


then I created a script called fmmenu.xml (most of this information is on the wiki)
<mythmenu name="FMMENU">

<button>
<type>TV_DELETE</type>
<text>FM Radio OFF</text>
<action>EXEC /usr/local/bin/mythfm_kill.sh</action>
</button>

<button>
<type>MUSIC</type>
<text> 93.3 - WSNE</text>
<action>EXEC /usr/local/bin/mythfm.sh wsne</action>
</button>

<button>
<type>MUSIC</type>
<text>103.3 - WODS</text>
<action>EXEC /usr/local/bin/mythfm.sh wods</action>
</button>

<button>
<type>TV_DELETE</type>
<text>FM Radio OFF</text>
<action>EXEC /usr/local/bin/mythfm_kill.sh</action>
</button>

</mythmenu>


Then I created a script called mythfm.sh (to add stations just repeat the elif block)
#!/bin/bash
# Control PVR-350 FM in Myth, 150-250?
if [ "$1" = "wsne" ]; then
# First, we'll kill off any other stream that may be playing
/usr/local/bin/mythfm_kill.sh
echo "I'm about to play:" $1
/usr/local/bin/ivtv-radio -f 93.3 &

elif [ "$1" = "wods" ]; then
# First, we'll kill off any other stream that may be playing
/usr/local/bin/mythfm_kill.sh
echo "I'm about to play:" $1
/usr/local/bin/ivtv-radio -f 103.3 &

else
exit 1
fi
exit 0


Next came the stopper tool mythfm_kill.sh

#!/bin/bash
# mythfm_kill
pkill -f aplay


Now that all the pieces are gathered, I made a simple installer that you run as root
install-mythfm.sh
#!/bin/sh
#
# install-mythfm.sh
# http://mythtv.org/wiki/index.php/Fm_radio
cd /home/mythtv/FMRadio
cp mythfm_kill.sh /usr/local/bin/
cp mythfm.sh /usr/local/bin/
cp *.xml /home/mythtv/.mythtv/
chown mythtv:mythtv /home/mythtv/.mythtv/*.xml
chmod a+x /usr/local/bin/mythfm*


At this point I run # sh /home/mythtv/FMRadio/install-mythfm.sh
This copies the xml files into the .mythtv folder which has priority over the default installed xml files. To activate, you should only have to exit the frontend and then restart it (alt m) If you go into the menu where your music is the radio button should be there and it should take you the station selections.

It is doubtful that most will have these particular stations, however the frequencies could be valid :) By having everything in the one location, you can edit the menus & scripts as needed for your choices then rerun the installer script.
Your mileage could vary, has not caused me harm not having a tuner or a tuner with out the fm. At least it will allow you to tune the Christmas tunes which was a big hit with my other half :)

The only issue I have is no f10/f11 control or remote volume control. What ever the last level was is while in music is what you get. An xterm will let you run alsamixer.

This tides me over until a real mythtv module is put together :) Also all files are preserved with a backup, simply rerun install script.
Mike


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 16, 2007 9:13 pm 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi,

There doesn't appear to be much interest in radio however, I did add a volume control which makes my wife happy.

I add these two buttons to my fmmenu.xml

<button>
<type>MUSIC</type>
<text> Volume ++ </text>
<action>EXEC /usr/bin/run-FM-volup.sh</action>
</button>

<button>
<type>MUSIC</type>
<text> Volume - - </text>
<action>EXEC /usr/bin/run-FM-voldn.sh</action>
</button>

And these call the these two scripts into action. I am sure it won't work for all but it doesn't cost anything to try and if it does, great.

The two scripts are identical except for a + or a - in the "echo' line.

run-FM-voldn.sh
#!/bin/sh
#
#Volume control for FM Radio tuner play
amixer sget -c 0 PCM,0|grep Left: |cut -b 24-25 >/tmp/pvu
echo $(($(cat /tmp/pvu)
-1))> /tmp/pvu
#cat /tmp/pvu
amixer sset -c 0 PCM,0 $(cat /tmp/pvu)


repeat for
run-FM-volup.sh changing the sign to a +

Place a copy of each into /usr/bin/ and make executable. Maybe add it to your installer script :)
Mike


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 29, 2008 7:51 am 
Offline
Joined: Mon Nov 07, 2005 10:09 am
Posts: 153
Can I leave the FMRadio of a pvr150 playing audio while going into my recordings and wathcing the video only of a recorded program?

I know it is very unlikely, and I'm not sure how many people would want this... they might want to use myth browser or gallery at the same time though.

I want to be able to watch a sports match video while listening to the radio broadcast of the play by play, but that involves some minor time shifting to sync the audio.

Thanks for working on this, pretty good. Someone will enjoy listening to the radio especially for a cool LIRC feature, and maybe eventually timed recording, timeshifting, or gallery screensaver viewing... etc features that eventually could show up.

A killer, but probably unauthorized use, feature would be "space shifting / p2p sharing of radio" so we could share local only programs at a distance... say on the road or to other users... I'm sure in some countries recording radio is probably not allowed, but streaming it to our own computers across the internet/country might be ok. Sports broadcasts are the only thing worth listening IMO that's not online for free now but it is free on local radio, and if your not local you have to pay a subscription or $6/game

Any feature this has beyond a $10 external stand alone radio would probably make more people interested, otherwise its just like a cheap radio sitting around the house.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 29, 2008 8:18 pm 
Offline
Joined: Wed Mar 07, 2007 9:51 am
Posts: 173
Location: Uniontown, PA
Time shifting of radio programs may be of value, since I would like to listen to some programs that I'm either at work or asleep to hear live.

ayourk: I am unable to see your site via fqdn or ip address. Using 'host www.cabrage.net' returns no servers could be reached.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 29, 2008 11:06 pm 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi,

Don't know what you can do with other myth options while the radio is active. You will have to simply road test it. I can tell you that if you try to record while the radio is playing you will not have video. I suspect that it is because of the switcher on the card for the two tuners (radio & tv). I have not tried to see if video input is still active.

It is nice to have the radio playing while going through the gallery.

I have changed the volume control script a little as I found that not all audio mixers are the same. Not that it was a big surprise. Also I like some visual feed back that I pushed a button. There is no rule that you can not change it to suit your own needs / wants. I also added it to my lircrc so I can control the volume from any menu.

If your mixer is laid out differently, there will be a few tweaks needed. Worse thing that will happen is it turns the volume to minimum and you have to run alsamixer to bring it back up. It is quite easy to adjust for different analog audio mixers. Not sure how it might work with a digital system.
Watch for line wrapping if you copy & paste!

run-FM-volup.sh
Code:
#!/bin/sh
# FM Radio volume up
lsmod |grep "ivtvfb "|cut -b1-6 >/tmp/tv
if [ $(cat /tmp/tv) <> "ivtvfb" ]; then
fontsize="26"
fontcolor="lightyellow"
else
fontsize="34"
fontcolor="yellow"
fi
export DISPLAY=:0
export FONT="-adobe-helvetica-bold-*-*-*-$fontsize-*-*-*-*-*-*-*"
echo "+ + >" > /tmp/tts
cat /tmp/tts | osd_cat --delay=1 --font=$FONT --shadow=3  --color=$fontcolor   
--pos=bottom --align=centre &
#Volume control for FM Radio tuner play
amixer sget  -c 0 PCM,0|grep Left: |cut -b 24-25 >/tmp/pvu
#cat /tmp/pvu    #used for testing
# must linit range from 10
if [ "$(cat /tmp/pvu)" -lt "10" ]; then
        echo "10" >/tmp/pvu
fi
echo $(($(cat /tmp/pvu)+1))> /tmp/pvu
export FONT="-adobe-helvetica-bold-*-*-*-$fontsize-*-*-*-*-*-*-*"
cat /tmp/tts | osd_cat --delay=1 --font=$FONT --shadow=3  --color=$fontcolor  --
pos=bottom --align=centre &
amixer sset  -c 0 "PCM",0 $(cat /tmp/pvu)


run-FM-voldn.sh
Code:
#!/bin/sh
# FM Radio volume down
lsmod |grep "ivtvfb "|cut -b1-6 >/tmp/tv
if [ $(cat /tmp/tv) <> "ivtvfb" ]; then
fontsize="26"
fontcolor="lightyellow"
else
fontsize="34"
fontcolor="yellow"
fi
export DISPLAY=:0
export FONT="-adobe-helvetica-bold-*-*-*-$fontsize-*-*-*-*-*-*-*"
echo "< - -" > /tmp/tts
cat /tmp/tts | osd_cat --delay=1 --font=$FONT --shadow=3  --color=$fontcolor  --
pos=bottom --align=centre &
#Volume control for FM Radio tuner play
# must limit lower range to 10 min
amixer sget  -c 0 PCM,0|grep Left: |cut -b 24-25 >/tmp/pvu
cat /tmp/pvu    #used for testing
if [ "$(cat /tmp/pvu)" -lt "10" ]; then
   echo "10" >/tmp/pvu
   fontsize="14"
fi
if [ "$(cat /tmp/pvu)" -gt "10" ]; then
   echo $(($(cat /tmp/pvu)-1))> /tmp/pvu
fi
export FONT="-adobe-helvetica-bold-*-*-*-$fontsize-*-*-*-*-*-*-*"
cat /tmp/tts | osd_cat --delay=1 --font=$FONT --shadow=3  --color=$fontcolor  --
pos=bottom --align=centre &
amixer sset  -c 0 "PCM",0 $(cat /tmp/pvu)


If you run $ amixer as a simple command, you should see something similar to this:
Simple mixer control 'PCM',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 63
Mono:
Front Left: Playback 51 [81%] [on]
Front Right: Playback 51 [81%] [on]


And with a careful review, should be able to see where various script items come from. The reason for the 10 as a low limit is that when the levels drop to a single digit, you stand the chance of picking a non numerical character as the line shifts left which will make the script fail. Hard to add or subtract 1 to / from a symbol :)

ps ax shows
sh -c aplay -f dat < /dev/video24
aplay -f dat
so should be able to pipe / tee that into a file if desired.

This is not for everyone but I grew up listening to the radio and I still enjoy it.
Mike


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 01, 2008 6:12 am 
Offline
Joined: Sat Mar 18, 2006 3:21 pm
Posts: 70
Location: West Fargo, ND
larrybpsu wrote:
Time shifting of radio programs may be of value, since I would like to listen to some programs that I'm either at work or asleep to hear live.

ayourk: I am unable to see your site via fqdn or ip address. Using 'host www.cabrage.net' returns no servers could be reached.

I've moved recently and have had difficulty getting it to resolve again. The current IP address is 71.32.26.140


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: Bing [Bot] and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu