How to build a MythTV v33 system for a Raspberry Pi 4

For discussion of topics specific to MythTV on Raspberry Pi devices
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: How to build a MythTV v32 system for a Raspberry Pi 4

Post by jfabernathy »

Okay, sudo removed from OP

EDIT: I had time today after the most recent edits to the OP to test build following these instructions and they still work to build a combo FE/BE.
JohnMythOTA
Newcomer
Posts: 1
Joined: Fri Oct 28, 2022 3:04 pm
United States of America

Re: How to build a MythTV v32 system for a Raspberry Pi 4

Post by JohnMythOTA »

I have a Raspberry Pi 4b with 4GB RAM, using HDHomeRun FLEX 4K tuner.
Currently I am using a 2.5" laptop 1 TB hard drive with a usb3 to sata adapter to run myth backend only.
After following these directions everything is working well.
The build and install worked perfectly.
But I am using ATSC OTA EIT for the program guide listings.
Now I would like to use the "Black Box" external tuner mythhdhrrecorder.
After following directions for mythhdhrrecorder I cannot get it to work.
Below is the error from backend.log

CoreContext recorders/dtvchannel.cpp:289 (SetChannelByString) DTVChan[2](/usr/local/bin/mythhdhrrecorder -d 0 --use-cloud-discovery): SetChannelByString(2_1): Failed to initialize multiplex options

I am wondering if this will not work with MythTV version 32.
Any ideas how to get mythhdhrrecorder working?

John
Qmann
Newcomer
Posts: 10
Joined: Fri Dec 16, 2022 10:55 pm
Location: Behind enemy lines
United States of America

Re: How to build a MythTV v32 system for a Raspberry Pi 4

Post by Qmann »

I'm also looking to upgrade my age old HDHomeRun dual tuner to a newer FLEX 4K tuner, so I am curious if anyone is able to make the mythhdhrrecorder work well?
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: How to build a MythTV v33 system for a Raspberry Pi 4

Post by jfabernathy »

I updated these instruction for v33. To get the best picture you still need to run from the console and not the Desktop Environment. I find that the Ubuntu 23.04 for RPI4 or the EndeavourOS for RPI4 are the best way to build a RPI4 with superior pictures over the Raspberry Pi OS 64 bit.
dagnygren
Junior
Posts: 18
Joined: Thu Aug 04, 2016 12:24 pm
Finland

Re: How to build a MythTV v33 system for a Raspberry Pi 4

Post by dagnygren »

Hi!

Installed the myth-light deb:s as told in the above instructions and everything else works excep 1080 playback, which will just stay there and say "Wait..." .

The log contains:

Code: Select all

2023-05-31 20:27:58.422386 I [1949/1949] CoreContext mythvideoprofile.cpp:446 (LoadBestPreferences) - VideoProfile: LoadBestPreferences(1920x1080, 25.000, 
h264)
2023-05-31 20:27:58.422413 I [1949/1949] CoreContext mythvideoprofile.cpp:471 (LoadBestPreferences) - VideoProfile: LoadBestPreferences result: priority:1 
width: height: fps: codecs: 
2023-05-31 20:27:58.422424 I [1949/1949] CoreContext mythvideoprofile.cpp:476 (LoadBestPreferences) - VideoProfile: decoder:v4l2-dec renderer:opengl-yv12 d
eint0:medium:shader deint1:medium:shader cpus:4 upscale:bilinear
2023-05-31 20:27:58.422495 I [1949/1949] CoreContext mythdrmprimecontext.cpp:66 (GetPrimeCodec) - DRMPRIMECtx: Found FFmpeg decoder 'h264_v4l2m2m'
2023-05-31 20:27:58.422529 I [1949/1949] CoreContext avformatdecoder.cpp:1428 (InitVideoCodec) - AFD: InitVideoCodec ID:h264 Type:Video Size:1920x1080
2023-05-31 20:27:58.422584 I [1949/1949] CoreContext mythplayer.cpp:697 (SetFrameInterval) - Player(0): SetFrameInterval Interval:40000 Speed:1 Scan:Progre
ssive Scan (Multiplier: 1)
2023-05-31 20:27:58.422604 I [1949/1949] CoreContext mythvideoscantracker.cpp:263 (DetectInterlace) - ScanTracker: DetectInterlace(Detect Scan, Interlaced 
Scan, 25, 1080) ->Interlaced Scan
2023-05-31 20:27:58.422630 I [1949/1949] CoreContext avformatdecoder.cpp:2427 (ScanStreams) - AFD: Using v4l2-dec for video decoding
2023-05-31 20:27:58.422633 I [1949/1949] CoreContext mythv4l2m2mcontext.cpp:204 (SetDecoderOptions) - V4L2_M2M: Setting number of capture buffers to 6
2023-05-31 20:27:58.456024 I [1949/1949] CoreContext avformatdecoder.cpp:2508 (OpenAVCodec) - AFD: Opened codec 0x559185a880, id(h264) type(Video)
2023-05-31 20:27:58.472714 I [1949/1949] CoreContext audiooutputdigitalencoder.cpp:119 (Init) - DEnc: Using codec ac3 to encode audio
2023-05-31 20:27:58.473429 I [1949/1949] CoreContext audiooutputbase.cpp:782 (Reconfigure) - AOBase: Opening audio device 'iec958:CARD=sndrpihifiberry,DEV=
0' ch 2(2) sr 48000 sf signed 16 bit reenc 1
2023-05-31 20:27:58.484099 I [1949/1949] CoreContext decoderbase.cpp:1136 (AutoSelectTrack) - Dec: Selected track #1 (type 2) in the Unknown language(0)
2023-05-31 20:27:58.484122 I [1949/1949] CoreContext decoderbase.cpp:1136 (AutoSelectTrack) - Dec: Selected track #1 (type 3) in the Finnish language(67116
62)
2023-05-31 20:27:58.484129 I [1949/1949] CoreContext decoderbase.cpp:1136 (AutoSelectTrack) - Dec: Selected track #1 (type 7) in the Finnish language(67116
62)
2023-05-31 20:27:58.484141 I [1949/1949] CoreContext decoderbase.cpp:324 (SyncPositionMap) - Dec: Resyncing position map. posmapStarted = 0 livetv(0) watch
ingRec(0)
2023-05-31 20:27:58.515093 I [1949/1949] CoreContext decoderbase.cpp:193 (PosMapFromDb) - Dec: Position map filled from DB to: 79304
2023-05-31 20:27:58.517829 I [1949/1949] CoreContext decoderbase.cpp:208 (PosMapFromDb) - Dec: Duration map filled from DB to: 79304
2023-05-31 20:27:58.518335 I [1949/1949] CoreContext decoderbase.cpp:368 (SyncPositionMap) - Dec: SyncPositionMap prerecorded, from DB: 2681 entries
2023-05-31 20:27:58.518354 I [1949/1949] CoreContext decoderbase.cpp:405 (SyncPositionMap) - Dec: SyncPositionMap, new totframes: 79304, new length: 3172, 
posMap size: 2681
2023-05-31 20:27:58.520573 I [1949/1949] CoreContext avformatdecoder.cpp:1198 (OpenFile) - AFD: Position map found
2023-05-31 20:27:58.520589 I [1949/1949] CoreContext avformatdecoder.cpp:1201 (OpenFile) - AFD: Successfully opened decoder for file: "myth://mythserv.newtech.fi/1021_20230531140700.ts". novideo(0)
2023-05-31 20:27:58.525038 I [1949/1949] CoreContext programinfo.cpp:2878 (QueryStartMark) - Using file start
2023-05-31 20:27:58.526207 I [1949/1949] CoreContext mythvideooutgpu.cpp:76 (Create) - VidOutGPU: Allowed renderers for H.264 v4l2-dec (Decoder: v4l2-dec): 'opengl,opengl-yv12'
2023-05-31 20:27:58.526224 I [1949/1949] CoreContext mythvideoprofile.cpp:1259 (GetFilteredRenderers) - VideoProfile: Safe renderers for 'v4l2-dec': null,opengl,opengl-yv12
2023-05-31 20:27:58.526231 I [1949/1949] CoreContext mythvideooutgpu.cpp:82 (Create) - VidOutGPU: Allowed renderers (filt: v4l2-dec): opengl,opengl-yv12
2023-05-31 20:27:58.530665 I [1949/1949] CoreContext mythvideoprofile.cpp:305 (MythVideoProfile) - VideoProfile: Accepting: cmp() w() h() framerate() codecs( ) dec(v4l2-dec) cpus(4) skiploop(enabled) rend(opengl-yv12) deint(medium:shader,medium:shader) upscale(bilinear)
2023-05-31 20:27:58.530699 I [1949/1949] CoreContext mythvideoprofile.cpp:446 (LoadBestPreferences) - VideoProfile: LoadBestPreferences(1920x1080, 25.000, h264_v4l2m2m)
2023-05-31 20:27:58.530716 I [1949/1949] CoreContext mythvideoprofile.cpp:471 (LoadBestPreferences) - VideoProfile: LoadBestPreferences result: priority:1 width: height: fps: codecs: 
2023-05-31 20:27:58.530726 I [1949/1949] CoreContext mythvideoprofile.cpp:476 (LoadBestPreferences) - VideoProfile: decoder:v4l2-dec renderer:opengl-yv12 deint0:medium:shader deint1:medium:shader cpus:4 upscale:bilinear
2023-05-31 20:27:58.530745 I [1949/1949] CoreContext mythvideooutgpu.cpp:96 (Create) - VidOutGPU: Preferred renderer: opengl-yv12
2023-05-31 20:27:58.530748 I [1949/1949] CoreContext mythvideooutgpu.cpp:126 (Create) - VidOutGPU: Trying video renderer: 'opengl-yv12'
2023-05-31 20:27:58.553749 I [1949/1949] CoreContext mythhdrtracker.cpp:31 (Create) - HDRTracker: No HDR support detected for this display
2023-05-31 20:27:58.555370 I [1949/1949] CoreContext mythvideogpu.cpp:35 (MythVideoGPU) - VideoGPU: Discard stereoscopic fields: Yes
2023-05-31 20:27:58.556816 I [1949/1949] CoreContext mythopenglvideo.cpp:55 (MythOpenGLVideo) - GLVid: Chroma upsampling filter enabled
2023-05-31 20:27:58.556853 I [1949/1949] CoreContext mythpainteropengl.cpp:77 (ClearCache) - Clearing OpenGL painter cache.
2023-05-31 20:27:58.565819 I [1949/1949] CoreContext mythvideobounds.cpp:123 (PopulateGeometry) - VideoBounds: Window using screen 'HDMI-1' 1920x1080
2023-05-31 20:27:58.565834 I [1949/1949] CoreContext mythvideobounds.cpp:482 (PrintMoveResizeDebug) - VideoBounds: Window Rect:  1920x1080+0+0
2023-05-31 20:27:58.565847 I [1949/1949] CoreContext mythvideobounds.cpp:485 (PrintMoveResizeDebug) - VideoBounds: Display Rect: 1920x1080+0+0 Aspect: 1.77778
2023-05-31 20:27:58.565854 I [1949/1949] CoreContext mythvideobounds.cpp:489 (PrintMoveResizeDebug) - VideoBounds: Video Rect:   1920x1080+0+0 Aspect: 1.77778
2023-05-31 20:27:58.565886 I [1949/1949] CoreContext mythvideocolourspace.cpp:116 (SetSupportedAttributes) - ColourSpace: PictureAttributes: Brightness,Contrast,Colour,Hue,Range
2023-05-31 20:27:58.565924 I [1949/1949] CoreContext mythvideooutgpu.cpp:566 (InitDisplayMeasurements) - VidOutGPU: Display aspect ratio: 1.7782 (Detected)
2023-05-31 20:27:58.579400 I [1949/1949] CoreContext videobuffers.cpp:977 (CreateBuffers) - Created 8 YUV420P (1920x1080) video buffers
2023-05-31 20:27:58.585796 I [1949/2006] Decoder mythdecoderthread.cpp:23 (run) - DecThread: Decoder thread starting.
2023-05-31 20:27:58.595761 I [1949/1949] CoreContext osd.cpp:132 (LoadWindows) - OSD: Loaded window osd_message
2023-05-31 20:27:58.603702 I [1949/1949] CoreContext osd.cpp:132 (LoadWindows) - OSD: Loaded window osd_input
2023-05-31 20:27:58.636483 I [1949/1969] ImageLoad mythcommandlineparser.cpp:2922 (operator()) - Qt: libpng warning: iCCP: known incorrect sRGB profile2023-05-31 20:27:58.638264 I [1949/1949] CoreContext osd.cpp:132 (LoadWindows) - OSD: Loaded window program_info
2023-05-31 20:27:58.649037 I [1949/1949] CoreContext osd.cpp:132 (LoadWindows) - OSD: Loaded window browse_info
2023-05-31 20:27:58.661226 I [1949/1949] CoreContext osd.cpp:132 (LoadWindows) - OSD: Loaded window osd_status
2023-05-31 20:27:58.670450 I [1949/1949] CoreContext osd.cpp:132 (LoadWindows) - OSD: Loaded window osd_program_editor
2023-05-31 20:27:58.694701 I [1949/1949] CoreContext osd.cpp:132 (LoadWindows) - OSD: Loaded window osd_debug
2023-05-31 20:27:58.694732 I [1949/1949] CoreContext osd.cpp:71 (Init) - OSD: Loaded OSD: size 1920x1080 offset 0+0
2023-05-31 20:27:58.700496 I [1949/1949] CoreContext mythcaptionsoverlay.cpp:174 (InitSubtitles) - Captions: Created window aa_OSD_SUBTITLES
2023-05-31 20:27:58.705340 I [1949/1949] CoreContext mythplayercaptionsui.cpp:237 (EnableCaptions) - EnableCaptions(4) msg: Undertext 1: Finnish På
2023-05-31 20:27:58.705368 I [1949/1949] CoreContext mythplayer.cpp:1683 (ClearAfterSeek) - Player(0): ClearAfterSeek(0)
2023-05-31 20:27:58.708900 I [1949/1949] CoreContext mythplayer.cpp:697 (SetFrameInterval) - Player(0): SetFrameInterval Interval:40000 Speed:1 Scan:Interlaced Scan (Multiplier: 1)
2023-05-31 20:27:58.708935 I [1949/1949] CoreContext mythplayerui.cpp:513 (InitFrameInterval) - PlayerUI: Display Refresh Rate: 60.002 Video Frame Rate: 25.000
2023-05-31 20:27:58.708970 I [1949/1949] CoreContext mythvideoout.cpp:175 (SetDeinterlacing) - VideoOutput: SetDeinterlacing (Doublerate 1): Single Medium|CPU|GLSL Double Medium|CPU|GLSL
2023-05-31 20:27:58.709093 I [1949/1949] CoreContext tv_play.cpp:225 (StartPlaying) - TV::StartPlaying(): StartPlaying(): took 0 ms to start player.
2023-05-31 20:27:58.709129 I [1949/1949] CoreContext tv_play.cpp:4658 (StartPlayer) - TV::StartPlayer(): Created player.
2023-05-31 20:27:58.709382 I [1949/1949] CoreContext tv_play.cpp:2187 (HandleStateChange) - TV::HandleStateChange(): Changing from None to WatchingPreRecorded
2023-05-31 20:27:58.714548 I [1949/1949] CoreContext mythscreensaverx11.cpp:248 (Disable) - ScreenSaverX11: Inhibited X11 screensaver
2023-05-31 20:27:58.722448 I [1949/1949] CoreContext tv_play.cpp:2263 (HandleStateChange) - TV::HandleStateChange(): Main UI disabled.
2023-05-31 20:27:58.722652 I [1949/1949] CoreContext tv_play.cpp:356 (StartTV) - TV::StartTV(): Entering main playback loop.
2023-05-31 20:27:58.747888 I [1949/1949] CoreContext mythplayer.cpp:711 (SetBuffering) - Player(0): Waiting for video buffers...
2023-05-31 20:27:58.852911 N [1949/1949] CoreContext mythplayer.cpp:782 (PrebufferEnoughFrames) - Player(0): Waited 105ms for video buffers AAAAAAAA
2023-05-31 20:27:58.956900 N [1949/1949] CoreContext mythplayer.cpp:782 (PrebufferEnoughFrames) - Player(0): Waited 209ms for video buffers AAAAAAAA
2023-05-31 20:27:59.060559 N [1949/1949] CoreContext mythplayer.cpp:782 (PrebufferEnoughFrames) - Player(0): Waited 313ms for video buffers AAAAAAAA
And it just goes on after that

Also tried to build the deb:s myself and ended up with the same result.

This is on a 64-bit RaspiOS updated to newest version.

What should I look for debugging this?
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: How to build a MythTV v33 system for a Raspberry Pi 4

Post by jfabernathy »

Well this is just a guess, but it may just be the video format?? All my test are recordings from a HDHR ATSC 1.0 networked tuner. So the video is MPEG2 1080i or 720p for HD. I have converted some of those to m4v using handbrake after editing out the commercials. It plays those fine, but the resolution is reduced, but still full screen 16:9.

I'd also make sure your video playback settings only use the OpenGL with 4 CPUs. The other don't work as well and the RPI4 has enough power to do the work all in software..
dagnygren
Junior
Posts: 18
Joined: Thu Aug 04, 2016 12:24 pm
Finland

Re: How to build a MythTV v33 system for a Raspberry Pi 4

Post by dagnygren »

Thanks. The video format is what comes out of YLE (The Finnish broadcasting company) on the HD channels.

But I did set the decoder to "General", which according to the help text is just using FFmpeg for the decoding, and it works surprisingly well. No problems with the different formats (SD/HD), pretty good picture, good framerate and a CPU load of about 50%. Not bad at all.I just always thought that this was the last resort.

And with 64-bit we do not really have any Hardware acceleration available.

