Home of the Squeezebox™ & Transporter® network music players.
Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15
  1. #11
    Senior Member
    Join Date
    Dec 2017
    Location
    PARIS, Fr
    Posts
    212
    Quote Originally Posted by chill View Post
    If you only have, say, a light switch available I guess you could make it work with that, but you'd have to make it clear that the switch would have to be toggled one way and then the other (closed then opened) in quick succession for a single 'press'. Since you only need the 'pause' function, you could leave out the 'stop' function, or define the long press to be so long (say 3000 milliseconds) that there's no danger of it accidentally being triggered. Or you could define the long press to be the same 'pause' function. Or you could just leave the long press undefined, so it's never triggered. Several options, but from memory I believe that the event is only triggered once the pin is ungrounded - I could be wrong there - so it would be important that the switch is always toggled both ways, and left in the 'open' position.
    Just a quick update:
    I just dont have the right tools to get the headphone remote work, but i was able to install everything the way you described, and by shortening the pins 18 and 20 (GPIO24 and GND on Pi3B) i was able to pause and play.
    But it didnt put sound out to the headphone.
    After removing the command (there is a small typo in your description: sbpd-script.sh instead of sbpd=script.sh) from tweaks its working again.
    Well thanks a lot, at least i know how it is working for now, but ill have to wait for the right tools.
    But why did the audio out stop working?

    Voice control and IR remote are out of question, the described gpio button would be perfect:-)
    The Earth Has Music For Those Who Listen

  2. #12
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Location
    Nottingham, UK
    Posts
    2,098
    The audio problem could be the mode that pigpio is using. I canít recall the details. Iíll check when I get back to my laptop and let you know.

  3. #13
    Senior Member
    Join Date
    Dec 2017
    Location
    PARIS, Fr
    Posts
    212
    Quote Originally Posted by chill View Post
    The audio problem could be the mode that pigpio is using. I canít recall the details. Iíll check when I get back to my laptop and let you know.
    Thank you very much, but donít worry too much about it for now.
    Well, maybe for other people, if they read this, you could find out?
    I will skip on this for now, until I have the right tools and a proper button to work with.
    Regards
    Pommes
    The Earth Has Music For Those Who Listen

  4. #14
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Location
    Nottingham, UK
    Posts
    2,098
    Quote Originally Posted by chill View Post
    The audio problem could be the mode that pigpio is using. I canít recall the details. Iíll check when I get back to my laptop and let you know.
    Try using '-t 1' instead of '-t 0' in the pigpiod line at the beginning of the script. From the pigpiod web page:
    Code:
    Default PCM. pigpio uses one or both of PCM and PWM. If PCM is used then PWM is available for audio. If PWM is used then PCM is available for audio.
    0=PWM 1=PCM

    I use '-t 0' (PWM) on my system, where the audio device is a USB DAC. But I guess the RPi wants to use PWM for the headphone output, so try using PCM for pigpiod ('-t 1').

  5. #15
    Junior Member
    Join Date
    Jan 2020
    Posts
    5
    Quote Originally Posted by chill View Post
    Code:
    #                                                   
    #   <CODE>=<JSON Formatted lms cli command>         
    #                                                   
    #       CODE - MUST be a 4 character code, to be reference on command line when
    #                                                                              
    #       For commands reference the LMS cli documentation, commands are to be JSO
    #                                                                               
    # Default commands                                                              
    PAUS=["pause"]                                                                  
    VOL-=["button","voldown"]
    VOL+=["button","volup"]  
    PREV=["button","rew"]    
    NEXT=["button","fwd"]    
    POWR=["power"]         
    MIX+=["mixer","volume","+5"]
    MIX-=["mixer","volume","-5"]
    VMAX=["mixer","volume","100"]
    MUTE=["mixer","volume","0"]  
    PLAY=["button","rew.single"] 
    STOP=["stop"]                
    SHUF=["button","shuffle.single"]
    RSRT=["restartserver"]  
    PRE1=["button","preset_1.single"]
    PRE2=["button","preset_2.single"]
    PRE3=["button","preset_3.single"]               
    PRE4=["button","preset_4.single"]               
    PRE5=["button","preset_5.single"]               
    PRE6=["button","preset_6.single"]               
    PRE7=["button","preset_7.single"]
    @chill: How did you connect your 7 preset buttons to the gpios? I have connected 2 rotary encoders, 1 infrared, so I have only 5 gpios left free. I thought about using an port extender MCP23017 but don't get it connected/routed to sbpd.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •