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

Audio sounds in slow motion #183

Open
Regradert opened this issue Oct 11, 2022 · 5 comments
Open

Audio sounds in slow motion #183

Regradert opened this issue Oct 11, 2022 · 5 comments

Comments

@Regradert
Copy link

Hello. I have recently purchased another audio card for my Raspberry Pi, a Sound Blaster Play! 3 but the audio sounds like it's playing in slow motion. I have tried changing the samplerate and there is no difference, I have also adjusted different bitrates and nothing.

I have two cards, with the previous one it sounds perfectly, but with this one it sounds like this and it's very strange. I have made a test audio recording outside of Picam:

arecord -f S16_LE -c 2 -d 10 -r 44100 --device="hw:1,0" /home/pi/test.wav

And it sounds perfect, no slow motion sound, but with Picam I have this problem. What could be happening?

@iizukanao
Copy link
Owner

Does your sound card's microphone have any special specifications compared to a regular USB microphone?
One alternative is to create a virtual ALSA device instead of use hw:1,0 directly.

@Regradert
Copy link
Author

Hi mate @iizukanao The microphone is a normal minijack, with the other card I have it works perfectly. The other card is this one, it's a very basic one but it works fine, I also have a micro usb and it works fine too. It is rare that Creative has this problem:

https://www.mytrendyphone.es/images2/USB-Sound-Card-14052015-01-p.jpg

I am going to try to create a virtual device as you say and I will tell you about it. Thank you very much.

@brainrecall
Copy link

I had the same issue, and a virtual device fixed it.

For those who are looking how to do this, create a file at ~/.asoundrc

Then add the following:

pcm.blaster {
  type plug
  slave {
    pcm "hw:2,0"
    channels 2
  }
  route_policy sum
}

Adjust the hw:2,0 line to match your sound card number.

Then reboot, and use --alsadev blaster for picam.

@tmqian
Copy link

tmqian commented Mar 15, 2024

Hello! Thanks so much for developing and supporting this awesome app!
I am also having the same issue with slow audio.

I tested the mic with
arecord -f S16_LE -c 2 -d 10 -r 44100 --device="hw:1,0" /home/pi/test.wav
as above, and the file sounds normal.

So it is something about picam.
I am using HLS.

The above virtual device fix doesn't work for me.
I find that my .asoundrc gets deleted during/after reboot. The next time I try to run with --alasdev blaster there is no audio at all.

This is my picam command
sudo /home/pi/picam/picam -o /run/shm/hls --samplerate 44100 --channels 2 –audiobitrate 96000 --time --vfr --autoex --alsadev blaster > ~/picam.log 2>&1

@T-Vandehey
Copy link

Hi, I also have been having the same issues the last few days of playing around with this library. Super down-pitched or slowed down audio, while the video is great.

I don't think that virtual sound device works in the same way anymore with the new pi OS bookworm. I see it get deleted on boot also.
If anyone knows an alternative workaround for the issue, please let us know.

I am using this USB soundcard and 2 channel mics:
Andrea Communications C1-1021450-100 USB-SA

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

5 participants