• Announcements

    • 1. Check power supply, check SD card and check other people experiences

      Power supply issues are one of the three biggest issues you'll face when starting with Single Board Computers (SBCs). SD card issues, whether fake or faulty, are another and issues resulting from poor board design is the other common issues you can encounter.   Power supply issues can be tricky. You might have a noisy power supply that works with one board because it has extra filtering, but won't work with another. Or you're using that cheap phone charger because your board has a microUSB connector, and it is either erratic, or doesn't start up, or even becomes the cause of some SD card issues.    Some tips to avoid the most common causes of problems reported:   Don't power via micro USB  - unless you have optimised your setup for low power requirements. Micro USB is great for mobile phones because they are simply charging a battery. It's bad for SBCs. Yes, it does work for a lot of people, but it also causes more problems and headaches over time than it is worth, unless you know exactly what you are doing. If you have a barrel jack power connector on your SBC, use it instead! If there is an option for powering via header connections, use that option!
        Don't use mobile phone chargers. They might be convenient and cheap, but this is because they are meant for charging phones, not powering your SBC which has particular power requirements.
        When you are evaluating a power supply, make sure you run some stress tests on your system to ensure that it will not cause issues down the path.   (Micro) SD card issues can be sneaky. They might appear right at the start causing strange boot and login errors, or they might cause problems over time. It is best to run a test on any new SD card you use, to ensure that it really is what it is, and to ensure that isn't faulty. Armbian provides you a simple way to do this   --   armbianmonitor -c /path/to/device/to/test  
    • 2. Make sure to collect and provide all necessary information

      We can only help if you provide quality information for us to work with. All stable images from the download section are tested, most stable upgrades are tested and we have tens of thousands of users. Even with regular and extensive testings, bugs sometimes do slip through. This is a voluntary support service and is unrelated to board makers, and is not obligated to provide you any answers. Repeated asking the same questions because you're not happy with the answers will result in you being ignored.

      Before you post a question, use the forum search as someone else might have already had the same problem and resolved it. And make sure you've read the Armbian documentation. If you still haven't found an answer, make sure you include the following in your post:   1. Logs when you can boot the board: armbianmonitor -u (paste URL to your forum post)   2. If your board does not boot, provide a log from serial console or at least make a picture, where it stops.   3. Describe the problem the best you can and provide all necessary info that we can reproduce the problem. We are not clairvoyant or mind readers. Please describe your setup as best as possible so we know what your operating environment is like.     We will not help in cases you are not using stable official Armbian builds, you have a problem with 3rd party hardware or reported problem would not be able to reproduced.

Jack error
0

6 posts in this topic

Recommended Posts

So I'm trying to modify a certain Mycroft skill (python) to be able to play local news. Here is the commit: https://github.com/marksev1/mycroft-core/commit/164c7207374131ece23a8ddf40c7a7981f3c7084

 

And this python script uses mpg123 to play the mp3 from the url.

 

1.) If I play the mp3 in the url from the terminal normally it plays every time.

 

2.) If I'd try to play it from that python script it only randomly plays and in the meantime i get errors regarding jack. See here, first time it succeeded then it failed multiple times: 

2016-09-05 14:11:02,437 - Skills - DEBUG - {"message_type": "speak", "context": null, "metadata": {"utterance": "Here is the top of the morning news from Slovenia."}}
2016-09-05 14:11:04,005 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_end", "context": null, "metadata": {}}
2016-09-05 14:11:04,008 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_start", "context": null, "metadata": {}}
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
        version 1.20.1; written and copyright by Michael Hipp and others
        free software (LGPL) without any warranty but with best wishes

Directory: http://videoweb.rtvslo.si/podcast/ava_archive03/2016/09/05/
Playing MPEG stream 1 of 1: Drugajutranjakronika38b3bdd8.mp3 ...

MPEG 1.0 layer III, 128 kbit/s, 48000 Hz joint-stereo
2016-09-05 14:11:06,860 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_end", "context": null, "metadata": {}}
2016-09-05 14:11:16,490 - Skills - DEBUG - {"message_type": "recognizer_loop:utterance", "context": null, "metadata": {"utterances": ["stop"]}}
2016-09-05 14:11:16,501 - Skills - DEBUG - {"message_type": "StopIntent", "context": {"target": null}, "metadata": {"StopKeyword": "stop", "intent_type": "StopIntent", "utterance": "stop", "confidence": 1.0, "target": null}}
2016-09-05 14:11:16,506 - Skills - DEBUG - {"message_type": "mycroft.stop", "context": null, "metadata": {}}
2016-09-05 14:11:16,514 - Skills - DEBUG - {"message_type": "speak", "context": null, "metadata": {"utterance": "news playback ended"}}
2016-09-05 14:11:16,567 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_start", "context": null, "metadata": {}}
2016-09-05 14:11:20,427 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_end", "context": null, "metadata": {}}
2016-09-05 14:11:21,025 - Skills - DEBUG - {"message_type": "recognizer_loop:utterance", "context": null, "metadata": {"utterances": ["news"]}}
2016-09-05 14:11:21,033 - Skills - DEBUG - {"message_type": "SLONewsIntent", "context": {"target": null}, "metadata": {"SLONewsKeyword": "news", "intent_type": "SLONewsIntent", "utterance": "news", "confidence": 1.0, "target": null}}
2016-09-05 14:11:22,330 - Skills - DEBUG - {"message_type": "speak", "context": null, "metadata": {"utterance": "Here is this morning's news from Slovenia."}}
2016-09-05 14:11:22,391 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_start", "context": null, "metadata": {}}

[jack.c:252] error: Failed to open jack client: 0x1
[jack.c:58] warning: FIXME: One needs to wait or write some silence here to prevent the last bits of audio to vanish out of the ringbuffer.
2016-09-05 14:11:28,094 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_end", "context": null, "metadata": {}}
2016-09-05 14:11:49,225 - Skills - DEBUG - {"message_type": "recognizer_loop:utterance", "context": null, "metadata": {"utterances": ["stop"]}}
2016-09-05 14:11:49,236 - Skills - DEBUG - {"message_type": "StopIntent", "context": {"target": null}, "metadata": {"StopKeyword": "stop", "intent_type": "StopIntent", "utterance": "stop", "confidence": 1.0, "target": null}}
2016-09-05 14:11:49,241 - Skills - DEBUG - {"message_type": "mycroft.stop", "context": null, "metadata": {}}
2016-09-05 14:11:56,488 - Skills - DEBUG - {"message_type": "recognizer_loop:utterance", "context": null, "metadata": {"utterances": ["news"]}}
2016-09-05 14:11:56,498 - Skills - DEBUG - {"message_type": "SLONewsIntent", "context": {"target": null}, "metadata": {"SLONewsKeyword": "news", "intent_type": "SLONewsIntent", "utterance": "news", "confidence": 1.0, "target": null}}
2016-09-05 14:11:57,787 - Skills - DEBUG - {"message_type": "speak", "context": null, "metadata": {"utterance": "Here is the top of the morning news from Slovenia."}}
2016-09-05 14:11:57,929 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_start", "context": null, "metadata": {}}

[jack.c:252] error: Failed to open jack client: 0x1
[jack.c:58] warning: FIXME: One needs to wait or write some silence here to prevent the last bits of audio to vanish out of the ringbuffer.
2016-09-05 14:12:04,471 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_end", "context": null, "metadata": {}}
2016-09-05 14:12:11,712 - Skills - DEBUG - {"message_type": "recognizer_loop:utterance", "context": null, "metadata": {"utterances": ["stop"]}}
2016-09-05 14:12:11,721 - Skills - DEBUG - {"message_type": "StopIntent", "context": {"target": null}, "metadata": {"StopKeyword": "stop", "intent_type": "StopIntent", "utterance": "stop", "confidence": 1.0, "target": null}}
2016-09-05 14:12:11,728 - Skills - DEBUG - {"message_type": "mycroft.stop", "context": null, "metadata": {}}
2016-09-05 14:12:14,560 - Skills - DEBUG - {"message_type": "recognizer_loop:utterance", "context": null, "metadata": {"utterances": ["news"]}}
2016-09-05 14:12:14,570 - Skills - DEBUG - {"message_type": "SLONewsIntent", "context": {"target": null}, "metadata": {"SLONewsKeyword": "news", "intent_type": "SLONewsIntent", "utterance": "news", "confidence": 1.0, "target": null}}
2016-09-05 14:12:15,866 - Skills - DEBUG - {"message_type": "speak", "context": null, "metadata": {"utterance": "Here is the top of the morning news from Slovenia."}}
2016-09-05 14:12:15,871 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_start", "context": null, "metadata": {}}

[jack.c:252] error: Failed to open jack client: 0x1
[jack.c:58] warning: FIXME: One needs to wait or write some silence here to prevent the last bits of audio to vanish out of the ringbuffer.
2016-09-05 14:12:23,311 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_end", "context": null, "metadata": {}}
2016-09-05 14:12:28,055 - Skills - DEBUG - {"message_type": "recognizer_loop:utterance", "context": null, "metadata": {"utterances": ["stop"]}}
2016-09-05 14:12:28,064 - Skills - DEBUG - {"message_type": "StopIntent", "context": {"target": null}, "metadata": {"StopKeyword": "stop", "intent_type": "StopIntent", "utterance": "stop", "confidence": 1.0, "target": null}}
2016-09-05 14:12:28,069 - Skills - DEBUG - {"message_type": "mycroft.stop", "context": null, "metadata": {}}
2016-09-05 14:12:29,447 - Skills - DEBUG - {"message_type": "recognizer_loop:utterance", "context": null, "metadata": {"utterances": ["news"]}}
2016-09-05 14:12:29,455 - Skills - DEBUG - {"message_type": "SLONewsIntent", "context": {"target": null}, "metadata": {"SLONewsKeyword": "news", "intent_type": "SLONewsIntent", "utterance": "news", "confidence": 1.0, "target": null}}
2016-09-05 14:12:30,784 - Skills - DEBUG - {"message_type": "speak", "context": null, "metadata": {"utterance": "Here is the top of the morning news from Slovenia."}}
2016-09-05 14:12:30,905 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_start", "context": null, "metadata": {}}

[jack.c:252] error: Failed to open jack client: 0x1
[jack.c:58] warning: FIXME: One needs to wait or write some silence here to prevent the last bits of audio to vanish out of the ringbuffer.
2016-09-05 14:12:38,300 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_end", "context": null, "metadata": {}}
2016-09-05 14:12:40,936 - Skills - DEBUG - {"message_type": "recognizer_loop:utterance", "context": null, "metadata": {"utterances": ["stop"]}}
2016-09-05 14:12:40,946 - Skills - DEBUG - {"message_type": "StopIntent", "context": {"target": null}, "metadata": {"StopKeyword": "stop", "intent_type": "StopIntent", "utterance": "stop", "confidence": 1.0, "target": null}}
2016-09-05 14:12:40,951 - Skills - DEBUG - {"message_type": "mycroft.stop", "context": null, "metadata": {}}

Can someone please help me debug I don't even know to which "jack" package this error is reffering, since I think I'm even not using this jack package...

Share this post


Link to post
Share on other sites

I figured out that i can't run two terminals with mpg123 i get the same error (i'm running alsa not pulseaudio):

msev@orangepipc:~$ mpg123 http://videoweb.rtvslo.si/podcast/ava_archive03/2016/09/05/Drugajutranjakronika38b3bdd8.mp3

[jack.c:252] error: Failed to open jack client: 0x1
[jack.c:58] warning: FIXME: One needs to wait or write some silence here to prevent the last bits of audio to vanish out of the ringbuffer.
Segmentation fault

Regarding python. Still doesn't work. Now we have different errors 

2016-09-06 11:35:57,296 - Skills - DEBUG - {"message_type": "speak", "context": null, "metadata": {"utterance": "Sorry, I don't understand the phrase "}}
2016-09-06 11:35:57,347 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_start", "context": null, "metadata": {}}
2016-09-06 11:36:02,506 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_end", "context": null, "metadata": {}}
2016-09-06 11:36:02,806 - Skills - DEBUG - {"message_type": "recognizer_loop:utterance", "context": null, "metadata": {"utterances": ["news"]}}
2016-09-06 11:36:02,821 - Skills - DEBUG - {"message_type": "SLONewsIntent", "context": {"target": null}, "metadata": {"SLONewsKeyword": "news", "intent_type": "SLONewsIntent", "utterance": "news", "confidence": 1.0, "target": null}}
2016-09-06 11:36:04,177 - Skills - DEBUG - {"message_type": "speak", "context": null, "metadata": {"utterance": "Here is the top of the morning news from Slovenia."}}
2016-09-06 11:36:04,183 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_start", "context": null, "metadata": {}}

[alsa.c:170] error: cannot open device default

[audio.c:643] error: failed to open audio device

[audio.c:180] error: Unable to find a working output module in this list: alsa

[audio.c:545] error: Failed to open audio output module

[mpg123.c:913] error: Failed to initialize output, goodbye.
2016-09-06 11:36:11,617 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_end", "context": null, "metadata": {}}
2016-09-06 11:36:35,483 - Skills - DEBUG - {"message_type": "recognizer_loop:utterance", "context": null, "metadata": {"utterances": ["news"]}}
2016-09-06 11:36:35,492 - Skills - DEBUG - {"message_type": "SLONewsIntent", "context": {"target": null}, "metadata": {"SLONewsKeyword": "news", "intent_type": "SLONewsIntent", "utterance": "news", "confidence": 1.0, "target": null}}
2016-09-06 11:36:36,701 - Skills - DEBUG - {"message_type": "speak", "context": null, "metadata": {"utterance": "Here is the top of the morning news from Slovenia."}}
2016-09-06 11:36:36,706 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_start", "context": null, "metadata": {}}

[alsa.c:170] error: cannot open device default

[audio.c:643] error: failed to open audio device

[audio.c:180] error: Unable to find a working output module in this list: alsa

[audio.c:545] error: Failed to open audio output module

[mpg123.c:913] error: Failed to initialize output, goodbye.
2016-09-06 11:36:44,143 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_end", "context": null, "metadata": {}}
2016-09-06 11:36:54,091 - Skills - DEBUG - {"message_type": "recognizer_loop:utterance", "context": null, "metadata": {"utterances": ["news"]}}
2016-09-06 11:36:54,101 - Skills - DEBUG - {"message_type": "SLONewsIntent", "context": {"target": null}, "metadata": {"SLONewsKeyword": "news", "intent_type": "SLONewsIntent", "utterance": "news", "confidence": 1.0, "target": null}}
2016-09-06 11:36:55,358 - Skills - DEBUG - {"message_type": "speak", "context": null, "metadata": {"utterance": "Here is this morning's news from Slovenia."}}
2016-09-06 11:36:55,363 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_start", "context": null, "metadata": {}}

[alsa.c:170] error: cannot open device default

[audio.c:643] error: failed to open audio device

[audio.c:180] error: Unable to find a working output module in this list: alsa

[audio.c:545] error: Failed to open audio output module

[mpg123.c:913] error: Failed to initialize output, goodbye.
2016-09-06 11:37:01,066 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_end", "context": null, "metadata": {}}
2016-09-06 11:37:04,891 - Skills - DEBUG - {"message_type": "recognizer_loop:utterance", "context": null, "metadata": {"utterances": ["news"]}}
2016-09-06 11:37:04,900 - Skills - DEBUG - {"message_type": "SLONewsIntent", "context": {"target": null}, "metadata": {"SLONewsKeyword": "news", "intent_type": "SLONewsIntent", "utterance": "news", "confidence": 1.0, "target": null}}
2016-09-06 11:37:06,118 - Skills - DEBUG - {"message_type": "speak", "context": null, "metadata": {"utterance": "Here is this morning's news from Slovenia."}}
2016-09-06 11:37:06,154 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_start", "context": null, "metadata": {}}

[alsa.c:170] error: cannot open device default

[audio.c:643] error: failed to open audio device

[audio.c:180] error: Unable to find a working output module in this list: alsa

[audio.c:545] error: Failed to open audio output module

[mpg123.c:913] error: Failed to initialize output, goodbye.
2016-09-06 11:37:11,871 - Skills - DEBUG - {"message_type": "recognizer_loop:audio_output_end", "context": null, "metadata": {}}
2016-09-06 11:37:18,887 - mycroft.messagebus.client.ws - ERROR - Exception("Uncaught 'error' event.",)
2016-09-06 11:37:18,888 - mycroft.messagebus.client.ws - WARNING - Disconnecting on error, reconnecting in 1 seconds.

Share this post


Link to post
Share on other sites

You may need to specify output device explicitly like this

def play_mp3(file_path):
    return subprocess.Popen(["mpg123", "-a hw:0", file_path])

or

def play_mp3(file_path):
    return subprocess.Popen(["mpg123", "-a hw:1", file_path]) 

In case this applications tries to run second instance of mpg123 while previous one didn't close yet, this will cause problems with default configuration for ALSA. You'll have to either set up dmix configuration for ALSA (explained here in the middle of the page) or install and configure Pulseaudio.

Share this post


Link to post
Share on other sites

Yeah its probably that since if I do    #self.speak_dialog('slo.news')

It then plays the mp3 everytime from the script.

 

Also if i do it like this everything works:

 

    def handle_intent(self, message):
        try:
            self.speak_dialog('slo.news')
            time.sleep(2)
            data = feedparser.parse(self.url_rss)
            time.sleep(5)
            self.process = play_mp3(data['entries'][0]['links'][0]['href'])

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

0

  • Support the project

    We need your help to stay focused on the project.

    Choose the amount and currency you would like to donate in below.