On Wed, Jan 07, 2009 at 06:32:51AM +0900, Jordi Beltran Creix wrote:
> > I'm not familiar with airplane headphones.  from your description, it
> > sounds like one is the left channel and one is the right channel.
> > do the plugs look different?  that is, is the "ring" in the same place
> > on both?  I would expect it to be in different places.
> 
> The ones I have can be used in normal mode and two plugs mode. The
> second one looks like a retractile mono plug. If it is out, one of the
> channels of the regular stereo plug is muted. I guess it is an
> alternative way of having stereo sound. I just happened to notice that
> one of the jacks didn't have sound output because I had the airplane
> headphones plugged in.

sure.  that makes sense.

but this got me thinking that it could be nice to have stereo output
on more than one jack, so multple headphones could be plugged in and
all getting the same source.

on some codecs this is possible by setting the correct _source control.
for example on my laptop:

$ mixerctl -v outputs.{hp,line-in}_source
outputs.hp_source=mix2  [ mix2 mix3 mix4 mix5 mix8 ]
outputs.line-in_source=mix2  [ mix2 mix3 mix4 mix5 mix8 ]

so I can set the source of the hp and line-in jacks.  they are both
currently set to mix2.  what is mix2?

$ mixerctl -v | grep mix2
outputs.mix2=120,120
inputs.mix2_source=dac,mix  { dac mix }
outputs.hp_source=mix2 [mix2 mix3 mix4 mix5 mix8 ]
outputs.spkr_source=mix3 [mix2 mix3 mix4 mix5 mix8 ]
outputs.mic_source=mix2 [mix2 mix3 mix4 mix5 mix8 ]
outputs.line-in_source=mix2 [mix2 mix3 mix4 mix5 mix8 ]
outputs.master.slaves=mix2,mix3,hp,spkr  { mix2 mix3 mix4 mix5 hp spkr mic mic2 
line-in mix8 }
$

the source of mix2 is 'dac' and 'mix'.  'dac' is the first DAC, digital
to analog converter.  this is what converts your audio data to what
tickles your speakers.  in -current, dac is the first two channels, dac2
is the next two channels, dac3 is the next two channels, etc[1].  so
stereo playback is handled by 'dac'.  if I am playing a stereo Ogg
file, I want my ultimate source to be 'dac'.  'mix' is the input mixer
on this device.  we'll just ignore that for now as it's not relevant
to this discussion.

so, by having hp and line-in sources set to mix2, and mix2 source set to
dac, both hp and line-in are getting the first stereo channels.

but there is another thing to check.  some jacks are capable of both
input and output.  this means that it is possible to control which
channels (input or output) are connected to the jack.  line-in is by
default connected to the input channel:

$ mixerctl -v outputs.line-in_dir
outputs.line-in_dir=input  [none output input input-vr0 input-vr50 input-vr80 ]

so I change it to output

$ mixerctl outputs.line-in_dir=output
outputs.line-in_dir: input -> output

now I have both jacks configured for stereo output.  in this configuration,
your two plug headphones would work.  note that I only made one change.

[1] when only the first dac would be used, other dacs can also get
the first channel(s).  for example, if a system has both hp and spkr
then 'dac', the dac connected by default to hp and the dac connected
by default to spkr all get the first channels.  usually this is just
'dac' and/or 'dac2'.  and I'm wondering if it would make sense for
all dacs to get the first channel(s) if only the first dac would be
used.

-- 
jake...@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org

Reply via email to