tizonia-openmax-il icon indicating copy to clipboard operation
tizonia-openmax-il copied to clipboard

Getting Tizonia run natively on Gentoo

Open henrikp opened this issue 4 years ago • 9 comments

Hi Using this ebuild I have managed to move to the new build system. Everything compiles fine but I'm having a problem with getting it to actually doing something useful. Tried docker-tizonia and it works just fine, so the audio system (Pulseaudio) should be accessible. With even the basic commands I'm getting this error (pretty much with every command that has something to do with audio output):

$ tizonia -L
tizonia 0.22.0. Copyright (C) 2020 Juan A. Rubio and contributors
This software is part of the Tizonia project <https://tizonia.org>

FATAL. Could not init OpenMAX IL : OMX_ErrorInsufficientResources

I've tried modifying the log4crc (same contents at /etc/xdg and ~/.config/tizonia) to get something logged to the stdout, am I doing something wrong? File itself. /var/log/tizonia is writable to world, no files were created there.

I think my first major hurdle is to get logging to work for moving, any ideas?

henrikp avatar Aug 12 '20 13:08 henrikp

@henrikp

Thanks for reaching out, getting Tizonia to run natively on Gentoo is really cool.

As you say, the first thing is to get logging to work.

Log4c is a strange library sometimes. I've noticed that sometimes it will refuse to output anything if the version number present in the .log4crc file is different from the version of the library installed.

You can try this example below, that would log everything to the standard error, please make sure you change the version number to match the version of the log4c binary installed on your system:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE log4c SYSTEM "">

<log4c version="1.2.1">

  <config>
    <bufsize>0</bufsize>
    <debug level="2"/>
    <nocleanup>0</nocleanup>
    <reread>1</reread>
  </config>

  <category name="root" priority="trace" appender="stderr"/>
  <layout name="tiz" type="tiz_layout"/>
  <appender name="stderr" type="stream" layout="tiz"/>

</log4c>

juanrubio avatar Aug 18 '20 08:08 juanrubio

I got debug output but only when I had the file in $HOME/.config/tizonia/log4crc, didn't do anything when it was under /etc. The output is here. Currently the only config is in the user directory, nowhere else. I can't understand the output: it parses the config file and yet it says "Key not found" right away? The component directory path is correct.

henrikp avatar Aug 19 '20 17:08 henrikp

From your log, I can see that tizonia can't continue because it can't find the component paths (the 'components' are the plugin dlls). That's not strange.

However... what I find really strange is that in your log, there are missing messages after the 'ETIZCoreMsgInit received...' trace.

Looking at the code, I can't find an explanation for the missing messages. Have you patched the code in any way?

