Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playback super slow #1

Closed
mchaos opened this issue Aug 28, 2022 · 19 comments
Closed

Playback super slow #1

mchaos opened this issue Aug 28, 2022 · 19 comments

Comments

@mchaos
Copy link

mchaos commented Aug 28, 2022

Set this up. RPI2. Fresh install of raspnian. Cloned and built deb successfully. Rebooted and heard the default music, which I realize now was also playing slow, but I didn't realize it until I loaded a playlist of music I knew.

Its playing at 3/4 speed or some where there abouts.

@thenickdude
Copy link
Owner

thenickdude commented Aug 28, 2022

I never tested this on the Pi 2, can you check the system load with "top" while it's playing?

Also check if aplay is affected too, run:

sudo service stop lofipi-mpv
aplay /usr/share/sounds/alsa/Front_Center.wav

And compare this playback speed to playing it on another machine:

https://github.com/alsa-project/alsa-utils/blob/master/speaker-test/samples/Front_Center.wav?raw=true

@mchaos
Copy link
Author

mchaos commented Aug 29, 2022

I copied the very top of top.. heh.... top top....
330 root 20 0 11496 1536 1368 S 22.6 0.2 0:58.46 pigpiod
738 64843 20 0 328300 73964 38244 S 7.9 7.8 0:21.13 mpv
342 64843 20 0 159644 34960 27520 S 2.0 3.7 0:07.93 node
1054 pi 20 0 11348 3136 2572 R 1.6 0.3 0:01.01 top
75 root 1 -19 0 0 0 S 0.7 0.0 0:00.74 vchiq-slot/0
12 root 20 0 0 0 0 I 0.3 0.0 0:00.33 rcu_sched
1 root 20 0 33892 8676 6852 S 0.0 0.9 0:04.78 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.02 kthreadd

pigpiod is using 22% followed by mpv at around 8%

@mchaos
Copy link
Author

mchaos commented Aug 29, 2022

You mean sudo service lofipi-mpv stop...

And indeed is effected and sounds slowed... My desktop running ubuntu 22.04 has a lovely voice, while the Pi sounds demonic.
I will grab my USB sound card and plop this SD in a pi zero 2 and see if it does the same thing and report back...

@thenickdude
Copy link
Owner

thenickdude commented Aug 29, 2022

Okay, it doesn't seem to be a performance issue then. I suspect there is some problem with the PCM audio bus frequency causing the data to be transmitted slowly.

Try disabling the pigpiod service, rebooting, and seeing if that fixes it. If so it's likely that pigpiod setting the PWM frequency for the fan is interfering with things on the Pi 2.

@mchaos
Copy link
Author

mchaos commented Aug 29, 2022

That was the first thing that crossed my mind. If you wrote this with the RPI4 in mind, I know something changed where some kind of frequency something or another doesn't mess with the 4. I will give it a shot...

@thenickdude
Copy link
Owner

Nah, it's written for the 3B

@mchaos
Copy link
Author

mchaos commented Aug 29, 2022

So I tried stopping the pigpiod serivce, removing pigpiod, and for both when I do nothing plays. seems it has something to do directly with the audio output?? I tried killing it and restarting lofipi-mpv and it doesn't play. I tried telling the fan speed to to be 1, 100, and a few other random values. also in config. It does not change the playback speed. I am stumped...

@thenickdude
Copy link
Owner

Does aplay output still work with pigpiod disabled though?

@mchaos
Copy link
Author

mchaos commented Aug 29, 2022

Okay.. I stopped lofipi, then stopped pigpiod, then started lofipi. I have a small netgear hub the pi is connected to, and from messing around I can tell when it is streaming based on the activity LEDs, and it's definitely receiving a stream. No sound. when I run aplay... no sound. Also.. I tried several variations and OOO's and no sound if pigpiod is not running.

@mchaos
Copy link
Author

mchaos commented Aug 29, 2022

Now I have just disabled pigpiod, "sudo systemctl disable pigpiod.service.. Rebooted...

Is playing without pigpiod.... Still Demonic music... So it's not pigpiod..... :(

@thenickdude
Copy link
Owner

That's really odd because without pigpiod this should just be a regular Pi playing music with a regular music player, and I'd expect to find lots of similar complaints on the net for the Pi 2, but I can't find any with a brief search.

Maybe share your boot config file in case there's something weird in there?

@mchaos
Copy link
Author

mchaos commented Aug 29, 2022

Mute jumper?? Not sure what you mean...

@thenickdude
Copy link
Owner

Oh are you not using the x400 amplifier board?

@mchaos
Copy link
Author

mchaos commented Aug 29, 2022

I haven't edited the config file.

No amp board.. Just pi into a speaker with it's own amp.

@mchaos
Copy link
Author

mchaos commented Aug 29, 2022

I am in the early phase, just getting it working.

@thenickdude
Copy link
Owner

thenickdude commented Aug 29, 2022

My pigpiod config certainly won't work with that, because mine configures pigpiod to use the PWM module for IO, which is needed for headphone audio.

PWM audio on the Pi has its own set of config tuneables which I never investigated.

Using a board like the x400 uses PCM audio, freeing up the PWM module.

@mchaos
Copy link
Author

mchaos commented Aug 29, 2022

OH... So I have to use the amp board then... Well that would explain it. I am looking for a simple solution to stream music with a pi. I am not looking to use the x400 amp...

Well, back to the drawing board. Sorry for the wild goose chase, but thanks for the help...

@mchaos
Copy link
Author

mchaos commented Aug 29, 2022

Closing as there is no issue with the intended use of scripts...

@mchaos mchaos closed this as completed Aug 29, 2022
@thenickdude
Copy link
Owner

thenickdude commented Aug 29, 2022

To stream music from a Pi you probably want something like Volumio:

https://github.com/volumio/volumio3-backend

https://volumio.com/en/get-started/

Or for something really simple you can just run a script which launches mpv on boot and points it at a YouTube playlist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants