1) Solucionado agregando "service bluetooth restart" en /etc.rc.local
2) Solucionado agregando "hciconfig hci0 piscan" en /etc.rc.local, luego de lo del punto 1)
3) Asocié una tecla del control remoto a la ejecución de un script de xbmc:
El script es:
# cat /home/xbian/kodi_changeAudio.py
#!/usr/bin/python
from sys import argv
import os, xbmc, json
if (__name__ == "__main__"):
audio_device = json.loads(xbmc.executeJSONRPC('{"jsonrpc":"2.0","method":"Settings.GetSettingValue", "params":{"setting":"audiooutput.audiodevice"},"id":1}'))
audio = audio_device["result"]["value"]
if audio == "ALSA:bluetooth":
#Set HDMI
xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.audiodevice", "value":"PI:HDMI"}, "id":1}')
xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"GUI.ShowNotification", "params":{"title":"AUDIO OUTPUT", "message":"HDMI", "image":"/home/xbian/speaker.png"}, "id":1}')
else:
#Set Bluetooth
xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.audiodevice", "value":"ALSA:bluetooth"}, "id":1}')
xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"GUI.ShowNotification", "params":{"title":"AUDIO OUTPUT", "message":"Bluetooth", "image":"/home/xbian/speaker.png"}, "id":1}')
La asociación de la tecla del control remoto la configuro así (la tecla de DOT; configurada en lircd.conf):
# cat /home/xbian/.kodi/userdata/keymaps/remote.xml
<keymap>
<global>
<universalremote>
<obc1>XBMC.RunScript("/home/xbian/kodi_changeAudio.py")</obc1>
</universalremote>
</global>
</keymap>
# cat /home/xbian/.kodi/userdata/Lircmap.xml (el output está incompleto para que no ocupe tanto en el mail)
<!-- This file contains the mapping of LIRC keys to XBMC keys used in Keymap.xml -->
<lircmap>
<remote device="RM-YD035">
:
:
<!--volumeplus>VOL+</volumeplus-->
<!--volumeminus>VOL-</volumeminus-->
<!--mute>MUTING</mute-->
<obc1>DOT</obc1>
<!--one>1</one>
<two>2</two>
<three>3</three>
:
:
</remote>
</lircmap>
La configuración del audio bluetooth es:
# cat /etc/asound.conf
pcm.!default {
type hw
card 0
}
ctl.!default {
type hw
card 0
}
pcm.bluetooth
{
type plug
slave
{
pcm
{
type bluetooth
device 00:11:67:00:03:CB <--- Cambiarlo al MAC del Headset
profile "auto"
}
}
hint
{
show on
description "BCK-08 Bluetooth Headset"
}
}
El pairing se puede hacer así:
bluez-simple-agent hci0 00:11:67:00:03:CB <--- Cambiarlo al MAC del Headset
bluez-test-audio connect 00:11:67:00:03:CB <--- Cambiarlo al MAC del Headset
Lo que instalé:
# dpkg -l | grep blue
ii bluetooth 4.99-2 all Bluetooth support
ii bluez 4.99-2 armhf Bluetooth tools and daemons
ii bluez-alsa:armhf 4.99-2 armhf Bluetooth ALSA support
ii bluez-gstreamer 4.99-2 armhf Bluetooth GStreamer support
ii bluez-utils 4.99-2 all Transitional package
ii gir1.2-gnomebluetooth-1.0 3.4.2-1 armhf Introspection data for GnomeBluetooth
ii gnome-bluetooth 3.4.2-1 armhf GNOME Bluetooth tools
ii libbluetooth3:armhf 4.99-2 armhf Library to use the BlueZ Linux Bluetooth stack
ii libgnome-bluetooth10 3.4.2-1 armhf GNOME Bluetooth tools - support library
# dpkg -l | grep alsa
ii alsa-utils 1.0.25-4 armhf Utilities for configuring and using ALSA
ii bluez-alsa:armhf 4.99-2 armhf Bluetooth ALSA support
No creo que todo sea realmente necesario... ej: gnome-bluetooth, pero entre tantas pruebas quedó ahí.
Supongo que solo se necesita bluetooth, bluez-gstreamer, bluez-alsa.
Lo demás debe ser pura dependencia/pruebas.
Sin esto me pasaba que (no siempre) la pantalla aparecía como de 640x480.
Bueno, espero que a alguno le sea de utilidad.
Saludos