Initial commit: AbletonMCP-AI complete system
- MCP Server with audio fallback, sample management - Song generator with bus routing - Reference listener and audio resampler - Vector-based sample search - Master chain with limiter and calibration - Fix: Audio fallback now works without M4L - Fix: Full song detection in sample loader Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
211
diagnostico_wsl.py
Normal file
211
diagnostico_wsl.py
Normal file
@@ -0,0 +1,211 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Diagnóstico completo de conectividad Ableton <-> WSL
|
||||
"""
|
||||
import socket
|
||||
import subprocess
|
||||
import sys
|
||||
import os
|
||||
|
||||
def run_cmd(cmd, description):
|
||||
"""Ejecuta un comando y muestra el resultado"""
|
||||
print(f"\n{'='*60}")
|
||||
print(f"🔍 {description}")
|
||||
print(f"{'='*60}")
|
||||
print(f"Comando: {cmd}")
|
||||
try:
|
||||
result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=10)
|
||||
if result.stdout:
|
||||
print(f"STDOUT:\n{result.stdout}")
|
||||
if result.stderr:
|
||||
print(f"STDERR:\n{result.stderr}")
|
||||
return result.returncode == 0
|
||||
except Exception as e:
|
||||
print(f"❌ Error: {e}")
|
||||
return False
|
||||
|
||||
def test_socket_connection(host, port, description):
|
||||
"""Prueba conexión socket"""
|
||||
print(f"\n{'='*60}")
|
||||
print(f"🔌 {description}")
|
||||
print(f"{'='*60}")
|
||||
print(f"Probando: {host}:{port}")
|
||||
try:
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
sock.settimeout(5)
|
||||
result = sock.connect_ex((host, port))
|
||||
if result == 0:
|
||||
print(f"✅ Conexión exitosa a {host}:{port}")
|
||||
sock.close()
|
||||
return True
|
||||
else:
|
||||
print(f"❌ No se puede conectar a {host}:{port}")
|
||||
print(f" Código de error: {result}")
|
||||
if result == 111:
|
||||
print(" (111 = Connection refused - nadie escucha en ese puerto)")
|
||||
elif result == 113:
|
||||
print(" (113 = No route to host - problema de red)")
|
||||
elif result == 110:
|
||||
print(" (110 = Connection timed out - firewall o no accesible)")
|
||||
sock.close()
|
||||
return False
|
||||
except Exception as e:
|
||||
print(f"❌ Error: {e}")
|
||||
return False
|
||||
|
||||
def get_network_info():
|
||||
"""Obtiene información de red de WSL"""
|
||||
print(f"\n{'='*60}")
|
||||
print(f"🌐 Información de red WSL")
|
||||
print(f"{'='*60}")
|
||||
|
||||
# IP de WSL
|
||||
try:
|
||||
hostname = socket.gethostname()
|
||||
ip_wsl = socket.getaddrinfo(hostname, None, socket.AF_INET)[0][4][0]
|
||||
print(f"IP de WSL: {ip_wsl}")
|
||||
except:
|
||||
print("No se pudo obtener IP de WSL")
|
||||
|
||||
# IP de Windows (desde resolv.conf)
|
||||
try:
|
||||
with open('/etc/resolv.conf', 'r') as f:
|
||||
for line in f:
|
||||
if line.startswith('nameserver'):
|
||||
ip_windows = line.split()[1]
|
||||
print(f"IP de Windows (resolv.conf): {ip_windows}")
|
||||
break
|
||||
except Exception as e:
|
||||
print(f"No se pudo leer resolv.conf: {e}")
|
||||
|
||||
# Gateway
|
||||
try:
|
||||
result = subprocess.run(['ip', 'route', 'show'], capture_output=True, text=True)
|
||||
print(f"\nRutas de red:")
|
||||
print(result.stdout)
|
||||
except:
|
||||
pass
|
||||
|
||||
def test_windows_ports():
|
||||
"""Prueba puertos en Windows desde WSL"""
|
||||
print(f"\n{'='*60}")
|
||||
print(f"🔍 Probando puertos en Windows desde WSL")
|
||||
print(f"{'='*60}")
|
||||
|
||||
# Intentar conectar desde WSL a Windows en diferentes IPs
|
||||
ips_to_test = [
|
||||
"127.0.0.1", # Localhost (solo funciona en WSL1)
|
||||
"172.19.0.1", # Gateway WSL
|
||||
"10.255.255.254", # Windows (desde resolv.conf)
|
||||
"192.168.1.1", # Router común
|
||||
]
|
||||
|
||||
# Detectar IPs reales
|
||||
try:
|
||||
result = subprocess.run(['ip', 'route', 'show'], capture_output=True, text=True)
|
||||
for line in result.stdout.split('\n'):
|
||||
if 'default' in line:
|
||||
parts = line.split()
|
||||
if 'via' in parts:
|
||||
idx = parts.index('via')
|
||||
gateway = parts[idx + 1]
|
||||
if gateway not in ips_to_test:
|
||||
ips_to_test.insert(0, gateway)
|
||||
print(f"Añadida IP de gateway: {gateway}")
|
||||
except:
|
||||
pass
|
||||
|
||||
for ip in ips_to_test:
|
||||
test_socket_connection(ip, 9877, f"Conexión a {ip}:9877")
|
||||
test_socket_connection(ip, 9879, f"Conexión a {ip}:9879 (M4L)")
|
||||
|
||||
def check_ableton_log():
|
||||
"""Verifica el log de Ableton"""
|
||||
print(f"\n{'='*60}")
|
||||
print(f"📋 Verificando Log de Ableton")
|
||||
print(f"{'='*60}")
|
||||
|
||||
# Convertir path de Windows a WSL
|
||||
log_path = "/mnt/c/Users/ren/AppData/Roaming/Ableton/Live 12.0.15/Preferences/Log.txt"
|
||||
|
||||
if os.path.exists(log_path):
|
||||
print(f"✅ Log encontrado: {log_path}")
|
||||
try:
|
||||
# Leer últimas 50 líneas
|
||||
result = subprocess.run(['tail', '-50', log_path], capture_output=True, text=True)
|
||||
print(f"\nÚltimas 50 líneas del log:")
|
||||
print("-" * 60)
|
||||
print(result.stdout)
|
||||
print("-" * 60)
|
||||
|
||||
# Buscar mensajes relevantes
|
||||
if 'AbletonMCP' in result.stdout or '9877' in result.stdout:
|
||||
print("✅ Encontradas referencias a AbletonMCP en el log")
|
||||
else:
|
||||
print("⚠️ No se encontraron referencias a AbletonMCP en las últimas líneas")
|
||||
print(" Esto puede significar que el remote script no se cargó")
|
||||
except Exception as e:
|
||||
print(f"❌ Error leyendo log: {e}")
|
||||
else:
|
||||
print(f"❌ Log no encontrado en: {log_path}")
|
||||
print(" Verifica la ruta del log de Ableton")
|
||||
|
||||
def check_remote_script():
|
||||
"""Verifica que el remote script existe"""
|
||||
print(f"\n{'='*60}")
|
||||
print(f"📁 Verificando Remote Script")
|
||||
print(f"{'='*60}")
|
||||
|
||||
script_path = "/mnt/c/ProgramData/Ableton/Live 12 Suite/Resources/MIDI Remote Scripts/AbletonMCP_AI/__init__.py"
|
||||
|
||||
if os.path.exists(script_path):
|
||||
print(f"✅ Remote script encontrado: {script_path}")
|
||||
|
||||
# Verificar que tiene el socket server
|
||||
try:
|
||||
with open(script_path, 'r') as f:
|
||||
content = f.read()
|
||||
if 'socket' in content and '9877' in content:
|
||||
print("✅ Remote script contiene código de socket server")
|
||||
if '0.0.0.0' in content or 'DEFAULT_HOST' in content:
|
||||
print("✅ Configurado para escuchar en todas las interfaces")
|
||||
else:
|
||||
print("⚠️ Puede estar configurado solo para localhost")
|
||||
else:
|
||||
print("❌ Remote script no parece tener código de socket")
|
||||
except Exception as e:
|
||||
print(f"Error leyendo script: {e}")
|
||||
else:
|
||||
print(f"❌ Remote script NO encontrado: {script_path}")
|
||||
|
||||
def main():
|
||||
print("="*60)
|
||||
print("🔧 DIAGNÓSTICO DE CONECTIVIDAD ABLETON MCP")
|
||||
print("="*60)
|
||||
print(f"Fecha: {subprocess.run(['date'], capture_output=True, text=True).stdout.strip()}")
|
||||
|
||||
get_network_info()
|
||||
check_remote_script()
|
||||
check_ableton_log()
|
||||
test_windows_ports()
|
||||
|
||||
print(f"\n{'='*60}")
|
||||
print("📊 RESUMEN DEL DIAGNÓSTICO")
|
||||
print(f"{'='*60}")
|
||||
print("""
|
||||
Si todas las conexiones fallaron con "Connection refused" (111):
|
||||
→ El remote script no está corriendo o no escucha en la red
|
||||
→ Solución: Verifica que Ableton tenga cargado AbletonMCP_AI en Preferencias → MIDI
|
||||
|
||||
Si falla con "No route to host" (113) o timeout (110):
|
||||
→ Problema de red entre WSL y Windows
|
||||
→ Solución: Configurar firewall de Windows o usar WSL1
|
||||
|
||||
Recomendaciones:
|
||||
1. En Ableton: Preferencias → MIDI → Control Surfaces → Seleccionar AbletonMCP_AI
|
||||
2. En Windows (PowerShell Admin): netsh advfirewall firewall add rule name="AbletonMCP-AI" dir=in action=allow protocol=TCP localport=9877
|
||||
3. Reiniciar Ableton Live después de cambios
|
||||
""")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user