Giter Site home page Giter Site logo

alexadevice's Introduction

Alexa Device

This project allows to launch Alexa on any Linux devices, even on embedded devices like Raspberry Pi (with usb headset).

Running

  • Follow this manual to create your own device and security profile - https://github.com/alexa/avs-device-sdk/wiki/Create-Security-Profile
    Add http://alexa.local:3000/authresponse to Allowed Return URLs and http://alexa.local:3000 to Allowed Origins Note this step can be skipped if you already have device profile credentials.
  • Install dependencies
sudo apt install python3-pip git ffmpeg swig libportaudio2 portaudio19-dev libpulse-dev
sudo pip3 install requests 'git+https://github.com/moaxey/python-zeroconf' pocketsphinx pyaudio

Note 'libpulse-dev' should be installed only for PulseAudio based devices. 'pyaduio', 'libportaudio2' and 'portaudio19-dev' should be installed on other devices, for example alsa capable.

  • Make sure your system has PulseAudio support.
  • Run
python3 alexa.py
  • Open http://alexa.local:3000 in web browser on local device or device in the same network. Note app provides mDNS advertisement of local domain alexa.local. This is very helpful for using with monitorless devices.
  • Fill device credentials which was created in step 1, click 'log in'. Note Voice detection threshold is float value for adjusting voice detection. The less value, the easier to trigger. You may need to adjust it for your mic and voice.
  • Fill your amazon credentials.
  • Now you can speak with Alexa. App uses voice activation. Say 'Alexa' and phrase that you want to say to her. App makes beep in speakers when it hear 'Alexa' keyword and start recording.

App can be built as snap package. Install pulseaudio snap before installing this:

sudo snap install --devmode pulseaudio

Now build and install:

cd snap
snacraft
sudo snap install --devmode alexa_1.0_amd64.snap

Note if you modified snap to used for alsa based devices, then additionally call this line sudo snap connect alexa:alsa :alsa.

Similar open source software

Python Alexa Voice Service - https://github.com/nicholasjconn/python-alexa-voice-service

alexadevice's People

Contributors

nikolay-kha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alexadevice's Issues

alexa snap fails to establish listening port

Using alexa (beta) 1.1 from 'data-art' on Ubuntu 17.04 x86_64.

Using these snap install instructions, I received an info message during install, and saw no listening port 3000 subsequent to the install. I'm quite new at snap usage, so this may be an error on my part.

