Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Instruction Guide Loudness compensated volume control with CamillaDSP
#11
(10-12-2022, 06:54 AM)roderickvd Wrote:
(10-11-2022, 11:44 PM)Tim Curtis Wrote: Yes alsa-cdsp does not do resampling but IIRC it update the camilla config with the source sample rate before piping the output to Camilla because Camilla itself does not do sample rate switching on-the-fly. Correct?

CamillaDSP does rate detection itself (and so does switch on the fly). I believe that alsa-cdsp can help by "hinting" the incoming sample rate but it's not necessary.

Do you think it is possible to slave the Alsa dummy mixer to _audioout? My asoundrc-fu is not up to par.

Still a bit confusing since the alsa cdsp doc states 

Code:
To aid in handling hardware parameter changes such as sample rate, format, or the number of input channels the plugin can automatically replace fields in the YAML files with the appropriate parameters and restart CamillaDSP.

IIRC its required to enable automatic rate, format and channel switching possible with Camilla, otherwise Camilla has to be manually stopped/started when these parameters change for example when current song is 16/44.1 and next song in the Queue is 24/192.

I'm not sure about slaving the mixer device to  _audioout but if I understand your config correctly it involves changing the mixer device param in MPD, Shairport-sync, Spotify  etc configs. That could possibly be done with a script that has some SED's to apply or revert the changes. 

Integrating this into moOde as an option though would involve quite a few moving parts and modifications. For example currently all the renderers default to using mixer softvol. That would need to be parameterized.

Food for thought.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#12
(10-12-2022, 03:17 PM)Tim Curtis Wrote:
(10-12-2022, 06:54 AM)roderickvd Wrote:
(10-11-2022, 11:44 PM)Tim Curtis Wrote: Yes alsa-cdsp does not do resampling but IIRC it update the camilla config with the source sample rate before piping the output to Camilla because Camilla itself does not do sample rate switching on-the-fly. Correct?

CamillaDSP does rate detection itself (and so does switch on the fly). I believe that alsa-cdsp can help by "hinting" the incoming sample rate but it's not necessary.

Do you think it is possible to slave the Alsa dummy mixer to _audioout? My asoundrc-fu is not up to par.

Still a bit confusing since the alsa cdsp doc states 

Code:
To aid in handling hardware parameter changes such as sample rate, format, or the number of input channels the plugin can automatically replace fields in the YAML files with the appropriate parameters and restart CamillaDSP.

IIRC its required to enable automatic rate, format and channel switching possible with Camilla, otherwise Camilla has to be manually stopped/started when these parameters change for example when current song is 16/44.1 and next song in the Queue is 24/192.

Note that it says aid. It is not required. In CamillaDSP's GUI you can see it locking onto a new sample rate when something new comes in.

Quote:I'm not sure about slaving the mixer device to  _audioout but if I understand your config correctly it involves changing the mixer device param in MPD, Shairport-sync, Spotify  etc configs. That could possibly be done with a script that has some SED's to apply or revert the changes. 

Changing the mixer parameters would be the "hard" route.
Slaving it to _audioout would be easier, but I don't know if it can be done.

Quote:Integrating this into moOde as an option though would involve quite a few moving parts and modifications. For example currently all the renderers default to using mixer softvol. That would need to be parameterized.

Food for thought.

Indeed. If this would be considered for the roadmap, I can help of course.
Reply
#13
Nice job @roderickvd!

@Tim Curtis some time ago, when I was helping @roderickvd, I submitted the following issue to CamillaDSP https://github.com/HEnquist/camilladsp/issues/231.
When this is implemented it will simplify the integration of the loudness function. No need to do all hassle with the alsa conf and also dummy mixer or use the camilladsp volume it self.

The implementation is currently planned for CamillaDSP 1.2.
Reply
#14
Awesome. Let's wait for that then and look back at this as a fun exercise :-)
Reply
#15
Super nice :-)

Will alsa cdsp plugin still be needed for upcoming 1.2 ?
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#16
@Tim Curtis: From the beginning Scripples alsa-cdsp is essential for a good integration of CamillaDSP in Moode.
It makes it possible when the audio format of a source changes that CamillaDSP is restarted with the correct audio format to use.

This is completely separate from other functions like loudness or other CamillaDSP features.
Reply
#17
(10-13-2022, 05:37 PM)bitlab Wrote: @Tim Curtis: From the beginning Scripples alsa-cdsp is essential for a good integration of CamillaDSP in Moode.
It makes it possible when the audio format of a source changes that CamillaDSP is restarted with the correct audio format to use.

This is completely separate from other functions like loudness or other CamillaDSP features.

Yes, now I remember. Also your nice alsa-cdsp fix for r820 release :-)
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#18
Hey, sorry for commenting on an old thread but I have a few questions about this topic.

- Has there been any further work on this? I see that the Camilla ticket (https://github.com/HEnquist/camilladsp/issues/231) was marked solved last December so that should open up some doors.
- Does the current implementation allow for loudness compensated volume control on top of an already present CamillaDSP pipeline?
- And just to confirm, this also works for renderers such as Spotify Connect even though Camilla volume is set to 0db when connected?

Currently I have a pipeline with and without loudness and manually switch between them. I'm considering this as a more elegant solution.

Thanks for all your work Smile
Reply
#19
1. Does the current implementation allow for loudness compensated volume control on top of an already present CamillaDSP pipeline?

- In Moode 9 / CamillaDSP 2, main volume is integrated and always functioning. Moode proxies its volume knob to CamillaDSP volume automatically. There is also a volume filter but it's used for aux faders and not main volume.
- Loudness is just another filter in CamillaDSP 2 so you should be able to add it to any pipeline.

               

2. And just to confirm, this also works for renderers such as Spotify Connect even though Camilla volume is set to 0db when connected?

Yes. Moode automatically sets CamillaDSP volume to 0dB when Spotify, Airplay, or Bluetooth clients connect and then restores knob volume when they disconnect.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#20
Hey, thanks for the quick response!

I'm sorry but I think I read this thread too fast and misunderstood. I thought this loudness compensated volume control increased the loudness dynamically with changes in volume (so if the volume is lower the loudness is higher and if the volume is high the loudness is off). But is this more of a "If volume below threshold -> loudness on"? Or am I still misunderstanding?

In any case, my question was just whether there is an easier way to accomplish this now in MoOde or is the method described at the start of this thread the best way?

(I already use a loudness filter in cdsp and it works great ?)
Reply


Forum Jump: