All of lore.kernel.org
 help / color / mirror / Atom feed
* RME 9632 Mixer...
@ 2004-05-25 19:54 Ed Wildgoose
  2004-05-26 13:13 ` Patrice Tisserand
  2004-05-26 15:46 ` Clemens Ladisch
  0 siblings, 2 replies; 8+ messages in thread
From: Ed Wildgoose @ 2004-05-25 19:54 UTC (permalink / raw)
  To: alsa-devel

...is driving me nuts.  Everytime I turn on the PC I need to find a PC 
with SSH to adjust the mixer controls so that I can hear some sound (no 
mouse and a tiny TV resolution on the box itelf)

Can anyone suggest how to script the controls to default to some known 
values?  I'm using alsa from around kernel 2.6.5 ish (which I believe 
Thomas said has had the alsactl options removed, certainly I can't 
figure out how to make them work).  Pointers to relevant parts of the 
driver appreciated even so that I can write something to set the mixers 
to a nice default.

As an aside, the mixer app appears to have save and load options, but 
these don't work for me.  Or perhaps I am just using them wrongly?  
Could this be a way out?

Thanks

Ed W

P.S. Sound quality is excellent once I get the mixers in the right 
position!  Thanks Thomas


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: RME 9632 Mixer...
  2004-05-25 19:54 RME 9632 Mixer Ed Wildgoose
@ 2004-05-26 13:13 ` Patrice Tisserand
  2004-05-26 15:46 ` Clemens Ladisch
  1 sibling, 0 replies; 8+ messages in thread
From: Patrice Tisserand @ 2004-05-26 13:13 UTC (permalink / raw)
  To: Ed Wildgoose; +Cc: alsa-devel

On Tue, 2004-05-25 at 21:54, Ed Wildgoose wrote:
> ...is driving me nuts.  Everytime I turn on the PC I need to find a PC 
> with SSH to adjust the mixer controls so that I can hear some sound (no 
> mouse and a tiny TV resolution on the box itelf)
> 
> Can anyone suggest how to script the controls to default to some known 
> values?  I'm using alsa from around kernel 2.6.5 ish (which I believe 
> Thomas said has had the alsactl options removed, certainly I can't 
> figure out how to make them work).  Pointers to relevant parts of the 
> driver appreciated even so that I can write something to set the mixers 
> to a nice default.
> 
Don't know if it will work with 2.6.5, but you can try to add a script
which call amixer after hdsploader.
You will find some information on hdsp routing at the following url:
http://pd.klingt.org/files/hdsp-howto.html#controlling_output_routing

Bye,
Patrice.
-- 
Knowledge belongs to humanity.



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: RME 9632 Mixer...
  2004-05-25 19:54 RME 9632 Mixer Ed Wildgoose
  2004-05-26 13:13 ` Patrice Tisserand
@ 2004-05-26 15:46 ` Clemens Ladisch
  2004-05-26 17:46   ` Thomas Charbonnel
  1 sibling, 1 reply; 8+ messages in thread
From: Clemens Ladisch @ 2004-05-26 15:46 UTC (permalink / raw)
  To: Ed Wildgoose; +Cc: alsa-devel

Ed Wildgoose wrote:
> Can anyone suggest how to script the controls to default to some known
> values?

"alsactl store" saves the current values of all mixer control in
/etc/asound.state, "alsactl restore" restores them.


HTH
Clemens




-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: RME 9632 Mixer...
  2004-05-26 15:46 ` Clemens Ladisch
@ 2004-05-26 17:46   ` Thomas Charbonnel
  2004-05-26 18:28     ` Thomas Charbonnel
  2004-05-27 13:30     ` Ed Wildgoose
  0 siblings, 2 replies; 8+ messages in thread
From: Thomas Charbonnel @ 2004-05-26 17:46 UTC (permalink / raw)
  To: clemens; +Cc: lists, alsa-devel

> Ed Wildgoose wrote:
>> Can anyone suggest how to script the controls to default to some known
>> values?
>
> "alsactl store" saves the current values of all mixer control in
> /etc/asound.state, "alsactl restore" restores them.
>
>
> HTH
> Clemens
>
>

 Hi Clemens, hi Ed,

This is not a standard mixer control, alsactl is of no use here.
Ed, here's a script for 1:1 routing (hdspmixer preset 1)

#! /bin/bash

for out_left in $(seq 0 2 16);
do
let out_right=$out_left+1
let in_left=$out_left+16
let in_right=$out_right+16
amixer cset numid=5 $in_left,$out_left,32768
amixer cset numid=5 $in_right,$out_right,32768
done;

This script assumes the hdsp is the default card, if it's not, just add
'-c X' (where X is your hdsp's alsa card number) between 'amixer' and
'cset'.

Thomas





-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: RME 9632 Mixer...
  2004-05-26 17:46   ` Thomas Charbonnel
