-
-
Notifications
You must be signed in to change notification settings - Fork 581
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
Support for ALSA PCM softvol plugin #290
Comments
Hi Jörg-Krause. Thanks for the post. TBH, I have not considered the use of any plug-ins in Shairport Sync. The reason is that i don't know enough about them. In particular, I envisage them as standing between the output of Shair[port Sync and the DAC. Shairport Sync ask the output device for its latency every 8 milliseconds or so, and i don't know if a plug-in will report latency correctly or at all. I've been too concerned with improving the reliability and ease-of-use of Shairport Sync in other areas to look at the plug-ins world. If you don't specify a mixer name, then Shairport Sync uses the software volume control in Shairport Sync itself. In any case, you could disable the volume control in the Shairport Sync setting and have its output directed to the plug-in at 100% level. After that, it really depends on the plug-in. If it reports latency correctly, then we are in business; otherwise it's going to lose sync. |
Many thanks for the feedback! What do you mean by:
|
@mikebrady I managed to get shairport-sync using the softvol control. Unfortunately, I have a problem with
|
Very interesting. Let me check that out. |
I opened a pull request for testing: #293. |
Yep, thanks for that! |
Many thanks for merging and making a release! Did you had the chance to look at the scaled attenuation problem with |
You're welcome! I haven't had a look at the |
I think I have found the issue. The transfer functions start and end points does not take the max dB value as an offset into account. The y-axes ranges always from 0 to (max - min) dB, where it should range from max to max - (max - min) dB. I make some tests now and propose a PR later. |
That sounds plausible alright, Jörg-Krause. |
Yes, it does. However, I was wrong as the |
This fixes calculation of the scaled attenuation if `max_dB` is different from zero. Closes: mikebrady#290
Note, that the ALSA softvol plugin in version 1.1.1 and below is affected by a bug which may result in wrong dB values. This bug has been fixed: http://git.alsa-project.org/?p=alsa-lib.git;a=commit;h=85bf9915989e0a338632739684c75192c1753239. |
@joerg-krause can you provide any advice on how you got softvol working? I'm still stuck with the dB vol scale error, despite setting a min_dB and max_dB |
Hi @ntwallace, basically I am using the configuration settings as said in the first post of this thread. What is exactly the error message? What are your settings for asound.conf and shairport-sync.conf? What ALSA version does you're system provide? |
Thanks for the quick response @joerg-krause. I'm getting the similar error about my mixer not having a dB volume scale. FYI my hardware setup is a Rpi Zero with a Phat DAC attached (which doesn't do hardware volume), so I am using a combo of dmix and softvol to control volume via software. The ALSA version is 1.1.3 -- I guess at some point they made some changes to the architecture so that softvol is implemented by the .asoundrc file in root instead of asound.conf in /etc/. shairport-sync -v error:
shairport-sync.conf code:
asound.conf code:
.asoundrc code:
|
Just wondering if the very latest fix on the |
@mikebrady Can you share the 2 missing lines of code for the v3.2d8 of audio_alsa.c and I can test? Or should I compile the dev branch and update to test? |
@ntwallace You're configuration is a bit messy. First, shairport-sync is not configured to use the softvol plugin, but the hardware device. Second, your softvol plugin uses a dmix plugin as pcm slave, but no dmix is configured in your ALSA config. For the beginning, please try this: Replace the alsa stanza in shairport-sync.conf:
Replace the .asoundrc code:
If it works, you can add the |
Thanks @joerg-krause, good point. I actually tried that at first, but was getting an error. When I update both to those, shairport-sync -v gives me:
I was able to get shairport-sync to load by updating asound.conf to include a ctl.softvol:
However, shairport-sync -v still gives me the same dB error:
Adding code for pcm.softvol directly into to asound.conf doesn't change the above error:
|
Nick, I'd say it's probably best to move to the |
@ntwallace Actually, it isn't an error message, but a note that softvol plugin is been used by shairport-sync. My guess is that your ALSA config is still wrong. This stanza at leadt is still wrong:
Replace it by:
Furthermore, maybe some config options in your system wide alsa config file Does |
I am trying to setup shairport-sync with an ALSA PCM softvol plugin.
asound.conf:
shairport-sync.conf:
Running shairport-sync -vvv:
Looking into audio_alsa shows that snd_mixer_selem_get_playback_dB_range() returns an error code. This is all fine when using a hardware mixer.
However, with an ALSA software mixer, I can get the dB range using snd_ctl_get_dB_range(). e.g.:
What do you think about an option like
mixer_type
as the MPD audio output configuration has?Is there any drawback using the softvol plugin for volume setting?
The text was updated successfully, but these errors were encountered: