Takashi Iwai wrote: > At Mon, 30 Nov 2009 10:51:17 +0100, > Yes, I meant to add some codes to the plugin :) > It's easy to write the code to send silence to the side speakers > except for 7.1. Your right. I just did that. If somebody's interested here's how: Go into alsa-plugins' mix/pcm_upmix.c. In SND_PCM_PLUGIN_DEFINE_FUNC(upmix) add ' && channels != 8' to if (channels != 4 && channels != 6 && channels != 0) { so the plugin will accept the channels configuration parameter to be 8. You also have to replace the 6 with 8 within snd_pcm_extplug_set_param_minmax(&mix->ext, SND_PCM_EXTPLUG_HW_CHANNELS, 1, 6); In upmix_init add an additional stype value for 8 channels config: switch (ext->slave_channels) { case 6: stype = 1; break; case 8: stype = 2; break; default: stype = 0; } and allow ctype to be up to 7: if (ctype < 0 || ctype > 7) { Now you can extend the do_upmix matrix, which determines what function to call on what input-output situation. Mine looks like this: static const upmixer_t do_upmix[8][3] = { { upmix_1_to_40, upmix_1_to_51, upmix_1_to_71 }, { upmix_2_to_40, upmix_2_to_51, upmix_2_to_71 }, { upmix_3_to_40, upmix_3_to_51, upmix_3_to_51 }, { upmix_4_to_40, upmix_4_to_51, upmix_4_to_51 }, { upmix_4_to_40, upmix_5_to_51, upmix_5_to_51 }, { upmix_4_to_40, upmix_6_to_51, upmix_6_to_51 }, { upmix_4_to_40, upmix_6_to_51, upmix_6_to_51 }, { upmix_4_to_40, upmix_6_to_51, upmix_8_to_71 }, }; The third column is for stype 2 (8 channels output), the two additional rows are for ctypes 6 and 7 (7 and 8 channels input). Explanation: If there is 1 channel input, a modified copy of upmix_1_to_51 is used with i < 8 instead of 6, so the source gets copied to the additional two channels as well. If there are 2 channels, a modified copy of upmix_2_to_51 is used. It includes the additional line snd_pcm_areas_copy(dst_areas + 6, dst_offset, src_areas, src_offset, 2, size, SND_PCM_FORMAT_S16); that copies front left and right to side left and right. I've just ignored channel counts 3 and 7 since they don't make too much sense to me. If the source has 4 to 6 channels, the side speakers aren't used, so the signal sounds like it is intended to. And finally if the source has got 8 channels, a copy of upmix_6_to_51 is used, in which param 6 is replaced with 8. Simple thing and works great Thanks for your tip, Takashi ------------------------------------------------------------------------------ Join us December 9, 2009 for the Red Hat Virtual Experience, a free event focused on virtualization and cloud computing. Attend in-depth sessions from your desk. Your couch. Anywhere. http://p.sf.net/sfu/redhat-sfdev2dev _______________________________________________ Alsa-user mailing list Alsa-user@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/alsa-user