@ 2004-05-26 18:28     ` Thomas Charbonnel
  2004-05-27 13:30     ` Ed Wildgoose
  1 sibling, 0 replies; 8+ messages in thread
From: Thomas Charbonnel @ 2004-05-26 18:28 UTC (permalink / raw)
  To: clemens; +Cc: lists, alsa-devel

Ooops :
> for out_left in $(seq 0 2 16);
should be :
for out_left in $(seq 0 2 14);

Thomas







-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: RME 9632 Mixer...
  2004-05-26 17:46   ` Thomas Charbonnel
  2004-05-26 18:28     ` Thomas Charbonnel
@ 2004-05-27 13:30     ` Ed Wildgoose
  2004-05-27 14:54       ` Thomas Charbonnel
  1 sibling, 1 reply; 8+ messages in thread
From: Ed Wildgoose @ 2004-05-27 13:30 UTC (permalink / raw)
  To: alsa-devel

Thomas Charbonnel wrote:

>>Ed Wildgoose wrote:
>>    
>>
>>>Can anyone suggest how to script the controls to default to some known
>>>values?
>>>      
>>>
>>
>This is not a standard mixer control, alsactl is of no use here.
>Ed, here's a script for 1:1 routing (hdspmixer preset 1)
>  
>

Aha, at last the penny drops... I had mucked around with this based on 
the alsa wiki instructions and hadn't got it working.  I (wrongly) seem 
to remember a post where it said this was not working anymore, and gave up.

The trick is clearly that the normal alsa sound channels start from 16, 
and outputs start from 0.

A couple of questions while I have your attention:

1) Is 32678 really 0dB?  Should it be 32767?  (I want to avoid any 
software rescaling of values where possible)
2) How can I set the output mixer values?
3) Is there any way to start hdspmixer and not load the defaults, ie so 
that I can experiment and reload hdspmixer in order to determine the 
current state of the mixer?
4) Why does the OSS emulation write to all (16)  channels when an app 
opens it in 2 channel mode?  It's very easy to do something really silly 
as a result (I got a rather nasty burning smell from my expensive 
speakers after inadvertently putting a lot of clipped signal through 
them at high power...)  Is this an OSS issue, or just the way this 
driver works?  (I don't have any other multichannel cards to compare 
against!)
5) Can you please point me to the relevant chunk of code which does the 
software mixing in the matrix mixer, also on the output channels.  I 
want to understand which if any levels can be set on the card rather 
than by dropping bits in the driver (or if you have the time, please 
feel free to enlighten me).  I'm trying to get highest quality signal, 
and wondering whether there is any kind of output based volume control 
on this card on the outside of the DAC, as opposed to just feeding it 
fewer bits.

Thanks Thomas, I really appreciate the work you have done making this 
all work.  I will try and add some notes on the alsa site for the RME 
9632 on the mixer settings

Ed W



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: RME 9632 Mixer...
  2004-05-27 13:30     ` Ed Wildgoose
@ 2004-05-27 14:54       ` Thomas Charbonnel
  2004-05-28  9:23         ` Takashi Iwai
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Charbonnel @ 2004-05-27 14:54 UTC (permalink / raw)
  To: lists; +Cc: alsa-devel

> Aha, at last the penny drops... I had mucked around with this based on
> the alsa wiki instructions and hadn't got it working.  I (wrongly) seem
> to remember a post where it said this was not working anymore, and gave
> up.
>

There were simple mixer controls (using the MIXER api, compatible with
alsamixer) that have been dropped, because they were conflicting with
hdspmixer's representation.
The matrix 'mixer' ctl is implemented using the HWDEP (hardware dependant)
interface because it is non-standard (and thus doesn't show up in
alsamixer).

> The trick is clearly that the normal alsa sound channels start from 16,
> and outputs start from 0.
>

The syntax is
amixer -c X numid=5 in,out,gain
where
* X is your hdsp's alsa card number
* in is the input (physical: 0-15, playback 16-31 for the hdsp 9632)
* out is the physical output targetted (0-15 for the 9632)
* gain is the gain between 0 and 65535 (-infinity to +6dB, 32768 being 0dB)

> A couple of questions while I have your attention:
>
> 1) Is 32678 really 0dB?  Should it be 32767?  (I want to avoid any
> software rescaling of values where possible)

0dB is 32768. It's true that 32767 would sound more logical, but this
appears to work (Jesse Chappell successfully fed an AC-3 external receiver
through raw spdif, which only works if the stream is totally unaltered).

> 2) How can I set the output mixer values?

You can't, that's the whole problem, and that's why it's not trivial to
implement simple mixer controls the proper way (this is also an answer to
your last post about this on alsa-user).
The mixer control is just a wrapper around the way the hardware works.
There is no output attenuation stage in hardware. It is simulated in
hdspmixer, but in the end when you move an output fader it translates to
simpler calls to the mixer ctl. This leads to your next point.

> 3) Is there any way to start hdspmixer and not load the defaults, ie so
> that I can experiment and reload hdspmixer in order to determine the
> current state of the mixer?

No, precisely because the representation hdspmixer proposes doesn't match
the hardware. There is no way for hdspmixer to reconstruct a coherent view
from the matrix mixer cache in the driver. So for now there is no way to
have hdspmixer and other programs access the mixer in a cooperative way.
The solution (already discussed on alsa-devel) is to write a daemon to
control the mixer and have all the other apps use it. I even can think of
a crooked use of the alsa ctl callback mechanism to make it compatible
with standard alsa mixer apps (define dummy simple mixer ctls, and have
the daemon register a callback for them. when an application requires a
change, the driver does nothing but the daemon is notified and does the
job).

> 4) Why does the OSS emulation write to all (16)  channels when an app
> opens it in 2 channel mode?  It's very easy to do something really silly
>  as a result (I got a rather nasty burning smell from my expensive
> speakers after inadvertently putting a lot of clipped signal through
> them at high power...)  Is this an OSS issue, or just the way this
> driver works?  (I don't have any other multichannel cards to compare
> against!)

I'm aware of this problem, but still have to track it down. I guess it's
related to the fact that the card can only be opened using all available
channels. I don't know if oss emulation uses the plughw facility, but
there must be something similar because non-interleaved streams are
handled properly, there just lacks something to deal with the number of
channel.

> 5) Can you please point me to the relevant chunk of code which does the
> software mixing in the matrix mixer, also on the output channels.  I
> want to understand which if any levels can be set on the card rather
> than by dropping bits in the driver (or if you have the time, please
> feel free to enlighten me).  I'm trying to get highest quality signal,
> and wondering whether there is any kind of output based volume control
> on this card on the outside of the DAC, as opposed to just feeding it
> fewer bits.
>

There is no software mixing, only hardware mixing. Even hdspmixer's output
stage, which is a software construction, translates to hardware calls.

> Thanks Thomas, I really appreciate the work you have done making this
> all work.  I will try and add some notes on the alsa site for the RME
> 9632 on the mixer settings
>
> Ed W
>

You're welcome. It would be indeed nice to add some 9632 specific notes on
the alsa site, thanks.

Thomas





-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: RME 9632 Mixer...
  2004-05-27 14:54       ` Thomas Charbonnel
@ 2004-05-28  9:23         ` Takashi Iwai
  0 siblings, 0 replies; 8+ messages in thread
From: Takashi Iwai @ 2004-05-28  9:23 UTC (permalink / raw)
  To: Thomas Charbonnel; +Cc: lists, alsa-devel

At Thu, 27 May 2004 16:54:38 +0200 (CEST),
Thomas Charbonnel wrote:
> 
> > Thanks Thomas, I really appreciate the work you have done making this
> > all work.  I will try and add some notes on the alsa site for the RME
> > 9632 on the mixer settings
> >
> > Ed W
> >
> 
> You're welcome. It would be indeed nice to add some 9632 specific notes on
> the alsa site, thanks.

More nice would be to have a document the ALSA source treed :)
Any volunteer?


--
Takashi Iwai <tiwai@suse.de>		ALSA Developer - www.alsa-project.org


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-05-28  9:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-25 19:54 RME 9632 Mixer Ed Wildgoose
2004-05-26 13:13 ` Patrice Tisserand
2004-05-26 15:46 ` Clemens Ladisch
2004-05-26 17:46   ` Thomas Charbonnel
2004-05-26 18:28     ` Thomas Charbonnel
2004-05-27 13:30     ` Ed Wildgoose
2004-05-27 14:54       ` Thomas Charbonnel
2004-05-28  9:23         ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.