root@NUC7i7BNH:~# snap install --devmode pulseaudio
2017-05-22T00:29:20Z INFO cannot auto connect core:core-support-plug to core:core-support: (slot auto-connection), existing connection state "core:core-support-plug core:core-support" in the way
2017-05-22T00:29:22Z INFO cannot auto connect core:core-support-plug to core:core-support: (slot auto-connection), existing connection state "core:core-support-plug core:core-support" in the way
2017-05-22T00:29:25Z INFO cannot auto connect pulseaudio:client (plug auto-connection), candidates found: "core:pulseaudio, pulseaudio:service"
pulseaudio 8.0-3 from 'canonical' installed
root@NUC7i7BNH:~# snap install --channel beta alexa
2017-05-22T00:30:09Z INFO cannot auto connect alexa:pulseaudio (plug auto-connection), candidates found: "core:pulseaudio, pulseaudio:service"
alexa (beta) 1.1 from 'data-art' installed
root@NUC7i7BNH:~# netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 192.168.2.96:53         0.0.0.0:*               LISTEN      13732/named         
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      3770/sshd           
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      3263/cupsd          
tcp        0      0 127.0.0.1:32600         0.0.0.0:*               LISTEN      12346/Plex Tuner Se 
tcp        0      0 127.0.0.1:7001          0.0.0.0:*               LISTEN      13784/nxnode.bin    
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN      13732/named         
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      3724/master         
tcp        0      0 0.0.0.0:4000            0.0.0.0:*               LISTEN      4026/nxd            
tcp        0      0 127.0.0.1:12001         0.0.0.0:*               LISTEN      13784/nxnode.bin    
tcp        0      0 0.0.0.0:1443            0.0.0.0:*               LISTEN      5553/vmware-hostd   
tcp        0      0 127.0.0.1:42661         0.0.0.0:*               LISTEN      12359/Plex Plug-in  
tcp        0      0 0.0.0.0:902             0.0.0.0:*               LISTEN      5303/vmware-authdla 
tcp        0      0 127.0.0.1:25001         0.0.0.0:*               LISTEN      13819/nxclient.bin  
tcp        0      0 0.0.0.0:5355            0.0.0.0:*               LISTEN      3775/systemd-resolv 
tcp        0      0 127.0.0.1:20332         0.0.0.0:*               LISTEN      3790/nxserver.bin   
tcp        0      0 0.0.0.0:19150           0.0.0.0:*               LISTEN      4753/gkrellmd       
tcp        0      0 127.0.0.1:33263         0.0.0.0:*               LISTEN      12290/Plex Plug-in  
tcp        0      0 127.0.0.1:8307          0.0.0.0:*               LISTEN      5553/vmware-hostd   
tcp6       0      0 :::22                   :::*                    LISTEN      3770/sshd           
tcp6       0      0 ::1:631                 :::*                    LISTEN      3263/cupsd          
tcp6       0      0 ::1:7001                :::*                    LISTEN      13784/nxnode.bin    
tcp6       0      0 ::1:953                 :::*                    LISTEN      13732/named         
tcp6       0      0 :::25                   :::*                    LISTEN      3724/master         
tcp6       0      0 :::4000                 :::*                    LISTEN      4026/nxd            
tcp6       0      0 :::1443                 :::*                    LISTEN      5553/vmware-hostd   
tcp6       0      0 :::902                  :::*                    LISTEN      5303/vmware-authdla 
tcp6       0      0 :::5355                 :::*                    LISTEN      3775/systemd-resolv 
tcp6       0      0 :::19150                :::*                    LISTEN      4753/gkrellmd       
tcp6       0      0 :::32400                :::*                    LISTEN      12259/Plex Media Se 
tcp6       0      0 ::1:32401               :::*                    LISTEN      12259/Plex Media Se 
root@NUC7i7BNH:~# snap interfaces
Slot                      Plug
:account-control          -
:alsa                     -
:autopilot-introspection  -
:avahi-observe            -
:bluetooth-control        -
:browser-support          -
:camera                   -
:classic-support          -
:core-support             core:core-support-plug
:cups-control             -
:dcdbas-control           -
:docker-support           -
:firewall-control         -
:framebuffer              -
:fuse-support             -
:gsettings                -
:hardware-observe         -
:home                     pulseaudio
:io-ports-control         -
:joystick                 -
:kernel-module-control    -
:kubernetes-support       -
:libvirt                  -
:locale-control           -
:log-observe              -
:lxd-support              -
:modem-manager            -
:mount-observe            -
:network                  alexa,pulseaudio
:network-bind             alexa
:network-control          -
:network-manager          -
:network-observe          -
:network-setup-control    -
:network-setup-observe    -
:ofono                    -
:opengl                   -
:openvswitch              -
:openvswitch-support      -
:optical-drive            -
:physical-memory-control  -
:physical-memory-observe  -
:ppp                      -
:process-control          -
:pulseaudio               -
:raw-usb                  -
:removable-media          -
:screen-inhibit-control   -
:shutdown                 -
:snapd-control            -
:system-observe           -
:system-trace             -
:time-control             -
:timeserver-control       -
:timezone-control         -
:tpm                      -
:uhid                     -
:unity7                   -
:upower-observe           -
:x11                      -
pulseaudio:service        pulseaudio:client
-                         alexa:pulseaudio
root@NUC7i7BNH:~# snap run alexa
xcb_connection_has_error() returned true
shm_open() failed: Permission denied
Failed to create secure directory (/run/user/0/snap.alexa/pulse): No such file or directory
Traceback (most recent call last):
  File "/snap/alexa/2/bin/alexa.py", line 20, in <module>
    main()
  File "/snap/alexa/2/bin/alexa.py", line 10, in main
    alexa_audio_device.init()
  File "/snap/alexa/2/bin/alexa_audio_device_pulse.py", line 29, in init
    + str(pa.strerror(error), 'ascii'))
Exception: Could not create pulse audio output stream: No such device or address
root@NUC7i7BNH:~# mount|grep shm
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
root@NUC7i7BNH:~# 

wm8750: could not get coeff for mclk 11289600 @ rate 48000

I found that this message is from kernel(https://github.com/spotify/linux/blob/master/sound/soc/codecs/wm8750.c). But what does this mean? Why it is thrown if I run
python3 alexa.py
root@imx7-1gb:~/AlexaDevice-1.1# python3 alexa.py
wm8750: could not get coeff for mclk 11289600 @ rate 48000
wm8750: could not get coeff for mclk 11289600 @ rate 48000
[04/06/2018 06:49:55] PulseAudio wm8750: could not get coeff for mclk 11289600 @ rate 48000
is initialized.
wm8750: could not get coeff for mclk 11289600 @ rate 48000
wm8750: could not get coeff for mclk 11289600 @ rate 48000

please stop using snap

Snap pollutes the user's environment and is generally unacceptable for a packaging solution.
I can defend this in the chance it is not already painfully obvious.

Please use rpm's and deb's.

-C

Segmentation fault in ubuntu 14.04

[08/06/2018 15:35:19] PulseAudio is initialized.
[08/06/2018 15:35:19] Local IP is 192.168.6.181
[08/06/2018 15:35:20] Local mDNS is started, domain is alexa.local
[08/06/2018 15:35:20] Local HTTP is http://alexa.local:3000/
[08/06/2018 15:35:20] Alexa found config.
Segmentation fault (core dumped)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.