In particular, this function (https://github.com/tizonia/tizonia-openmax-il/blob/ca7e48a392618e5d1dee3e388cc15fad5eaa66c3/libtizcore/src/tizcore.c#L735) should output a trace, as you can see in my log below:

[TRACE] [tiz.ilcore] [../libtizcore/src/tizcore.c:get_core:1422] --- IL Core initialization success.
[TRACE] [tiz.ilcore] [../libtizcore/src/tizcore.c:start_core:1434] --- Starting IL core thread with cache in [0x55c048a90200].
[TRACE] [tiz.ilcore] [../libtizcore/src/tizcore.c:start_core:1441] --- waiting on thread creation.
[TRACE] [tiz.ilcore] [../libtizcore/src/tizcore.c:start_core:1443] --- thread creation complete.
[TRACE] [tiz.ilcore] [../libtizcore/src/tizcore.c:dispatch_msg:1343] --- msg [0x55c048a90980] class [ETIZCoreMsgInit]
[TRACE] [tiz.ilcore] [../libtizcore/src/tizcore.c:do_init:1063] --- ETIZCoreMsgInit received...
[TRACE] [tiz.platform.rc] [../libtizplatform/src/tizrc.c:tiz_rcfile_get_value:758] --- Retrieving value for Key [enabled] in section [resource-management]
[TRACE] [tiz.platform.rc] [../libtizplatform/src/tizrc.c:tiz_rcfile_get_value_list:792] --- Retrieving value list for Key [component-paths] in section [il-core]
[TRACE] [tiz.ilcore] [../libtizcore/src/tizcore.c:find_component_paths:749] --- component paths [0] : [/home/juan/temp/lib/x86_64-linux-gnu/tizonia0-plugins12]
[TRACE] [tiz.ilcore] [../libtizcore/src/tizcore.c:find_component_paths:749] --- component paths [1] : [#]
[TRACE] [tiz.ilcore] [../libtizcore/src/tizcore.c:find_component_paths:749] --- component paths [2] : [#]
[TRACE] [tiz.ilcore] [../libtizcore/src/tizcore.c:scan_component_folders:788] --- Looking for component plugins : /home/juan/temp/lib/x86_64-linux-gnu/tizonia0-plugins12
[TRACE] [tiz.ilcore] [../libtizcore/src/tizcore.c:scan_component_folders:805] --- [libtizaacdec.so]
[TRACE] [tiz.ilcore] [../libtizcore/src/tizcore.c:scan_component_folders:805] --- [libtizoggdemux.so]
[TRACE] [tiz.ilcore] [../libtizcore/src/tizcore.c:scan_component_folders:805] --- [libtizmpg123d.so.0]
[TRACE] [tiz.ilcore] [../libtizcore/src/tizcore.c:scan_component_folders:805] --- [libtizpulsear.so.0]

juanrubio avatar Aug 19 '20 22:08 juanrubio

The only patching done to these sources are currently making sure I'm compiling against boost 3.7 libraries, not 3.6 - direct link to sed's. I tried with the release and the latest commit last week, so it's definately something on my side.

henrikp avatar Aug 19 '20 22:08 henrikp

I managed to build tizonia with debugging symbols but for what should I look for? Can you post your full log with log4c output as well from launching "tizonia -L" ?

henrikp avatar Aug 20 '20 12:08 henrikp

@henrikp

Please find here the result of executing tizonia -L on my system, using the default `tizonia.conf' file.

tizonia-L.log

The thing that caught me eye is that i did not see these two lines in your log:

[TRACE] [tiz.platform.rc] [../libtizplatform/src/tizrc.c:tiz_rcfile_get_value:758] --- Retrieving value for Key [enabled] in section [resource-management]
[TRACE] [tiz.platform.rc] [../libtizplatform/src/tizrc.c:tiz_rcfile_get_value_list:792] --- Retrieving value list for Key [component-paths] in section [il-core]

juanrubio avatar Aug 20 '20 12:08 juanrubio

@henrikp

To see what's going on, I would step through with the debugger from this line:

https://github.com/tizonia/tizonia-openmax-il/blob/ca7e48a392618e5d1dee3e388cc15fad5eaa66c3/libtizcore/src/tizcore.c#L779

juanrubio avatar Aug 20 '20 12:08 juanrubio

Hello, I'm joining this conversation, having encountered the same problem. I'm working with a derivative of @henrikp's ebuild. I'm encountering the same problems described earlier in this ticket.

Using strace, I'm seeing file access events with literal shell environment variables in the path passed to the system call:

access("$TIZONIA_RC_FILE/tizonia.conf", R_OK) = -1 ENOENT (No such file or directory)

I'm trying to figure out whether this be a build-time or runtime artefact, but it is really suspicious that the dollar sign is being passed along like that.

awenocur avatar Jan 13 '21 20:01 awenocur

Regarding the failure in tiz_rcfile_get_value_list, I'm seeing two possible origins:

On line 1450 of tizev.c, at the return statement of tiz_rcfile_get_handle, p_event_loop is NULL.

On thread 1, whence this stack is dispatched, the last line of OMX_Init, in tizcore.c:1626, has a null data structure for p_msg. The pointer itself is assigned, which is why it does not return an insufficient resources error at that point.

awenocur avatar Jan 16 '21 14:01 awenocur