I can use this, but it would still be interesting to know what is wrong with my OpenGL decoder. It worked with 0.31.
keef256
Junior
Posts: 39
Joined: Fri Apr 22, 2022 3:38 pm
Great Britain

Re: How to build a MythTV v33 system for a Raspberry Pi 4

Post by keef256 »

I'm looking to add a slave backend to my existing system which is V32.
I'm assuming they all need to be on the same version so.
Is it easier to upgrade my existing system to V33 or can I just use these instructions and substitute 32 for 33?
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: How to build a MythTV v33 system for a Raspberry Pi 4

Post by jfabernathy »

keef256 wrote:
Fri Sep 15, 2023 9:37 am
I'm looking to add a slave backend to my existing system which is V32.
I'm assuming they all need to be on the same version so.
Is it easier to upgrade my existing system to V33 or can I just use these instructions and substitute 32 for 33?
I don't know about v32. I know it works on v33 and v34.
keef256
Junior
Posts: 39
Joined: Fri Apr 22, 2022 3:38 pm
Great Britain

Re: How to build a MythTV v33 system for a Raspberry Pi 4

Post by keef256 »

jfabernathy wrote:
Fri Sep 15, 2023 11:14 am
keef256 wrote:
Fri Sep 15, 2023 9:37 am
I'm looking to add a slave backend to my existing system which is V32.
I'm assuming they all need to be on the same version so.
Is it easier to upgrade my existing system to V33 or can I just use these instructions and substitute 32 for 33?
I don't know about v32. I know it works on v33 and v34.
I ask because this looks like the set of instructions I used to create my system. As I have asked questions before. And apart from the initial post all are titled MythTV v32
keef256
Junior
Posts: 39
Joined: Fri Apr 22, 2022 3:38 pm
Great Britain

Re: How to build a MythTV v33 system for a Raspberry Pi 4

Post by keef256 »

Can I run different versions of the backend?
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: How to build a MythTV v33 system for a Raspberry Pi 4

Post by jfabernathy »

keef256 wrote:
Fri Sep 15, 2023 12:28 pm
Can I run different versions of the backend?
As far as I know, you cannot.
keef256
Junior
Posts: 39
Joined: Fri Apr 22, 2022 3:38 pm
Great Britain

Re: How to build a MythTV v33 system for a Raspberry Pi 4

Post by keef256 »

How easy is it to upgrade to a newer version without loosing everything?
olmate
Newcomer
Posts: 3
Joined: Mon Dec 11, 2023 1:28 pm
Australia

Re: How to build a MythTV v33 system for a Raspberry Pi 4

Post by olmate »

Thanks for the howto, but I'm hitting a brick wall with FFMPEG. I have a pi4 1G model running 64bit bullseye - all goes well until:

Code: Select all

LD	libavcodec/libmythavcodec-so.59
LD	libavformat/libmythavformat-so.59
LD	libavfilter/libmythavfilter-so.8
LD	libavdevice/libmythavdevice-so.59
LD	ffmpeg_g
LD	ffprobe_g
STRIP	ffprobe
skipping strip -o ffprobe ffprobe_g
STRIP	ffmpeg
skipping strip -o ffmpeg ffmpeg_g
make[2]: Leaving directory '/home/pi/build/mythtv/mythtv/external/FFmpeg'
make[1]: Leaving directory '/home/pi/build/mythtv/mythtv/external'
make: *** [Makefile:66: external] Error 2
Log File:
/home/pi/build/mythtv/../build_mythtv.out

ERROR ERROR Build Failed rc = 2 on Mon 11 Dec 2023 20:40:03 AWST
Any ideas?

Thanks :)

Ol'mate
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: How to build a MythTV v33 system for a Raspberry Pi 4

Post by jfabernathy »

I've been told that you can't build mythtv on a RPI4 with less than a 4GB model. That's all I have every used.

You can download the .deb as mentioned in the forum posts.

I'd use this guide to build:
viewtopic.php?f=46&t=5529
and this guide to install which includes the link to get the ,deb
viewtopic.php?f=46&t=5528
Post Reply