Page 1 of 2

[Solved] Scan for new music not working

Posted: Sun Jun 09, 2019 1:29 pm
by phackmann
Hi all. Recently my Mythtv 0.28 install has stopped working regarding adding new music to mythmusic. When I run the scan for new music option, it sends the job to the backend according to the log files, but nothing happens after that. I tried using the command line mythutil --scanmusic, and that doesn't work either. It just gives these messages and quits:

QWaitCondition: cv destroy failure: Device or resource busy
QWaitCondition: mutex destroy failure: Device or resource busy
QWaitCondition: cv destroy failure: Device or resource busy
QWaitCondition: mutex destroy failure: Device or resource busy

I've double and triple checked the file permissions on the folder, and all of the music settings, and everything is correct there as far as I can tell. I would like to debug it further, but I don't know how to get more detailed logs from it. Does anybody have any suggestions?

Re: Scan for new music not working

Posted: Mon Jun 10, 2019 10:29 am
by paulh
MythTV 0.28 is just too old to care about, that's like from April 2016 I think :roll: :twisted:

Just guessing without further information but these checks spring to mind.

The music scanning is done by the master backend was that running and accepting connections when you tried to run the scan?
Do other mythutil commands work?
Have you set up the 'Music' storage group properly?
Check both frontend and backend logs for any possible errors.

Re: Scan for new music not working

Posted: Mon Jun 10, 2019 12:00 pm
by phackmann
Yeah, I hear you. :oops: I tend to stay a version or 2 back because it's more important to me to be reliable than on the latest and greatest version. And if it is working, I leave it alone. Every time I do update to a newer version of linux or mythtv, I end up spending a weekend just getting things working right again. It's usually video/audio or capture card issues. But don't get me wrong, I love my mythtv box. I've been using mythtv for about 15 years now and don't intend to change a thing. :D Thank you to you and the other developers who make this great software!

So, the backend is running and accepting connections. I'm not that familiar with mythutil, but everything else seems to be OK. The storage groups are set up correctly. No errors in the frontend or backend logs. I wish I could get a more verbose output from mythutil to see what it is doing (or not doing). I don't know if it is not scanning the directory, or if there is a database related issue.

Re: Scan for new music not working

Posted: Sat Jun 15, 2019 12:32 pm
by paulh

Code: Select all

mythutil --verbose help
will show you the logging options available. mythutil --scanmusic just tells the backend to do the scan so the backend log will probably tell you more. You do need to run mythutil --scanmusic on the same machine the BE is on.

Re: Scan for new music not working

Posted: Sun Jun 16, 2019 11:55 am
by phackmann
Here is what I see in the verbose logs:

2019-06-16 06:38:37.388124 I MythSocket(27d8a30:64): read <- 64 10 SCAN_MUSIC
2019-06-16 06:38:37.388133 I (0x27d8a40)::DecrRef() -> 2
2019-06-16 06:38:37.388136 I (0x7fafcc006570)::DecrRef() -> 1
2019-06-16 06:38:37.388141 I (0x7fafcc006570)::IncrRef() -> 2
2019-06-16 06:38:37.388176 I Database object created: DBManager10
2019-06-16 06:38:37.388179 I New DB connection, total: 10
2019-06-16 06:38:37.388481 I [DBManager10] Connected to database 'mythconverg' at host: localhost
2019-06-16 06:38:37.388708 I MSqlQuery::exec(DBManager10) SELECT DISTINCT hostname FROM storagegroup WHERE groupname = 'Music' <<<< Returns 1 row(s)
2019-06-16 06:38:37.388717 I MainServer: HandleScanMusic: running filescanner on master BE 'phmythtv'
2019-06-16 06:38:37.389853 I Managed child (PID: 10517) has started! & command=/usr/bin/mythutil --scanmusic, timeout=0
2019-06-16 06:38:37.389865 I (0x7fafcc017cb0)::IncrRef() -> 2
2019-06-16 06:38:37.389995 I MythSocket(27d8a30:64): write -> 64 2 OK
2019-06-16 06:38:37.390051 I (0x7fafcc006570)::DecrRef() -> 1
2019-06-16 06:38:37.390058 I (0x27d8a40)::DecrRef() -> 1
2019-06-16 06:38:37.530352 I Managed child (PID: 10517) has exited! command=/usr/bin/mythutil --scanmusic, status=33280, result=130

Paul

Re: Scan for new music not working

Posted: Sun Jun 16, 2019 2:06 pm
by paulh
OK not for the first time it looks like I misremembered how the scan works. The frontend sends the SCAN_MUSIC command to the backend and the backend then runs mythutil --scanmusic to do the actual scan. For some reason I thought mythutil asked the BE to do the scan :oops:

So can you get a similar log running mythutil --scanmusic? It helps if you supply the full log and you really need to run it as the same user that is running the backend, usually the mythtv user. A return result of 130 seems to indicate a problem creating the MythContext :?:

Re: Scan for new music not working

Posted: Sun Jun 16, 2019 8:58 pm
by phackmann
If I run the command mythutil -v all --scanmusic (as the mythtv user or with sudo), all I get from the command line is:

QWaitCondition: cv destroy failure: Device or resource busy
QWaitCondition: mutex destroy failure: Device or resource busy
QWaitCondition: cv destroy failure: Device or resource busy
QWaitCondition: mutex destroy failure: Device or resource busy

which doesn't tell me very much about what is happening. :?: I don't see anything recorded in the mythbackend.log.

Re: Scan for new music not working

Posted: Sun Jun 16, 2019 9:20 pm
by paulh
How strange :? Do other options work and produce log output like these?

Code: Select all

mythutil --version
mythutil --help
mythutil --updateradiostreams

Re: Scan for new music not working

Posted: Sun Jun 16, 2019 10:24 pm
by phackmann
The --version and --help options produce normal output. The --updateradiostreams puts out the same error message as --scanmusic.

Here is my version output if it helps

Please attach all output as a file in bug reports.
MythTV Version : v0.28.2-5-gae037d0
MythTV Branch : fixes/0.28
Network Protocol : 88
Library API : 0.28.20161120-1
QT Version : 5.5.1
Options compiled in:
linux profile use_hidesyms using_alsa using_oss using_pulse using_pulseoutput using_backend using_bindings_perl using_bindings_python using_bindings_php using_crystalhd using_dvb using_firewire using_frontend using_hdhomerun using_vbox using_ceton using_hdpvr using_ivtv using_joystick_menu using_libcec using_libcrypto using_libdns_sd using_libfftw3 using_libxml2 using_lirc using_mheg using_opengl using_opengl_video using_opengl_themepainter using_qtwebkit using_qtscript using_qtdbus using_sdl using_taglib using_v4l2 using_x11 using_xrandr using_xv using_profiletype using_bindings_perl using_bindings_python using_bindings_php using_freetype2 using_mythtranscode using_opengl using_vaapi using_vdpau using_ffmpeg_threads using_mheg using_libass using_libxml2

I've spent some time looking through the source code to see where the actual scan takes place, thinking I might be able to compile some additional debugging code into the scanning code for troubleshooting this further. I'm not so sure that it actually does happen in the mythutil code. It looks to me like it is part of the libmythmetadata library. Take a look at /mythtv/libs/libmythmetadata/musicfilescanner.cpp. Also, the mythtv/programs/mythutil/musicmetautils.cpp. The mythutil code mostly just calls the MusicFileScanner class?

Re: Scan for new music not working

Posted: Mon Jun 17, 2019 11:08 am
by paulh
The --version and --help options just print stuff out and exit early that's why they work. Most other mythutil options create a MythContext and it is that that is failing to initialise way before the scan starts.

It must be failing early since it's not producing any log output which makes it difficult to know what is happening. Do you compile from source or from packages? What distro do you use? Is every thing up to date and the same version? Do you know how to debug using gdb?

Re: Scan for new music not working

Posted: Mon Jun 17, 2019 11:29 pm
by phackmann
MythContext not working right makes sense. I never get a notification of anything happening on the screen when I tell it to scan for new music from the Music Tools menu. I use the package 2:0.28.2+fixes.20180827.9031599-0ubuntu0mythbuntu2, not from compiling the source. Mythbuntu/Ubuntu with XFCE. I think all of the mythtv packages are the most current ones for the 0.28.2+fixes. No, I haven't used gdb before.

