Ankündigung

Einklappen
Keine Ankündigung bisher.

cvcl & pulseaudio funktioniert nicht innerhalb von SmarthomeNG aber ausserhalb

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    #16
    Zitat von bmx Beitrag anzeigen
    Wenn Du SmartHomeNG als Dienst laufen hast, was sagt den ein Code:

    ps aux | grep smarthome
    bmx ich habe den Code erst für den manuellen Start von SmarthomeNG und dann als Dienst im Terminal laufen lassen (siehe unten). Siehst Du hier etwas verdächtiges?

    Code:
    [smarthome@merry /usr/local/smarthome]$ ps aux | grep smarthome
    root     17372  0.1  0.6  12240  6348 ?        Ss   20:31   0:00 sshd: smarthome [priv]
    root     17374  0.1  0.6  12240  6308 ?        Ss   20:31   0:00 sshd: smarthome [priv]
    smartho+ 17380  0.0  0.3  12240  3580 ?        S    20:31   0:00 sshd: smarthome@notty
    root     17382  0.0  0.6  12240  6388 ?        Ss   20:31   0:00 sshd: smarthome [priv]
    smartho+ 17388  0.0  0.5  12576  4832 ?        S    20:31   0:00 sshd: smarthome@pts/0
    smartho+ 17398  0.0  0.3  12240  3504 ?        S    20:31   0:00 sshd: smarthome@notty
    smartho+ 17484  0.0  0.0   7360   544 pts/0    S+   20:34   0:00 grep --color=auto smarthome
    smartho+ 32673  5.8  9.4 409332 89852 ?        Sl   Jan20  72:32 python3 bin/smarthome.py
     [smarthome@merry /usr/local/smarthome]$ sudo systemctl stop smarthome.service
     [smarthome@merry /usr/local/smarthome]$ ps -ef|grep smarthome|grep bin
    smartho+ 32673     1  5 Jan20 ?        01:12:35 python3 bin/smarthome.py
     [smarthome@merry /usr/local/smarthome]$ kill -9 32673
     [smarthome@merry /usr/local/smarthome]$ ps -ef|grep smarthome|grep bin
     [smarthome@merry /usr/local/smarthome]$ sudo systemctl start smarthome.service
     [smarthome@merry /usr/local/smarthome]$ sudo systemctl enable smarthome.service
     [smarthome@merry /usr/local/smarthome]$ sudo systemctl status smarthome.service
    ● smarthome.service - SmartHomeNG daemon
       Loaded: loaded (/lib/systemd/system/smarthome.service; enabled; vendor preset: enabled)
       Active: active (running) since Sat 2023-01-21 20:35:19 CET; 15s ago
     Main PID: 17524 (python3)
        Tasks: 25 (limit: 2062)
       Memory: 34.7M
       CGroup: /system.slice/smarthome.service
               └─17524 /usr/local/bin/python3 /usr/local/smarthome/bin/smarthome.py
    
    Jan 21 20:35:16 merry systemd[1]: Starting SmartHomeNG daemon...
    Jan 21 20:35:19 merry python3[17514]: Daemon PID 17524
    Jan 21 20:35:19 merry systemd[1]: smarthome.service: Supervising process 17524 which is not our child. We'll most likely not n
    Jan 21 20:35:19 merry systemd[1]: Started SmartHomeNG daemon.
    
     [smarthome@merry /usr/local/smarthome]$ ps aux | grep smarthome
    root     17372  0.0  0.6  12240  6348 ?        Ss   20:31   0:00 sshd: smarthome [priv]
    root     17374  0.0  0.6  12240  6308 ?        Ss   20:31   0:00 sshd: smarthome [priv]
    smartho+ 17380  0.0  0.3  12240  3580 ?        S    20:31   0:00 sshd: smarthome@notty
    root     17382  0.0  0.6  12240  6388 ?        Ss   20:31   0:00 sshd: smarthome [priv]
    smartho+ 17388  0.0  0.5  12576  4832 ?        S    20:31   0:00 sshd: smarthome@pts/0
    smartho+ 17398  0.0  0.3  12240  3504 ?        S    20:31   0:00 sshd: smarthome@notty
    smartho+ 17524 82.0  7.5 385636 71228 ?        S<l  20:35   0:44 /usr/local/bin/python3 /usr/local/smarthome/bin/smarthome.py
    smartho+ 17648  0.0  0.0   7360   540 pts/0    S+   20:36   0:00 grep --color=auto smarthome
    ​

    Zitat von bmx Beitrag anzeigen
    Und was steht in Deiner /etc/systemd/system/smarthome.service drin?
    ich habe in der Directory "/etc/systemd/system/​" nichts mit smarthome.service Sollte dies da sein?

    Kommentar


      #17
      Hi zusammen,

      ich habe exact das gleiche Problem.
      Wenn ich smarthome.ng über den Dienst starte geht die Audioausgabe von VLC nicht.
      Beim Starten von smarthome.ng geht die Audioausgabe.

      SmartHomeNG Version:v1.10.0-master (4b25822a0) in /usr/local/smarthome (tags/v1.10.0)​

      Konntest du das Problem lösen Sandro?

      Kommentar


        #18
        Hi derherbi,

        tut mir sehr Leid - habe Dein Post nicht gesehen.

        Für den Fall, dass Dein Problem noch besteht.

        Du musst audiopulse als smarthome user starten. Hier ein Beispiel:

        Code:
        try:
            subprocess.Popen(["/usr/bin/sudo", "-u", "smarthome", "pulseaudio", "--start"])
            command = subprocess.Popen(["/usr/bin/cvlc", "/usr/local/smarthome/media/audio/klingel/uplifting-bells.wav", "-Vdummy", "--play-and-exit"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
            (result, err) = command.communicate()
            p_status = command.wait()
            logging.info(f'cvlc output: {result}, errors: {err}')
        except Exception as e:
            logging.error(f'Error playing audio: {e}')
        ​

        Kommentar


          #19
          Hi brunosa3
          ich hatte das Thema ganz aus den Augen verloren.
          Danke für deinen Support, funktioniert wunderbar, ich kann smarthome.ng über den Diest starten und über den Code von dir in der Logik VLC starten.
          Hat wunderbar funktioniert.
          Danke für die Unterstützung! 🙂

          Kommentar

          Lädt...
          X