1

I'm new to the Raspberry Pi and electronics and I have really been struggling getting any of my attempts at following Adafruit's electronic project guides to work. I am SSHing into my RasPi 2 from my MBP on my LAN.

Specs:

  • OS: RASPBIAN JESSIE
  • Hardware: Raspberry Pi 2, breadboard, buttons, wires, resistors, cobbler, Apple Earphones plugged into RPi2 3.5mm jack.

The code from the tutorial:

import os
from time import sleep

import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM)
GPIO.setup(23, GPIO.IN)
GPIO.setup(24, GPIO.IN)
GPIO.setup(25, GPIO.IN)

while True:
    if (GPIO.input(23) == False):
        os.system('mpg123 -q binary-language-moisture-evaporators.mp3 &')

    if (GPIO.input(24) == False):
        os.system('mpg123 -q power-converters.mp3 &')

    if (GPIO.input(25)== False):
        os.system('mpg123 -q vader.mp3 &')

    sleep(0.1);

But get the error message:

[jack.c:252] error: Failed to open jack client: 0x11
[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.
jack server is not running or cannot be started
jack server is not running or cannot be started

To troubleshoot, I found the following code as a suggestion and ran it:

pi@raspberrypi:~ $ amixer cget numid=3 1
numid=3,iface=MIXER,name='PCM Playback Route'
  ; type=INTEGER,access=rw------,values=1,min=0,max=2,step=0
  : values=1

The objective was to set the audio output to the 3.5mm jack. However, the error message above persists. Any ideas? Please let me know if you need more info.

Thanks.

-1

Two things I am seeing from the tutorial:

Did you run both of these commands as sudo?

sudo modprobe snd_bcm2835
sudo amixer cset numid=3 1

And are you running the python script as sudo?

sudo python raspi-audio-button.py
  • If you need more detail on the original question the place to ask is in the comments section. Answers are reserved for... well... answers. – goobering Feb 10 '16 at 18:14
  • 1
    @goobering These are obviously rhetorical in the sense that Jared is saying, "You should have done this" -- they do not, in fact, invite an answer or discussion. An inappropriate question to ask in an answer would be "What settings did you use with amixer?", which literally asks for an answer/discussion. – goldilocks Feb 10 '16 at 20:07
  • Sorry, I'm not removing the downvote. Those are not obviously rhetorical questions. – goobering Feb 10 '16 at 20:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.