Re: Scan for new music not working

Posted: Tue Jun 18, 2019 11:03 pm
by paulh
What about running

Code: Select all

mythshutdown --status
does that fail in a similar way?

0.28 is old enough that it could have the old log server enabled so try disabling it with --disable-mythlogserver or --nologserver. One or other will disable it but it could be your build hasn't been compiled with the log server enabled in which case both will fail but worth a try.

Re: Scan for new music not working

Posted: Wed Jun 19, 2019 11:39 am
by phackmann
Yes, I get a similar error.
Error: Could not initialize MythContext. Exiting.
QWaitCondition: cv destroy failure: Device or resource busy
QWaitCondition: mutex destroy failure: Device or resource busy

--disable-mythlogserver and --nologserver don't seem to be available options from the command line.

Re: Scan for new music not working

Posted: Wed Jun 19, 2019 3:30 pm
by paulh
OK so do whatever you did to get the Error: Could not initialize MythContext. Exiting. but this time add

Code: Select all

--verbose all --loglevel debug
Hopefully that will tell us more.

Re: Scan for new music not working

Posted: Thu Jun 20, 2019 10:41 am
by phackmann
I think you've found the problem. Some of the libraries appear to be out of sync? How do I get them back into sync?

2019-06-20 05:23:19.774489 C mythshutdown version: fixes/0.28 [v0.28.2-6-g9031599] www.mythtv.org
2019-06-20 05:23:19.774500 C Qt version: compile: 5.5.1, runtime: 5.5.1
2019-06-20 05:23:19.774502 N Enabled verbose msgs: all
2019-06-20 05:23:19.774510 N Setting Log Level to LOG_DEBUG
2019-06-20 05:23:19.784926 I Added logging to the console
2019-06-20 05:23:19.785183 I Setup Interrupt handler
2019-06-20 05:23:19.785188 I Setup Terminated handler
2019-06-20 05:23:19.785192 I Setup Segmentation fault handler
2019-06-20 05:23:19.785197 I Setup Aborted handler
2019-06-20 05:23:19.785200 I Setup Bus error handler
2019-06-20 05:23:19.785204 I Setup Floating point exception handler
2019-06-20 05:23:19.785208 I Setup Illegal instruction handler
2019-06-20 05:23:19.785214 I Setup Real-time signal 0 handler
2019-06-20 05:23:19.785218 I Setup Hangup handler
2019-06-20 05:23:19.785263 N Using runtime prefix = /usr
2019-06-20 05:23:19.785265 N Using configuration directory = /home/paulhackmann/.mythtv
2019-06-20 05:23:19.785267 D appbindir = /usr/bin/
2019-06-20 05:23:19.785269 D sharedir = /usr/share/mythtv/
2019-06-20 05:23:19.785271 D libdir = /usr/lib/mythtv/
2019-06-20 05:23:19.785272 D themedir = /usr/share/mythtv/themes/
2019-06-20 05:23:19.785274 D pluginsdir = /usr/lib/mythtv/plugins/
2019-06-20 05:23:19.785275 D translationsdir= /usr/share/mythtv/i18n/
2019-06-20 05:23:19.785277 D filtersdir = /usr/lib/mythtv/filters/
2019-06-20 05:23:19.785309 C Application binary version (0.28.20160309-1) does not match libraries (0.28.20161120-1)
2019-06-20 05:23:19.785312 W This application is not compatible with the installed MythTV libraries. Please recompile after a make distclean
2019-06-20 05:23:19.785317 ! MythContext: Unable to allocate MythCoreContext
2019-06-20 05:23:19.785323 ! Application binary version (0.28.20160309-1) does not match libraries (0.28.20161120-1)
2019-06-20 05:23:19.785325 W This application is not compatible with the installed MythTV libraries.
Error: Could not initialize MythContext. Exiting.
2019-06-20 05:23:19.885177 D New Logging Client: ID: (#1)
QWaitCondition: cv destroy failure: Device or resource busy
QWaitCondition: mutex destroy failure: Device or resource busy