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

Wave that works through aplay. simpleaudio reports "Unable to get period size for PLAYBACK: Invalid argument" #50

Open
mankyd opened this issue May 2, 2021 · 0 comments

Comments

@mankyd
Copy link

mankyd commented May 2, 2021

Running on a RaspberryPi Zero using i2s sound.

  1. I downloaded a random wave I found (CantinaBand60.wav: https://www2.cs.uic.edu/~i101/SoundFiles/).
  2. Tested it with aplay CantinaBand60.wav. It works fine.
  3. Tried it with simpleaudio and I get an error:
ALSA lib pcm.c:8591:(snd_pcm_set_params) Unable to get period size for PLAYBACK: Invalid argument
Exception in thread sound:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/home/dave/clock/clock/hardware/sound.py", line 28, in _run
    player = self._wav.play()
  File "/home/dave/clock/lib/python3.7/site-packages/simpleaudio/shiny.py", line 20, in play
    self.bytes_per_sample, self.sample_rate)
  File "/home/dave/clock/lib/python3.7/site-packages/simpleaudio/shiny.py", line 61, in play_buffer
    sample_rate)
_simpleaudio.SimpleaudioError: Error setting parameters. -- CODE: -22 -- MSG: Invalid argument

I've seen this on other wave's as well, however, some wave's seem to work fine. I don't know what makes the difference.

Happy to provide whatever other details you may require.

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

1 participant