emu10k1 SB Live: Master volume and front channels via fxbus 8,9
PATCH 1/5 emu10k1 SB Live: Master volume and front channels via fxbus 8,9
This is the first in a set of five patches that add master volume and switch controls and front pcm channels via fxbus 8,9 to SB Live.
master_volume.patch:
Adds "Master Digital Playback Volume" which controls all six pcm playback channels.
pci/emu10k1/emufx.c +14 -1
@@ -934,7 +934,7 @@return err; } -#define SND_EMU10K1_GPR_CONTROLS 41 +#define SND_EMU10K1_GPR_CONTROLS 43#define SND_EMU10K1_INPUTS 10#define SND_EMU10K1_PLAYBACK_CHANNELS 8#define SND_EMU10K1_CAPTURE_CHANNELS 4
@@ -1780,6 +1780,19 @@ }/* +* Master Volume +*/ +for (z =0 ; z <6 ; z++) { +SWITCH (icode, &ptr, playback + z, playback + z, gpr +0 ); +VOLUME (icode, &ptr, playback + z, playback + z, gpr +1 ); + } + +snd_emu10k1_init_mono_onoff_control (controls + i++,"Master Digital Playback Switch" , gpr +0 ,0 ); +snd_emu10k1_init_mono_control (controls + i++,"Master Digital Playback Volume" , gpr +1 ,0 ); + gpr +=2 ; + + +/* * Process tone control */ OP (icode, &ptr, iACC3,GPR (playback +SND_EMU10K1_PLAYBACK_CHANNELS +0 ),GPR (playback +0 ),C_00000000 ,C_00000000 );/* left */
Quoted 2 lines · Mikael Magnusson
This is the first in a set of five patches that add master volume and switch controls and front pcm channels via fxbus 8,9 to SB Live.
I still feel that it's broken idea. We have also problems with AC97 where the surround/center&lfe volumes are separate from AC97 Master Volume control, too (at least for Sigmatel codecs).
We need a layer in user space to handle these issues where we can express the control relations in very easy way and not mess the kernel with more dust which is not necessary.
It might be easy to write a small daemon which will create "Master Volume" control for SB cards at this time until a decent solution in alsa-lib is finished.
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
Quoted 10 lines · Jaroslav Kysela
Quoted 1 line · Mikael Magnusson
This is the first in a set of five patches that add master volume and switch controls and front pcm channels via fxbus 8,9 to SB Live.
I still feel that it's broken idea. We have also problems with AC97 where the surround/center&lfe volumes are separate from AC97 Master Volume control, too (at least for Sigmatel codecs).
Quoted 7 lines
We need a layer in user space to handle these issues where we can express
the control relations in very easy way and not mess the kernel with more dust which is not necessary.It might be easy to write a small daemon which will create "Master Volume" control for SB cards at this time until a decent solution in alsa-lib is finished.
Jaroslav
I think a "Master Digital Volume" or separate controls for surround, center and lfe are needed.
How are you otherwise going to implement a "Master Volume" control in user space if you allow the user to change for example "Wave Surround" and "Surround"?
/Mikael
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
Quoted 23 lines · Mikael Magnusson
Quoted 15 lines · Jaroslav Kysela
Quoted 2 lines · Mikael Magnusson
This is the first in a set of five patches that add master volume and switch controls and front pcm channels via fxbus 8,9 to SB Live.
I still feel that it's broken idea. We have also problems with AC97 where the surround/center&lfe volumes are separate from AC97 Master Volume control, too (at least for Sigmatel codecs).
We need a layer in user space to handle these issues where we can express the control relations in very easy way and not mess the kernel with more dust which is not necessary.
Quoted 6 lines
It might be easy to write a small daemon which will create "Master Volume" control for SB cards at this time until a decent solution in alsa-lib is finished.
Jaroslav
Quoted 6 lines
I think a "Master Digital Volume" or separate controls for surround, center and lfe are needed.
How are you otherwise going to implement a "Master Volume" control in user space if you allow the user to change for example "Wave Surround" and "Surround"?
As you noted here, the implemention of Master is only one abstraction view for this device. Other users might use the card as two virtual PCM devices (front = card1, rear = card2) and in this case is Master completely useless for this example.
The control API allow to lock the specific control for writing (and only application which locked the control can write to it), thus the user space implementation can use this feature.
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
Quoted 5 lines · Jaroslav Kysela
Quoted 2 lines · Mikael Magnusson
Jaroslav Kysela wrote:
...
Quoted 11 lines
Quoted 4 lines
I think a "Master Digital Volume" or separate controls for surround, center and lfe are needed.
How are you otherwise going to implement a "Master Volume" control in user space if you allow the user to change for example "Wave Surround" and "Surround"?
As you noted here, the implemention of Master is only one abstraction view for this device. Other users might use the card as two virtual PCM devices (front = card1, rear = card2) and in this case is Master completely useless for this example.
The control API allow to lock the specific control for writing (and only application which locked the control can write to it), thus the user space implementation can use this feature.
Jaroslav
And how do I adjust the rear, center and lfe volumes if the controls are locked? Should I have to use the soft volume plugin?
/Mikael
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
Quoted 21 lines · Mikael Magnusson
Quoted 5 lines · Jaroslav Kysela
Quoted 2 lines · Mikael Magnusson
Jaroslav Kysela wrote:
...
Quoted 14 lines
Quoted 7 lines
I think a "Master Digital Volume" or separate controls for surround, center and lfe are needed.
How are you otherwise going to implement a "Master Volume" control in user space if you allow the user to change for example "Wave Surround" and "Surround"?
As you noted here, the implemention of Master is only one abstraction view for this device. Other users might use the card as two virtual PCM devices (front = card1, rear = card2) and in this case is Master completely useless for this example.
Quoted 8 lines
Quoted 5 lines
The control API allow to lock the specific control for writing (and only application which locked the control can write to it), thus the user space implementation can use this feature.
Jaroslav
And how do I adjust the rear, center and lfe volumes if the controls are locked? Should I have to use the soft volume plugin?
You may create new rear/center/lfe volume controls in user space and define expression:
hw volume = master volume * output specific volume
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
Quoted 9 lines · Jaroslav Kysela
Quoted 2 lines · Mikael Magnusson
This is the first in a set of five patches that add master volume and switch controls and front pcm channels via fxbus 8,9 to SB Live.
I still feel that it's broken idea. We have also problems with AC97 where the surround/center&lfe volumes are separate from AC97 Master Volume control, too (at least for Sigmatel codecs).
Quoted 7 lines
We need a layer in user space to handle these issues where we can express the control relations in very easy way and not mess the kernel with more dust which is not necessary.
It might be easy to write a small daemon which will create "Master Volume" control for SB cards at this time until a decent solution in alsa-lib is finished.
I believe Mikael's patch is correct. At least, partially.
There are two separate issues that the patch addresses. One is that unlike the Audigy configuration, the driver does not use separate FX buses for front output and PCM. So attenuating the front channels will attenuate *all* PCM samples. This has to be fixed in the driver. And it's essentially zero cost as the extra FX buses and GPRs are available.
The other issue is the lack of a master volume control. Provided the first issue is addressed, perex is correct in that this can be solved in userspace.
Personally I feel that the entire patch should be applied, until the required abstraction layer exists in alsa-lib. The second part of the patch can be trivially reverted when this is available.
Mikael, can you split your patch into the part that moves PCM and front to separate FX buses, and the part that adds the master volume?
Lee
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
Quoted 5 lines · Lee Revell
There are two separate issues that the patch addresses. One is that unlike the Audigy configuration, the driver does not use separate FX buses for front output and PCM. So attenuating the front channels will attenuate *all* PCM samples. This has to be fixed in the driver. And it's essentially zero cost as the extra FX buses and GPRs are available.
Sorry, but I don't understand very well why we need to have "PCM mix" FX buses. We can do this "down-mix" in the DSP code, but it's better to do it in application. My original DSP code for emu10k1 have only front, rear, center+lfe FX buses (6). I must miss something important here.
Quoted 7 lines
The other issue is the lack of a master volume control. Provided the first issue is addressed, perex is correct in that this can be solved in userspace.
Personally I feel that the entire patch should be applied, until the required abstraction layer exists in alsa-lib. The second part of the patch can be trivially reverted when this is available.
Maybe..
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
Quoted 10 lines · Jaroslav Kysela
Quoted 5 lines · Lee Revell
There are two separate issues that the patch addresses. One is that unlike the Audigy configuration, the driver does not use separate FX buses for front output and PCM. So attenuating the front channels will attenuate *all* PCM samples. This has to be fixed in the driver. And it's essentially zero cost as the extra FX buses and GPRs are available.
Quoted 5 lines
Sorry, but I don't understand very well why we need to have "PCM mix" FX buses. We can do this "down-mix" in the DSP code, but it's better to do it in application. My original DSP code for emu10k1 have only front, rear, center+lfe FX buses (6). I must miss something important here.
I don't understand what you mean with "PCM mix". Are you thinking of the default output which are up-mixed to 5.1? The patch doesn't down-mix 5.1 to front or something like that. It adds two fx inputs that are routed to front only and not up-mixed to 5.1. This is how the Audigy driver works. It also can make the configuration file a little cleaner, since it doesn't have to mute the up-mixed outputs.
/Mikael
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
Quoted 6 lines · Mikael Magnusson
Quoted 5 lines
Sorry, but I don't understand very well why we need to have "PCM mix" FX buses. We can do this "down-mix" in the DSP code, but it's better to do it in application. My original DSP code for emu10k1 have only front, rear, center+lfe FX buses (6). I must miss something important here.
Quoted 6 lines
I don't understand what you mean with "PCM mix". Are you thinking of the default output which are up-mixed to 5.1? The patch doesn't down-mix 5.1 to front or something like that. It adds two fx inputs that are routed to front only and not up-mixed to 5.1. This is how the Audigy driver works. It also can make the configuration file a little cleaner, since it doesn't have to mute the up-mixed outputs.
I see now. My behaviour was to "duplicate" front to surround with "Wave Surround" controls and you propose to have FX buses which will route signal to both front & rear and separate FX buses to route signal to front only.
I don't see the real benefit. Both cases are correct and the alsa-lib configuration won't be much different. Anyway, if you feel that it's better, then go ahead...
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
At Wed, 23 Feb 2005 10:00:49 +0100 (CET),
Quoted 16 lines · Jaroslav
Quoted 6 lines · Mikael Magnusson
Quoted 5 lines
Sorry, but I don't understand very well why we need to have "PCM mix" FX buses. We can do this "down-mix" in the DSP code, but it's better to do it in application. My original DSP code for emu10k1 have only front, rear, center+lfe FX buses (6). I must miss something important here.
Quoted 6 lines
I don't understand what you mean with "PCM mix". Are you thinking of the default output which are up-mixed to 5.1? The patch doesn't down-mix 5.1 to front or something like that. It adds two fx inputs that are routed to front only and not up-mixed to 5.1. This is how the Audigy driver works. It also can make the configuration file a little cleaner, since it doesn't have to mute the up-mixed outputs.
Quoted 8 lines
I see now. My behaviour was to "duplicate" front to surround with "Wave Surround" controls and you propose to have FX buses which will route signal to both front & rear and separate FX buses to route signal to front only.
I don't see the real benefit. Both cases are correct and the alsa-lib configuration won't be much different. Anyway, if you feel that it's better, then go ahead...
IIRC, the problem was stated in the case that both front and multi-channel streams are output at the same time.
I think this patch is fine (although not tested yet). At least, it will decrease the difference between Live and Audigy.
Takashi
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
Quoted 5 lines · Takashi Iwai
IIRC, the problem was stated in the case that both front and multi-channel streams are output at the same time.
I think this patch is fine (although not tested yet). At least, it will decrease the difference between Live and Audigy.
Agreed. This should be applied, as soon as we have some successful test reports. I would like for it to be in 1.0.9. But we should be careful as so many patches will have gone into the emu10k1 driver since 1.0.8.
I'll test this on my SBLive this weekend. And update some of the bug reports so the users who were really bothered by this can give some feedback.
Lee
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click