[SOLVED] random issue with playback starting and stopping . - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7) +--- Thread: [SOLVED] random issue with playback starting and stopping . (/showthread.php?tid=2384) Pages:
1
2
|
random issue with playback starting and stopping . - GreyLinux - 04-17-2020 Hi all , I have a random issue with my setup where after a while of listening to radio, randomly the playback pauses, even stranger after listening to nothing for a while it randomly will start playing again . my setup is Raspberry pi 4 , Hifiberry amp2, gpio handler enabled for momentary button control ( which I believe is related ot the problem) and mono output provided by sox resampling option , also I have volume control set to software . I believe it is related either to the gpio handler configuration or the buttons themselves . I have configured mpc toggle on gpio6 , vol up on gpio 5 and vol down on gpio26 . The other tails of the buttons are to ground, Deounce is 750ms , not sure if this I helpful but just in case its my handy work causing the issue! When pressed all buttons work as expected except that when no audio is playing if I press vol up or vol down a few times , audio begins playing (not sure if this is expected behaviour ?) no physical connection is shorting between the pins as I soldered female gpio connectors to the ends of each button tail and they fit nice and snug . nothing obvious appears in any of the logs but I'm not entirely sure what I'm looking for . any ideas or advice would be great . RE: random issue with playback starting and stopping . - Tim Curtis - 04-17-2020 You could try running the button handler from the cmd line after adding some debug print. 1. Turn off the handler in System config. 2. sudo nano /var/www/command/gpio-buttons.py Uncomment the existing #print statements and optionally add your own 3. Run it from cmd line Code: sudo /var/www/command/gpio-buttons.py RE: random issue with playback starting and stopping . - GreyLinux - 04-17-2020 (04-17-2020, 05:33 PM)Tim Curtis Wrote: You could try running the button handler from the cmd line after adding some debug print. what sort of debug print statement would you suggest could help ? when I run it as is and press the volume buttons a few times I get Code: 2020-04-17 19:09:08 bounce_time=750 I havent pressed play at al this is just with vol buttons RE: random issue with playback starting and stopping . - Tim Curtis - 04-17-2020 Prolly add a print statement in the callback function for the particular buttons you have defined. This would show when the event occurs. It should only occur when button is pressed. Something like below. Code: def sw_1_event(channel): RE: random issue with playback starting and stopping . - GreyLinux - 04-17-2020 Code: Apr 17 18:58:53 moode-lounge kernel: [16174.011128] pcm512x 1-004d: No SCLK, using BCLK: -2 these are the only repeated logs in syslog but I believe they are unrelated . RE: random issue with playback starting and stopping . - GreyLinux - 04-17-2020 (04-17-2020, 06:26 PM)Tim Curtis Wrote: Prolly add a print statement in the callback function for the particular buttons you have defined. This would show when the event occurs. It should only occur when button is pressed. after adding this Code: sw_2_event the play button was not pressed once but as you can see it randomly started playback . RE: random issue with playback starting and stopping . - Tim Curtis - 04-17-2020 Something, most likely hardware, is changing the PUD state of the gpio which causes the event to be triggered. https://sourceforge.net/p/raspberry-gpio-python/wiki/Inputs/ You could try disconnecting one of the buttons to confirm that no event occurs. RE: random issue with playback starting and stopping . - GreyLinux - 04-17-2020 (04-17-2020, 06:44 PM)Tim Curtis Wrote: Something, most likely hardware, is changing the PUD state of the gpio which causes the event to be triggered. interesting !! , I did begin to think that it might be hardware related just before you posted . Its possible that my switch is faulty so I'll try disconnecting the play button tomorrow and let you know my findings RE: random issue with playback starting and stopping . - GreyLinux - 04-18-2020 (04-17-2020, 06:44 PM)Tim Curtis Wrote: Something, most likely hardware, is changing the PUD state of the gpio which causes the event to be triggered. I have carried out some testing this morning and discovered that it is entirely hardware related . I removed the play button from the gpio and tried the same test as above , I found that pressing one of the volume button occasionally caused the other to detect an event . this ruled out the buttons. I did notice that when I touched the wires with no button press this caused an event to be detected suggesting either a poor connection betwen the wires and the gpio's is causing events or some noise is being caused because of proximaty to the speaker magnet or the general length of the wire , or possibly all 3 could be causing it . I have read that putting a o.1UF capacitor between terminals on the button can filter out the noise . Thanks Tim for you help and advice in leading me to this conclusion . I'll add to this thread when I find a solution so as to help anyone else with a similar problem RE: random issue with playback starting and stopping . - GreyLinux - 04-18-2020 To mark this thread as solved , I discovered that it was the dupont connectors on the end of the button tails did not having a good connection with the pins on the HifiBerry amp2 as they are smaller than standard 2.54mm pins this caused the playback to randomly stop and play and cause other buttons to glitch and trigger other button events . I'm aware that soldering to the amp2 pins voids the warranty but I decided to solder the connections and create a permanent connection . |