Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strange output sound #689

Open
marco6971 opened this issue Jun 15, 2018 · 24 comments
Open

strange output sound #689

marco6971 opened this issue Jun 15, 2018 · 24 comments

Comments

@marco6971
Copy link

hi, i'm marco and i'm planning to build an automatization of my room.
I think that jasper is working fine, or at least, it is doing is work in right way.
https://pastebin.com/adiEefVy

when i say jasper it can recognize my voice (line 3)
it reproduce the high bip (line 5)
I say what time is it
it reproduce the low bip (line 8)
it recognize my question (line 13)
it give to me the answer (line 20)
connect to google and retrieve the answer (line 35-->41)
save the answer in a temp file (line 43-44)
and play that (line 45)

https://vocaroo.com/i/s1zyUuR9XdjN this is the result that i get from https://translate.google.com/translate_tts?q=It+is+1%3A57+PM+right+now.&tl=en&client=tw-ob&textlen=24&idx=0&ttsspeed=1&total=1&ie=UTF-8&tk=757478.914885 (I don't know if this is only a temporary link or no so i uploaded that.)
https://vocaroo.com/i/s12znRYIJ0kT this is what happens, obviusly the problem is the machine gun like sound.

i replace the line 76 of client/tts.py with cmd = ['aplay', '-D', 'plughw:0,1', str(filename)] instad of plughw:1,0

when i use these command everything is working fine
arecord -f S32_LE -D hw:1,0 -c 4 -r 16000 test.wav
aplay -D plughw:0,1 test.wav

this is my profile.yml https://pastebin.com/CUFgRU3v

@G10DRAS
Copy link

G10DRAS commented Jun 15, 2018

Whats the output of
aplay -l

@marco6971
Copy link
Author

**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 7/7
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0

@G10DRAS
Copy link

G10DRAS commented Jun 15, 2018

Ok try

['aplay', '-D', 'plughw:0,0', str(filename)]

See if it works

@marco6971
Copy link
Author

sad but no

@G10DRAS
Copy link

G10DRAS commented Jun 15, 2018

Did you connect Pi to HDMI ?

Try another tts engine and see if that works.

@marco6971
Copy link
Author

with pico-tts works

@marco6971
Copy link
Author

marco6971 commented Jun 15, 2018

i find that #641 but i don't know how to use it
ok, i pu this line os.system("omxplayer " + tmpfile) in tts.py but it doesn't work

@G10DRAS
Copy link

G10DRAS commented Jun 15, 2018

There was a problem with pymad lib.
I am using pymad==0.7 and its works for me.
Which version of pymad you are using ?

@marco6971
Copy link
Author

python-pymad is already the newest version (0.9-1+b1)

@G10DRAS
Copy link

G10DRAS commented Jun 15, 2018

I see a change in tts.py line 103
wav.setsampwidth(4L)
mine is
wav.setsampwidth(4)

also try using pymad 0.7

@marco6971
Copy link
Author

sorry i'm new to linux, i use sudo apt-get install pymad=0.7 but it responds E: Version '0.7' for 'python-pymad' was not found
even change the line 103 i can't reproduce anything

@G10DRAS
Copy link

G10DRAS commented Jun 15, 2018

sudo pip install pymad==0.7

@marco6971
Copy link
Author

marco6971 commented Jun 15, 2018

osmc@osmc-Cecil:~$ sudo pip install pymad==07
Collecting pymad==07
  Could not find a version that satisfies the requirement pymad==07 (from versions: 0.9, 0.10)
No matching distribution found for pymad==07
You are using pip version 9.0.3, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
osmc@osmc-Cecil:~$ sudo pip install pymad==0.7
Collecting pymad==0.7
  Could not find a version that satisfies the requirement pymad==0.7 (from versions: 0.9, 0.10)
No matching distribution found for pymad==0.7
You are using pip version 9.0.3, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

@marco6971
Copy link
Author

i already do that, i edit the previus comment so it can be seen better

@G10DRAS
Copy link

G10DRAS commented Jun 15, 2018

Try
sudo apt-get install python-pymad=0.7

@G10DRAS
Copy link

G10DRAS commented Jun 15, 2018

Which OS are you using ?

@marco6971
Copy link
Author

marco6971 commented Jun 15, 2018

i'm using OSMC on raspberry pi 3

osmc@osmc-Cecil:~$ sudo apt-get install python-pymad=0.7
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Version '0.7' for 'python-pymad' was not found

@marco6971
Copy link
Author

this is what i get running python.py

*******************************************************
*             JASPER - THE TALKING COMPUTER           *
* (c) 2015 Shubhro Saha, Charlie Marsh & Jan Holthuis *
*******************************************************
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.front.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM front
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround40.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround71.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
WARNING:client.notifier:gmail_address or gmail_password not set in profile, Gmail notifier will not be used
INFO:client.stt:Transcribed: ['IT IS']
INFO:client.stt:Transcribed: ['IT']
INFO:client.stt:Transcribed: ['NOW']
INFO:client.stt:Transcribed: ['IS ON']
INFO:client.stt:Transcribed: ['WHAT RIGHT']
INFO:client.stt:Transcribed: ['IS JASPER']
INFO:client.stt:Transcribed: [u'WHAT DAY IS IT']
INFO:client.stt:Transcribed: ['JASPER']
CRITICAL:client.stt:Request failed with response: u'{\n  "error" : "Something went wrong. We\'ve been notified.",\n  "code" : "wit"\n}'
Traceback (most recent call last):
  File "/home/osmc/jasper/client/stt.py", line 594, in transcribe
    r.raise_for_status()
  File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 939, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
HTTPError: 500 Server Error: Internal Server Error for url: https://api.wit.ai/speech?v=20150101
INFO:client.stt:Transcribed: ['SAY BUT ON IS OF']
INFO:client.stt:Transcribed: ['BUT IT ON']
INFO:client.stt:Transcribed: ['DID']
No disturbance detected
No disturbance detected
INFO:client.stt:Transcribed: ['SAY']
INFO:client.stt:Transcribed: ['OF']
INFO:client.stt:Transcribed: ['IT']
No disturbance detected
INFO:client.stt:Transcribed: ['WORK']
INFO:client.stt:Transcribed: ['JASPER']
INFO:client.stt:Transcribed: [u'WHAT TIME IS IT']
No disturbance detected
No disturbance detected
No disturbance detected
No disturbance detected
No disturbance detected
No disturbance detected

@G10DRAS
Copy link

G10DRAS commented Jun 15, 2018

Try updated url for wit.ai
https://api.wit.ai/message?v=20171212

@marco6971
Copy link
Author

Ok thanks i correct the second error with this

@G10DRAS
Copy link

G10DRAS commented Jun 15, 2018

for first error try installing omxplayer
sudo apt-get install omxplayer

and try that hack you mentioned above.

@marco6971
Copy link
Author

marco6971 commented Jun 16, 2018

osmc is a kodi build so it cames with omxplayer already installed except for libs and binary that i must copy from another raspian installation,i'll figure how in the next week

@marco6971
Copy link
Author

hi, i'm working on but i screwed something that i don't know with alsa, i'll try with a reinstall from 0 but at the moment i don't have much time

@G10DRAS
Copy link

G10DRAS commented Jun 26, 2018

Whats that issue with alsa?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants