public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* em28xx i2s volume control
@ 2009-07-18 18:22 acano
  2009-07-19 13:50 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 5+ messages in thread
From: acano @ 2009-07-18 18:22 UTC (permalink / raw)
  To: linux-media

How do you control the i2s volume output on empia boards?

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

* Re: em28xx i2s volume control
  2009-07-18 18:22 em28xx i2s volume control acano
@ 2009-07-19 13:50 ` Mauro Carvalho Chehab
  2009-07-20 18:00   ` acano
  0 siblings, 1 reply; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2009-07-19 13:50 UTC (permalink / raw)
  To: acano; +Cc: linux-media

Em Sat, 18 Jul 2009 14:22:51 -0400
acano@fastmail.fm escreveu:

> How do you control the i2s volume output on empia boards?

the em28xx chip doesn't control volume. This is done at the audio chip. 

For ac97 chips, the volume is inside the em28xx driver, since we don't have a
v4l2 device driver for it yet.

On the cases where the volume is on an i2s chips like msp34xx, the volume
control is done at the i2c driver, that should be exporting such controls via
v4l2 dev/subdev API, by calling:
	v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_ctrl, ctrl);

This way, any application can control the volume via the proper ioctl's.

While trying to see why are you asking this, I noticed that the em28xx driver,
due to historic reasons, had an implementation that may cause confusion.

I just add there two patches that will make it clearer.

There aren't any functional changes with those patches (I tested here on
devices with msp34xx and with ac202 ac97), except for the fact that now the
qv4l2 will show the volume as a slider.



Cheers,
Mauro

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

* Re: em28xx i2s volume control
  2009-07-19 13:50 ` Mauro Carvalho Chehab
@ 2009-07-20 18:00   ` acano
  2009-07-28  0:36     ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 5+ messages in thread
From: acano @ 2009-07-20 18:00 UTC (permalink / raw)
  To: linux-media

On Sun, Jul 19, 2009 at 10:50:49AM -0300, Mauro Carvalho Chehab wrote:
> Em Sat, 18 Jul 2009 14:22:51 -0400
> acano@fastmail.fm escreveu:
>
> > How do you control the i2s volume output on empia boards?
>
> the em28xx chip doesn't control volume. This is done at the audio chip.
>
> For ac97 chips, the volume is inside the em28xx driver, since we don't have a
> v4l2 device driver for it yet.
>
> On the cases where the volume is on an i2s chips like msp34xx, the volume
> control is done at the i2c driver, that should be exporting such controls via
> v4l2 dev/subdev API, by calling:
> 	v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_ctrl, ctrl);
>
> This way, any application can control the volume via the proper ioctl's.
>
> While trying to see why are you asking this, I noticed that the em28xx driver,
> due to historic reasons, had an implementation that may cause
> confusion.

The problem is that it's not working for usb audio streaming.  With a
cable from line out of the device to my sound card it works well.
Volume can be controlled by applications using the v4l2 ioctls.

The audio from /dev/dsp? is always at max and distorts horribly on
many tv stations.  I can verify with 'modprobe msp3400 debug=1' that
it is trying to set volume I pass to it, but it simply has no effect
on the usb audio stream.

The reason I asked about i2s volume control is because the eeprom has
the bit set that shows my device as "USB audio class volume control
(capable) when audio source is i2s device".

Maybe it's a snd-usb-audio issue since the mixer setting for the
device doesn't allow volume changing.

>
> I just add there two patches that will make it clearer.
>
> There aren't any functional changes with those patches (I tested here on
> devices with msp34xx and with ac202 ac97), except for the fact that now the
> qv4l2 will show the volume as a slider.



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

* Re: em28xx i2s volume control
  2009-07-20 18:00   ` acano
@ 2009-07-28  0:36     ` Mauro Carvalho Chehab
  2009-07-30  5:02       ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2009-07-28  0:36 UTC (permalink / raw)
  To: acano; +Cc: linux-media

Em Mon, 20 Jul 2009 14:00:08 -0400
acano@fastmail.fm escreveu:

> On Sun, Jul 19, 2009 at 10:50:49AM -0300, Mauro Carvalho Chehab wrote:
> > Em Sat, 18 Jul 2009 14:22:51 -0400
> > acano@fastmail.fm escreveu:
> >
> > > How do you control the i2s volume output on empia boards?
> >
> > the em28xx chip doesn't control volume. This is done at the audio chip.
> >
> > For ac97 chips, the volume is inside the em28xx driver, since we don't have a
> > v4l2 device driver for it yet.
> >
> > On the cases where the volume is on an i2s chips like msp34xx, the volume
> > control is done at the i2c driver, that should be exporting such controls via
> > v4l2 dev/subdev API, by calling:
> > 	v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_ctrl, ctrl);
> >
> > This way, any application can control the volume via the proper ioctl's.
> >
> > While trying to see why are you asking this, I noticed that the em28xx driver,
> > due to historic reasons, had an implementation that may cause
> > confusion.
> 
> The problem is that it's not working for usb audio streaming.  With a
> cable from line out of the device to my sound card it works well.
> Volume can be controlled by applications using the v4l2 ioctls.
> 
> The audio from /dev/dsp? is always at max and distorts horribly on
> many tv stations.  I can verify with 'modprobe msp3400 debug=1' that
> it is trying to set volume I pass to it, but it simply has no effect
> on the usb audio stream.
> 
> The reason I asked about i2s volume control is because the eeprom has
> the bit set that shows my device as "USB audio class volume control
> (capable) when audio source is i2s device".
> 
> Maybe it's a snd-usb-audio issue since the mixer setting for the
> device doesn't allow volume changing.

I need to double check here with a Hauppauge device I have with msp34xx,
but it seems weird that this can't be controlled. 

Maybe it is some kind of bug at usb audio class driver. Maybe you can enable
some debug code there to see what it is doing with volume.



Cheers,
Mauro

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

* Re: em28xx i2s volume control
  2009-07-28  0:36     ` Mauro Carvalho Chehab
@ 2009-07-30  5:02       ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2009-07-30  5:02 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: acano, linux-media

Em Mon, 27 Jul 2009 21:36:48 -0300
Mauro Carvalho Chehab <mchehab@infradead.org> escreveu:

> Em Mon, 20 Jul 2009 14:00:08 -0400
> acano@fastmail.fm escreveu:
> 
> > On Sun, Jul 19, 2009 at 10:50:49AM -0300, Mauro Carvalho Chehab wrote:
> > > Em Sat, 18 Jul 2009 14:22:51 -0400
> > > acano@fastmail.fm escreveu:
> > >
> > > > How do you control the i2s volume output on empia boards?
> > >
> > > the em28xx chip doesn't control volume. This is done at the audio chip.
> > >
> > > For ac97 chips, the volume is inside the em28xx driver, since we don't have a
> > > v4l2 device driver for it yet.
> > >
> > > On the cases where the volume is on an i2s chips like msp34xx, the volume
> > > control is done at the i2c driver, that should be exporting such controls via
> > > v4l2 dev/subdev API, by calling:
> > > 	v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_ctrl, ctrl);
> > >
> > > This way, any application can control the volume via the proper ioctl's.
> > >
> > > While trying to see why are you asking this, I noticed that the em28xx driver,
> > > due to historic reasons, had an implementation that may cause
> > > confusion.
> > 
> > The problem is that it's not working for usb audio streaming.  With a
> > cable from line out of the device to my sound card it works well.
> > Volume can be controlled by applications using the v4l2 ioctls.
> > 
> > The audio from /dev/dsp? is always at max and distorts horribly on
> > many tv stations.  I can verify with 'modprobe msp3400 debug=1' that
> > it is trying to set volume I pass to it, but it simply has no effect
> > on the usb audio stream.
> > 
> > The reason I asked about i2s volume control is because the eeprom has
> > the bit set that shows my device as "USB audio class volume control
> > (capable) when audio source is i2s device".

Angelo,

I just checked the datasheet, at page 8 [1]: there's nothing we can do at msp34xx to control
volume at i2s interface.

Looking at the signal flow block diagram of MSP34x5G, it is clear that you have 3 different output patches:

1) loudspeaker: offers bass/treble, loudness, spatial effects, balance and volume controls;

2) SCART1 output: offers only volume control;

3) I2S: no control at all. 

So, with msp34xx, there's no way to change the i2s output volume.

[1] http://www.datasheetcatalog.org/datasheet/MicronasIntermetall/mXsrwrs.pdf



Cheers,
Mauro

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

end of thread, other threads:[~2009-07-30  5:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-18 18:22 em28xx i2s volume control acano
2009-07-19 13:50 ` Mauro Carvalho Chehab
2009-07-20 18:00   ` acano
2009-07-28  0:36     ` Mauro Carvalho Chehab
2009-07-30  5:02       ` Mauro Carvalho Chehab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox