[mythtv-users] Recording FM radio using a Hauppauge PVR-500

Stephen Worthington stephen_agent at jsw.gen.nz
Mon Jun 17 04:04:26 UTC 2013


MythTV version: 0.26-fixes

My mother likes to listen to operas broadcast daily on a local FM
radio station, but she usually does not want to listen at the time
they are broadcast.  So I have set up recording on her MythTV box to
record FM radio from its Hauppauge PVR-500 card, which has an FM
tuner.  Originally, I was using the scripts from the "Fm Radio" page
on the wiki:

  http://www.mythtv.org/wiki/Fm_radio

but when I upgraded to Mythbuntu 12.04, the PVR-500 drivers seem to
have changed and locked out some of the access that was used by those
scripts, and I was unable to fix them to work again.  So I then wrote
my own scripts using the MythTV event system and the "Import test
recorder" tuner to do a similar job, effectively creating a virtual
tuner.  The new scripts have been working reasonably well for some
time, but they are a bit lacking in error handling and I have never
been completely sure of what I needed to do to the database at the end
of a recording.  But since they were working OK, I just left them as
they are.

Here are the scripts:

  http://www.jsw.gen.nz/mythtv/event-start-recording.sh
  http://www.jsw.gen.nz/mythtv/event-finished-recording.sh
  http://www.jsw.gen.nz/mythtv/event_test.sh

I put them in /usr/local/bin, and they are run from the MythTV events
"Recording started", "Recording finished" and "Any event"
respectively.  Use Setup->System Event Handlers to set them up.  The
event_test.sh script is just for debugging - it has an "exit 0" as the
first thing it normally does, which you need to comment out in order
to get a log of all events.

The scripts call another script:

  http://www.jsw.gen.nz/mythtv/ivtv_audio_fix.sh

which fixes a driver problem with the audio in the PVR-500 where it
sometimes mixes some of the TV audio or other audio inputs into the FM
audio (or vice versus).

I discovered last night that the scripts do not handle the situation
where a recording is manually stopped before the usual end time.  The
cleaners had been and had knocked the FM aerial out of the back of the
PVR-500 card, so last night's recording (and the ones for two weeks
back) were all just static.  I went to the FM radio recording that was
in progress and used the "Stop recording" command.  The recording
stopped, but immediately started again.  The same happened when I
deleted the current recording.  So it looks like I need to do
something more at the end of a recording to indicate that it is not
still in progress, otherwise mythbackend just restarts it.

Is there anyone who has knows what else I need to do to tell
mythbackend that the recording has finished, even though it has not
reached the endtime yet?  Is there anything else I have missed that I
should be doing at the end of a recording?

When I originally wrote the scripts, I also had a problem when I tried
to work out what recording directory MythTV was assigning the
recording to.  I never found a way of getting that information, as the
"Recording started" and "Recording pending" events always used to
report "GetPlaybackURL/UNABLE/TO/FIND/LOCAL/FILE/ON/crw-pvr" as the
directory for the recording, although they did give the correct
filename.  On looking at my event_test.sh log data from last night, it
seems that problem has been fixed in a MythTV update that was
installed here on 14-May-2013.  So I will need to revisit the scripts
to get them to use the path from the event, rather than just recording
to a fixed drive as I am currently doing.


More information about the mythtv-users mailing list