Return to Level1Techs.com

Does anyone know how to setup/configure totem plugins? Trying to setup Airplay on Fedora Linux

What I Am Trying To Do

I am trying to setup airplay on my fedora laptop. Such that I could project my ipad’s screen as a window and share my screen in calls.

How I Am Doing It

I am following this guide


The problem I am running into is that when I clone the repo to the directory, the plugin does not show up in the totem plugins section

When look at the github readme page, it reqires the following software

Software:
	Totem
	Python with Avahi, GObject and DBUS bindings
	Working Avahi stack (http://avahi.org)


I installed the following using conda
https://anaconda.org/anaconda/dbus
https://anaconda.org/conda-forge/pygobject
https://anaconda.org/conda-forge/python-avahi

When it comes to installing the plugin, I followed the commands provided in the article. I edited it to include a /.local instead of the /local the article used

cd ~/.local/share/totem/plugins/airplay
git clone https://github.com/phuang/totem-plugin-airplay

I created the plugins and airplay folders to match the directory.

The Issue

When I launch totem it does not show up in my plugins
image

The github readme mentions that I need to restart totem and compile it with python support.

Then restart Totem and activate the plugin. Obviously Totem must be compiled
with Python support.

Where I Am Stuck

My issue is I don’t know if I am missing a dependency or if totem has been compiled with python support.
There’s a Totem python console, so my assumption is it’s a dependency issue, but I installed all the conda packages.

So it’s extremely likely that totem has python support. I can’t imagine they’d leave that out.

I suspect that you didn’t install the plug-in in the correct dir.

2 Likes

seems that package is dead

they reference another one

1 Like

yeah I tried moving it to
/usr/lib64/totem/plugins
which made it show up in totem, but that opened another can of worms

running the following terminal commands yielded the following

totem


(totem:97992): libpeas-WARNING **: 18:51:29.104: The 'python' plugin loader has not been enabled

So with this and the post above,


My hope is that the python plugins need to be fixed on totem’s side, but the reality is that this package is dead…

might need to look at the other plugin. Though kinda wish I had found it earlier, would have saved me a bunch of time researching solutions

1 Like

Hmmmm is there a totem-python package or something of the sort?

dunno, when I try running a install for totem-python, there isn’t any packages

Totem has a python console, so my assumption is that it has python, but I don’t know what I need to run


cloning the second github link to my /usr folder got the plugin listed, but running it is a different story
image

running the terminal command yields the following

totem
/usr/lib64/totem/plugins/totem_player_plugin/AirPlayService.py:58: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if (url[4] is not ""):
/usr/lib64/totem/plugins/totem_player_plugin/AirPlayService.py:198: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if(answer is not ""):

** (totem:106899): WARNING **: 19:09:25.310: Error importing plugin 'airplay':
Traceback (most recent call last):
  File "/usr/lib64/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/lib64/totem/plugins/totem_player_plugin/airplay.py", line 34, in <module>
    from AirPlayService import AirPlayService
  File "/usr/lib64/totem/plugins/totem_player_plugin/AirPlayService.py", line 31, in <module>
    from ZeroconfService import ZeroconfService
  File "/usr/lib64/totem/plugins/totem_player_plugin/ZeroconfService.py", line 23, in <module>
    import avahi
ModuleNotFoundError: No module named 'avahi'

(totem:106899): libpeas-WARNING **: 19:09:25.310: Error loading plugin 'airplay'

it might be the avahi, I need to check if there is a conda package for that

I am going to try installing
https://anaconda.org/anaconda/avahi-libs-cos6-x86_64
and
https://anaconda.org/conda-forge/python-avahi

so I installed avahi, but for whatever reason the python console in totem doesn’t have it as a library

I am going to try the following package
https://anaconda.org/conda-forge/zeroconf

Probably an issue of python 2 vs 3 packages.

Make sure you’ve installed the right one.

Should be python 3.

1 Like

maybe, when tried swapping out all mentions of avahi, I was able to get the check box to show up. It’s more progress than before, but now we have more problems

As the kids say

mo bandaid fixes, mo problems

image
but it does not show up in the screen mirroring on my ipad.

terminal output when I changed all mentions of avahi to zeroconf

otem
/usr/lib64/totem/plugins/totem_player_plugin/AirPlayService.py:58: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if (url[4] is not ""):
/usr/lib64/totem/plugins/totem_player_plugin/AirPlayService.py:198: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if(answer is not ""):
Traceback (most recent call last):
  File "/usr/lib64/totem/plugins/totem_player_plugin/airplay.py", line 54, in do_activate
    self.construct()
  File "/usr/lib64/totem/plugins/totem_player_plugin/airplay.py", line 74, in construct
    self.service = AirPlayTotemPlayer(
  File "/usr/lib64/totem/plugins/totem_player_plugin/airplay.py", line 85, in __init__
    AirPlayService.__init__(self, name, host, port)
  File "/usr/lib64/totem/plugins/totem_player_plugin/AirPlayService.py", line 313, in __init__
    self.zeroconf_service.publish()


  File "/usr/lib64/totem/plugins/totem_player_plugin/ZeroconfService.py", line 40, in publish
    server = dbus.Interface(bus.get_object(zeroconf.DBUS_NAME, zeroconf.DBUS_PATH_SERVER), zeroconf.DBUS_INTERFACE_SERVER)
AttributeError: module 'zeroconf' has no attribute 'DBUS_NAME'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/totem/plugins/totem_player_plugin/airplay.py", line 56, in do_activate
    print >> sys.stderr, "Failed activating airplay"
TypeError: unsupported operand type(s) for >>: 'builtin_function_or_method' and '_io.TextIOWrapper'. Did you mean "print(<message>, file=<output_stream>)"?

with this I can definitively prove that avahi was the problem in getting it to give me a check box. Where should I look for the avahi python 3 package?

modified code

# -*- coding: utf-8 -*-
#
# Copyright (c) 2010 Martin S. <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

import zeroconf
import zeroconf
import dbus

__all__ = ["ZeroconfService"]

class ZeroconfService(object):
	def __init__(self, name, port, stype="_http._tcp", domain="", host="", text=""):
		self.name = name
		self.stype = stype
		self.domain = domain
		self.host = host
		self.port = port
		self.text = text

	def publish(self):
		bus = dbus.SystemBus()
		server = dbus.Interface(bus.get_object(zeroconf.DBUS_NAME, zeroconf.DBUS_PATH_SERVER), zeroconf.DBUS_INTERFACE_SERVER)

		g = dbus.Interface(bus.get_object(zeroconf.DBUS_NAME, server.EntryGroupNew()), zeroconf.DBUS_INTERFACE_ENTRY_GROUP)
		g.AddService(zeroconf.IF_UNSPEC, zeroconf.PROTO_UNSPEC, dbus.UInt32(0), self.name, self.stype, self.domain, self.host, dbus.UInt16(self.port), zeroconf.string_array_to_txt_array(self.text))

		g.Commit()
		self.group = g

	def unpublish(self):
		if self.group is not None:
			self.group.Reset()

Imma go grab dinner and figure this out later. If I can’t figure out how to get avahi running properly on the ZeroconfService.py I might need to put in a issue with the new maintainer

try python3 pip -m install avahi and see what happens

1 Like
python3: can't open file 'pip': [Errno 2] No such file or directory

also tried pip3

python3 pip3 -m install avahi
python3: can't open file 'pip3': [Errno 2] No such file or directory

throwing those two errors

it’d be pip3 install avahi or python3 -m pip install avahi

you might need to install python3-pip or python-pip depending on your distribution.

2 Likes

Thanks for the correction. I was not at a machine to verify that.

1 Like
pip3 install avahi
ERROR: Could not find a version that satisfies the requirement avahi (from versions: none)
ERROR: No matching distribution found for avahi
python3 -m pip install avahi
ERROR: Could not find a version that satisfies the requirement avahi (from versions: none)
ERROR: No matching distribution found for avahi

looks like avahi isn’t a pip package? There’s a zeroconf package, but it isn’t the same as the original code


I submitted a ticket

1 Like

This was the best solution I found. Instructions are pretty simple. Running it from the terminal keeps track of the process and any error outputs

1 Like