ALSA equal plugin

Forums:

MOC version: 
2.5.2

/etc/asound.conf: https://git.darkn.space/unInstance/dotfiles/commit/d66fe44b6d7514dbc89555f157b0d58ae517ae9d
'mocp --version' output:

This is : Music On Console Version : 2.5.2 Revision : Unversioned directory Built : Mar 6 2020 20:05:13 Compiled with : OSS ALSA DEBUG Network streams resample Running on : Linux 5.4.13 x86_64 Author : Damian Pietras Homepage : http://moc.daper.net/ E-Mail : mocmaint@daper.net Copyright : (C) 2003-2016 Damian Pietras and others License : GNU General Public License, version 2 or later

Problem:
If I use ALSA equal plugin (which is equalizer), then mocp refuses to play all songs within some albums. I failed to spot any connection among these files.

I forgot to mention that mocp displays 'Can't set audio parameters: Invalid argument'.

Create another pcm device and have your mocp use it instead of the default one.
Suppose you use my asound.conf, then solution looks like this

# If you do not want some applications to be affected by # equalizer, then you can make them use this device instead # of pcm.default # # I have my mocp use this device instead of pcm.default # because it refuses to play some songs with ALSA equal plugin. # # Put this in ~/.moc/config to change the device: # ALSADevice = unequalized # pcm.unequalized { type plug slave.pcm "dmixed" } # It is required to create a ctl interface for pcm devices # used directly. # ctl.unequalized { type hw card 0 }

Another pcm device that does not use equal plugin.

First of all, I would suggest upgrading to development (or even SVN) version of MOC to make sure the problem is not yet resolved. From the feel of it, I guess the problem might be caused by your device not using ALSA automatic mixing and resampling. Are those albums encoded in different sample rate or sample width? You can try to fiddle with resampling settings and see if it helps. In current SVN MOC you could try also changing the value of ALSAStutterDefeat variable.

Here is my revisited asound.conf -> https://git.darkn.space/unInstance/dotfiles/src/branch/master/alsa/etc/asound.conf
Here is my new MOC (2.6-alpha3) -> https://github.com/jonsafari/mocp
New MOC does not play with through the equal plugin still. Same error.

Those albums that MOC refuses to play are 96kHz unlike the ones that it plays fine (44kHz).

What do you exactly mean by saying "ALSA automatic mixing and resampling"? Is this about 'type' plugin?

I meant not 'type' but 'plug' plugin.

I meant ALSA dmix plugin which by default convert audio parameters and mixes multiple streams. In your case maybe your soundcard doesn't handle 96kHz natively? You could try forcing MOC to resample to 44 or 48. Or you could try to pipe in dmix somehow in your custom device. I'm no ALSA expert and always had a lot of trouble writing a good .asoundrc file...

BTW. That github repo is not official and as far as I know has some code changes in it. The only official repo is here at svn://svn.daper.net/moc/trunk

I also use alsaequal, although my setup is a bit more complicated, with both jackd and a loopback device, 2 usb speakers, and 1 pcie card.

Some sound goes:

loopback -> jackd -> alsaeq -> card

And some goes directly to jackd first, but the same route after that.

It's a bit difficult without seeing the include files. Have you tried removing all rate info from pcm.dmixed? Something like:

pcm.dmixed {
type dmix;
ipc_key 1024;
slave.pcm "sound_card";
}

Then alsa should be able do any resampling it needs to do.

I also noticed that you have mixed using = in some statements, and not used it in others. I don't have any = in my .asoundrcs, but I don't know if it makes any difference.

I do use dmix. I have dummy device to bypass the equal plugin just. I believe my sound card is able to handle 96kHz because I can play these albums through dmix but without the equalizer. Moreover I can play them with both mpv and the equalizer.

But dmix changes sample rate behind your back. If I remember correctly ALSAStutterDefeat variable makes MOC take into account real possible sample rates of your soundcard. You could also try using one of the hw devices to bypass dmix and see what happens.

mpv might be doing some resampling of its own, I don't know.