Re: a2dp, myth, pulse

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Guys

> unfortunately there isn't a clear way to merge a udp/hdhomerun remote
> coming in on lircd with avrcp events from inputlircd. I'll take it up
> with the lirc folks and summarize here later.

lirc should be used to inject input events and probably nothing else.
There are three different lirc daemon flavors, each one missing key
features. If you need to merge multiple sources, you have to do a
confusing dance with tcp sockets, master servers, etc. Unfortunately,
the event driver interface is one thing in lirc that apparently
doesn't work at all.

I made it work instead with gizmod talking to the mythtv telnet
control connection, see script.

Gizmod does have a problem with its compile prefix, see
https://bugs.launchpad.net/ubuntu/+source/gizmod/+bug/645058

So, the complete hack under ubuntu 10.04...

* add uinput to /etc/modules
* tell myth to use the pulse device
* add to /etc/pulse/default.pa: load-module module-alsa-sink device=plug:dmix
* click the headset button to connect it
* use pavucontrol to move the myth stream over to the headset
* install the script below in ~/.gizmod/modules.d/001-AVRCP-MythTV.py
* sudo ln -s /etc /usr/etc
* sudo gizmod

-- 
Brad Midgley

from GizmoDaemon import *
from GizmoScriptEnableChecker import *
import sys
import telnetlib

ENABLED = True
VERSION_NEEDED = 3.2

class AVRCPMythTV(GizmoScriptEnableChecker):

	def msend(self, msg):
		telnet = telnetlib.Telnet("localhost", 6546)
		telnet.read_until("# ")
		telnet.write(msg + "\n")
		telnet.close
	
	def onEvent(self, Event, Gizmo = None):
		if Event.Remote:
			return False
		
		if Event.Class != GizmoEventClass.Standard:
			return False

		if Event.Type != GizmoEventType.EV_KEY:
			return False

		if Event.Value != 1:
			return False

		name = str(Event.Code)
		if name == "KEY_NEXTSONG":
			self.msend("key right")
	   		return True
		elif name == "KEY_PLAYCD" or name == "KEY_PAUSECD":
			self.msend("key p")
	   		return True
	   	elif name == "KEY_STOPCD":
			self.msend("key escape")
	   		return True
	   	elif name == "KEY_PREVIOUSSONG":
			self.msend("key left")
	   		return True	

		return False

	def __init__(self):
		GizmoScriptEnableChecker.__init__(self, ENABLED, VERSION_NEEDED)
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux