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

Alsa receiver not working if Soundcard doesn't support 44.1kHz #190

Open
DominikStarke opened this issue Sep 29, 2022 · 4 comments
Open

Comments

@DominikStarke
Copy link

DominikStarke commented Sep 29, 2022

My receiver is running on a raspberry pi 3 with a blokas pisound, which doesn't support rates lower than 48kHz.
This can be worked around by changing the sample rate on line 106 in alsa.c:

  if (setup_alsa(&ao_data.snd, SND_PCM_FORMAT_S16_LE, 44100, latency, alsa_device, ao_data.receiver_format.channels, &ao_data.channel_map) == -1) {
    return 1;
  }

to

  if (setup_alsa(&ao_data.snd, SND_PCM_FORMAT_S16_LE, 48000, latency, alsa_device, ao_data.receiver_format.channels, &ao_data.channel_map) == -1) {
    return 1;
  }
@DominikStarke
Copy link
Author

After further investigation, the first call to setup_alsa seems to be unnecessary?

@duncanthrax
Copy link
Owner

Might be unnecessary, yes. The way the code works historically is that the output is opened (with some default settings) regardless of a stream being received. The whole thing is stateless, so that is the natural way :) I would prefer to change the default sample rate over introducing a "waiting" state.

@DominikStarke
Copy link
Author

Nice profile picture.

It might be a good idea to override the default value with a rate argument (something like scream -r 48000) falling back to 44.1k if not specified and updating on stream change?

@duncanthrax
Copy link
Owner

Sounds good! Since I'm incredibly lazy, please send a patch :)

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