Closed tomaculum closed 3 years ago
Found a super easy solution
Add to the infinite while loop at the end of the code a sleep call :
while(1) {
sleep(10000);
};
It's basically looping to stay running while listening to clickwheel actions....no need to kill the cpu with useless loop.
This is tried and tested for weeks now on my ipod.
Ah, good find @nboumalham - I totally meant to try that and see if it would impact the GPIO monitoring. Completely forgot. Feel free to open a PR with that fix!
Thank you very much!
Ah, good find @nboumalham - I totally meant to try that and see if it would impact the GPIO monitoring. Completely forgot. Feel free to open a PR with that fix!
Unfortunately I am not the most disciplined coder :/
I have added/changed SO MANY things and merged them into one main branch :
clickwheel:
A few other things.
I will see how I can created separate branches for each "feature" and propose a pull request if you approve them.
Ah, good find @nboumalham - I totally meant to try that and see if it would impact the GPIO monitoring. Completely forgot. Feel free to open a PR with that fix!
Unfortunately I am not the most disciplined coder :/
I have added/changed SO MANY things and merged them into one main branch :
* A splash screen while loading stuff from Spotify * The ability to control the volume in the now playing frame (including the GUI) * Settings menu : view and connect to paired BT devices * Settings menu: switch audio output if you have multiple audio outputs connected * Settings menu: an about section with the version, capacity, used capacity, uptime etc (similar to iPOD ui, page scrolls with no items selected) * Artists are now stored in alphabetical order * Changed the GUI a bit (colors, forms, etc) and tried to match old monochrome LCD screens more (I will add a "theme switcher" so that people can maybe pick different themes. maybe even download them from some repo)
clickwheel:
* the ability to lock/unlock controls by pressing the menu button for 3 seconds (missing GUI showing lock) * shutting down the ipod by pressing the play button for 5 seconds
A few other things.
I will see how I can created separate branches for each "feature" and propose a pull request if you approve them.
hi, im trying to get your fork to run but it's hanging on the apple splash screen. I installed the extra dependincies in requirements.txt..... what else would I need to install for it to run? How can i check what it's hanging on?
Sorry I'm on my phone right now. The best way to do it is probably by disabling the thread that loads up the spotify library while the apple logo is shown. just comment it out and return true (search for the word thread there is only one place it's used).
When you do this you will see the actual errors that the python is throwing.
If that doesn't help I'll look into it when I get home
Sorry I'm on my phone right now. The best way to do it is probably by disabling the thread that loads up the spotify library while the apple logo is shown. just comment it out and return true (search for the word thread there is only one place it's used).
When you do this you will see the actual errors that the python is throwing.
If that doesn't help I'll look into it when I get home
I got past this, I looked at your comits and realized you replaced raspotify with spotifyd, so I set that up and now it loads to the menu and I can see my songs.
Problem now is selecting a song will not play it. if i start a song on my desktop app it shows that it's currently playing on the spotifypod though.
Sorry I'm on my phone right now. The best way to do it is probably by disabling the thread that loads up the spotify library while the apple logo is shown. just comment it out and return true (search for the word thread there is only one place it's used).
When you do this you will see the actual errors that the python is throwing.
If that doesn't help I'll look into it when I get home
well i spoke too soon, i got it running on my test pi4 but then i went to do it on my actual ipod pi and its hanging again on the apple logo.
I must be doing something wrong. can you share your config for spotifyd? also i was not sure where to put the return true, i did find the section for thread
here is my pipod log root - ERROR - no ints root - ERROR - no ints root - ERROR - alsaaudio not compatible on this device root - ERROR - alsaaudio not compatible on this device root - ERROR - no ints root - ERROR - no ints
edit, ok i just installed alsaaduio and that error went away but still no go
Sorry I'm on my phone right now. The best way to do it is probably by disabling the thread that loads up the spotify library while the apple logo is shown. just comment it out and return true (search for the word thread there is only one place it's used).
When you do this you will see the actual errors that the python is throwing.
If that doesn't help I'll look into it when I get home
I got everything working now, your version is much better! loads faster too.
2 things:
@nboumalham
Now, your version is much better! loads faster too.
2 things:
When i am on the main screen, and i press menu, the program closes and then i have no way to open it it again, so i have to reboot. is that normal?
Bluetooth is working to my galaxy buds but i have no volume control on the now playing screen. is it supposed to work? If i open spotify on my desktop and change the volume on the remote player from there it actually works.
@nboumalham
TheBasedDoge:
Were you able to get the volume control to work ???
I never got it to work..... let me know if you make any progress on that
Nboumalham & Victor1234678,
Does controlling volume really work with your fork version, if yes would you please explain how to configure it to work?
Thanks!
TheBasedoge:
I never got it to work..... let me know if you make any progress on that
I did get everything working except volume with Raspotify didn't use Spotifyd.
I used the below version with Podcast:
https://github.com/viktor1234678/vPod
How did SpotifyD workout for you?
Everything works for me besides volume, but I may try the version you posted.
Are you using SpotifyD? and do you find it better then Raspotify? Thank You!
Yeah I am using spotifyD. It boots faster and seems to work smoother. Other than that same functionality.
Nboumalham,
Would you tell me what part of your code can be graphed into the DuPont default could to take advantage of the * shutting down the ipod by pressing the play button for 5 seconds?
Thanking you in advance.
Hi, I also tried this and run into the same issue as TheBasedDoge. I configured spotifyd. Menue is up an running, but if I click onto a song it does not play. I only see the volume control. How did you come around this issue? Many thanks for your help! Marcus
Same here, couldn't get Bluetooth working hence could not play tracks. I since reverted to Mr. DuPont's default version using Raspotify instead of SpotifyD.
Same here, couldn't get Bluetooth working hence could not play tracks. I since reverted to Mr. DuPont's default version using Raspotify instead of SpotifyD.
Dear Doris, many thanks for your Feedback. Did you tried the pulseaudio backend instead of alsa?
Cheers, Marcus
No I did not.
Hi everyone,
I noticed a very high CPU usage if I run just
click
even without the UI. Did anyone else notice this and did anyone find a better solution?So far I have tried to rewrite the
click.c
code into a python class which could be used by the frontend directly, which was much worse performance wise.Afterwards I have tried to adjust the sampling rate of the gpios but this resulted in only detecting up and down commands:
My latest effort was to make use of the pigpio daemon
sudo pigpiod
(add this command to/etc/xdg/openbox/autostart
). And the following rewritten code but it does not seem to be any better.click.c code
``` c // To compile on the pi (after installing pigpio): // gcc -Wall -pthread -o click click.c -lpigpiod_if2 -lrt #includeIs there a better or more efficient way to read the serial data from our clickwheel?
On the one hand I am a bit concerned by the heat generated by the CPU even while not even running anything else but
click
on the other hand I kind of want to avoid adding another component as such as an Arduino if it is not necessary.