Home of the Squeezebox™ & Transporter® network music players.
Page 22 of 28 FirstFirst ... 122021222324 ... LastLast
Results 211 to 220 of 275
  1. #211
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    2,491
    Alright......I couldn't let this drop.....lol. Download this binary and give it a shot. It's statically linked using the pigpio library.

    https://dl.dropboxusercontent.com/s/...gp/sbpd-pigpio

    I didn't have an encoder setup to try that code out, but the buttons seem to work better.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  2. #212
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Location
    Nottingham, UK
    Posts
    1,373
    Hi Paul - thanks for your persistence with this. Iĺm looking forward to trying this build. Unfortunately that wonĺt be till I get home on Sunday evening.

  3. #213
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Location
    Nottingham, UK
    Posts
    1,373
    Hi Paul

    I had go with this, but only on my 4B 1GB (on which the wiringpi-based version works well). The new pigpio-based version also gives me nice responsive buttons. So far so good. The big test of course will be to try it on my 4B 4GB, which gives me erratic behaviour with the wiringpi version - I'll try that later this evening.

    One thing I noticed - if I only have one button defined by the command line, it works fine. But if I have more than one button definition on the command line, then pressing any of the defined buttons calls the command specified for the first button on the list, NOT the command specified for the pressed button.

  4. #214
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Location
    Nottingham, UK
    Posts
    1,373
    Tried it on my 4B 4GB - the buttons now seem just as reliable as they do on my 4B 1G. Great stuff.

  5. #215
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    2,491
    Good news.

    Quote Originally Posted by chill View Post
    Hi Paul
    But if I have more than one button definition on the command line, then pressing any of the defined buttons calls the command specified for the first button on the list, NOT the command specified for the pressed button.
    This is really what the problem is. The interrupt set in wiringpi calls a program, howerver there are no parameters passed in the callback, so we have to scan all of the programmed buttons to see what is changed. The pi4 gpio scan frequency is much higher than on previous pies, so there is a much higher amount of contact chatter detected on a pi4. With pigpio, the callback has not only the pin, but the current state and the time it was pressed, so we can handle interrupts much more efficiently. The interrupt also has debounce pre-built into it.

    I need to talk to ralphy, but we will likely move squeezelite to pigpio, so we can just have one library on pCP.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  6. #216
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Location
    Nottingham, UK
    Posts
    1,373
    Thanks for the explanation. Do you have any ideas why the wiringpi version only seems to struggle on the 4GB version of the RPi4, and seems fine on the 1GB version?

    I understand that the pigpio callback approach means that sbpd still needs a bit more of a rewrite to handle the callbacks correctly, so that the actions for different button presses will be called appropriately. I have rotary encoder somewhere, and will try to test that part of sbpd-pigpio's functionality this evening. Is it likely to have the same issue as the button presses - will a turn in either direction do the same thing?

    I didn't realise that Squeezelite also uses wiringpi. I had to check its command line parameters to find that it can use a GPIO pin to control the power to an amplifier. And I now see that it's one of the options exposed in the Squeezelite tab of pCP - I don't think I'd ever looked that far down the list of Squeezelite options!

  7. #217
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    2,491
    Quote Originally Posted by chill View Post
    Thanks for the explanation. Do you have any ideas why the wiringpi version only seems to struggle on the 4GB version of the RPi4, and seems fine on the 1GB version?

    I understand that the pigpio callback approach means that sbpd still needs a bit more of a rewrite to handle the callbacks correctly, so that the actions for different button presses will be called appropriately. I have rotary encoder somewhere, and will try to test that part of sbpd-pigpio's functionality this evening. Is it likely to have the same issue as the button presses - will a turn in either direction do the same thing?

    I didn't realise that Squeezelite also uses wiringpi. I had to check its command line parameters to find that it can use a GPIO pin to control the power to an amplifier. And I now see that it's one of the options exposed in the Squeezelite tab of pCP - I don't think I'd ever looked that far down the list of Squeezelite options!
    I added that option to squeezelite many years ago....

    Please test an encoder, pigpio encoder handling is the same as was in wiringpi. But pippin already had rate limiting in sbpd for encoders.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  8. #218
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Location
    Nottingham, UK
    Posts
    1,373
    I can't get any response from the encoder.

    I'm using this command:
    Code:
    sudo /home/tc/sbpd-pigpio -v -M dc:a6:32:03:82:22 -f /home/tc/sbpd_commands.cfg e,21,20,VOLM,2
    There's no output at all* with the -v option. With -z I get plenty of output, but nothing corresponding to encoder events.


    The same command string controls the player volume as expected with the original sbpd:

    Code:
    sbpd -v -M dc:a6:32:03:82:22 -f /home/tc/sbpd_commands.cfg e,21,20,VOLM,2
    This is with my 4B 4GB.

    *EDIT: When I say 'no output', I mean nothing beyond the original setup output:
    Code:
    sudo /home/tc/sbpd-pigpio -v -M dc:a6:32:03:82:22 -f /home/tc/sbpd_commands.cfg e,21,20,VOLM,2
    1566236821.5573 6 sbpd.c,284: Options parsing: Set verbose mode
    1566236821.5574 6 sbpd.c,309: Options parsing: Manually set MAC: dc:a6:32:03:82:22
    1566236821.5574 6 sbpd.c,343: Options parsing: Setting command config file to /home/tc/sbpd_commands.cfg
    1566236821.5575 6 sbpd.c,505: name=PAUS, value=["pause"]
    1566236821.5575 6 control.c,81: Adding Command PAUS: Fragment ["pause"]
    1566236821.5575 6 sbpd.c,505: name=VOL-, value=["button","voldown"]
    1566236821.5575 6 control.c,81: Adding Command VOL-: Fragment ["button","voldown"]
    1566236821.5576 6 sbpd.c,505: name=VOL+, value=["button","volup"]
    1566236821.5576 6 control.c,81: Adding Command VOL+: Fragment ["button","volup"]
    1566236821.5576 6 sbpd.c,505: name=PREV, value=["button","rew"]
    1566236821.5576 6 control.c,81: Adding Command PREV: Fragment ["button","rew"]
    1566236821.5576 6 sbpd.c,505: name=NEXT, value=["button","fwd"]
    1566236821.5576 6 control.c,81: Adding Command NEXT: Fragment ["button","fwd"]
    1566236821.5576 6 sbpd.c,505: name=POWR, value=["power"]
    1566236821.5576 6 control.c,81: Adding Command POWR: Fragment ["power"]
    1566236821.5576 6 sbpd.c,505: name=MIX+, value=["mixer","volume","+5"]
    1566236821.5577 6 control.c,81: Adding Command MIX+: Fragment ["mixer","volume","+5"]
    1566236821.5577 6 sbpd.c,505: name=MIX-, value=["mixer","volume","-5"]
    1566236821.5577 6 control.c,81: Adding Command MIX-: Fragment ["mixer","volume","-5"]
    1566236821.5577 6 sbpd.c,505: name=VMAX, value=["mixer","volume","100"]
    1566236821.5577 6 control.c,81: Adding Command VMAX: Fragment ["mixer","volume","100"]
    1566236821.5577 6 sbpd.c,505: name=MUTE, value=["mixer","volume","0"]
    1566236821.5577 6 control.c,81: Adding Command MUTE: Fragment ["mixer","volume","0"]
    1566236821.5578 6 sbpd.c,505: name=PLAY, value=["button","rew.single"]
    1566236821.5578 6 control.c,81: Adding Command PLAY: Fragment ["button","rew.single"]
    1566236821.5578 6 sbpd.c,505: name=STOP, value=["stop"]
    1566236821.5578 6 control.c,81: Adding Command STOP: Fragment ["stop"]
    1566236821.5579 6 sbpd.c,505: name=SHUF, value=["button","shuffle.single"]
    1566236821.5579 6 control.c,81: Adding Command SHUF: Fragment ["button","shuffle.single"]
    1566236821.5579 6 sbpd.c,505: name=RSRT, value=["restartserver"]
    1566236821.5580 6 control.c,81: Adding Command RSRT: Fragment ["restartserver"]
    1566236821.5580 6 sbpd.c,505: name=PRE1, value=["button","preset_1.single"]
    1566236821.5580 6 control.c,81: Adding Command PRE1: Fragment ["button","preset_1.single"]
    1566236821.5580 6 sbpd.c,505: name=PRS1, value=["button","preset_1.hold"]
    1566236821.5581 6 control.c,81: Adding Command PRS1: Fragment ["button","preset_1.hold"]
    1566236821.5581 6 sbpd.c,505: name=PRE2, value=["button","preset_2.single"]
    1566236821.5581 6 control.c,81: Adding Command PRE2: Fragment ["button","preset_2.single"]
    1566236821.5582 6 sbpd.c,505: name=PRE3, value=["button","preset_3.single"]
    1566236821.5582 6 control.c,81: Adding Command PRE3: Fragment ["button","preset_3.single"]
    1566236821.5582 6 sbpd.c,505: name=PRE4, value=["button","preset_4.single"]
    1566236821.5582 6 control.c,81: Adding Command PRE4: Fragment ["button","preset_4.single"]
    1566236821.5583 6 sbpd.c,505: name=PRE5, value=["button","preset_5.single"]
    1566236821.5583 6 control.c,81: Adding Command PRE5: Fragment ["button","preset_5.single"]
    1566236821.5583 6 sbpd.c,505: name=PRE6, value=["button","preset_6.single"]
    1566236821.5584 6 control.c,81: Adding Command PRE6: Fragment ["button","preset_6.single"]
    1566236821.5584 6 sbpd.c,505: name=PRE7, value=["button","preset_7.single"]
    1566236821.5584 6 control.c,81: Adding Command PRE7: Fragment ["button","preset_7.single"]
    1566236821.5585 6 GPIO.c,261: Initializing GPIO
    1566236821.7684 6 servercomm.c,176: Initializing CURL
    1566236821.7751 6 sbpd.c,237: Starting main loop polling
    1566236821.7754 6 discovery.c,234: Found server 0401A8C0. A new address
    1566236821.8757 6 discovery.c,345: discovery packet: port: 9000, name: pCPLoungePi4, uuid: f8c593d1-583d-4750-b7c5-7a6944c8bf18
    1566236821.8758 6 discovery.c,130: Squeezebox control port found: 9000
    1566236821.8758 6 discovery.c,149: Server address found: 192.168.1.4
    Last edited by chill; 2019-08-19 at 10:48.

  9. #219
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    2,491
    Guess I need to setup an encoder.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  10. #220
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    2,491
    Volume in the encoder routine is "VOLU" or "TRAC"

    If you dont see a message like

    1566270646.6827 6 control.c,294: Rotary encoder defined: Pin 20, 21, Edge: both, Fragment:
    ["mixer","volume","%s%d"]

    Then you did something wrong. I guess I could print out a warning, letting you know there is an invalid command....

    Now back to testing, I got encoder values, I'm just not sure its counting properly, let me know.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

Posting Permissions

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