All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG] Bad decibel data on C-Media USB sound card
@ 2014-09-28 18:56 Allen M.
  2014-09-29  7:51 ` Clemens Ladisch
  0 siblings, 1 reply; 11+ messages in thread
From: Allen M. @ 2014-09-28 18:56 UTC (permalink / raw)
  To: alsa-devel

First time bug submitter, forgive me if I'm not following proper procedure.

OS: Arch Linux 64-bit
Kernel version: 3.16.3-1-ARCH

What's happening:
When the Master channel is lowered below 35% in alsamixer,
all audio coming out of the C-Media USB sound card is muted.

Additional info:
PulseAudio is installed
Output of 'lsusb':
   Bus 005 Device 002: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
Alsa hw ID name:
   'Set'
Output of 'cat /proc/asound/Set/usbmixer'
   http://ix.io/exb

Any assistance in resolving the issue is greatly appreciated

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

* Re: [BUG] Bad decibel data on C-Media USB sound card
  2014-09-28 18:56 [BUG] Bad decibel data on C-Media USB sound card Allen M.
@ 2014-09-29  7:51 ` Clemens Ladisch
  0 siblings, 0 replies; 11+ messages in thread
From: Clemens Ladisch @ 2014-09-29  7:51 UTC (permalink / raw)
  To: alsa-devel

Allen M. wrote:
> When the Master channel is lowered below 35% in alsamixer,

What is the value of the "Headphone Playback Volume" mixer control
(as shown by "amixer contents") above and below this threshold?


Regards,
Clemens

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

* [BUG] Bad decibel data on C-Media USB sound card
@ 2014-09-29 12:19 Allen M.
  2014-09-29 15:41 ` Raymond Yau
  0 siblings, 1 reply; 11+ messages in thread
From: Allen M. @ 2014-09-29 12:19 UTC (permalink / raw)
  To: alsa-devel

Clemens Ladisch wrote:
>What is the value of the "Headphone Playback Volume" mixer control
>(as shown by "amixer contents") above and below this threshold?

using "amixer --device hw:Set contents"
36% yields "values=8,8"
34% yields "values=0,0"

interestingly, using "alsamixer" shows that while (default) reports 36%,
the C-media device reports 3%

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

* Re: [BUG] Bad decibel data on C-Media USB sound card
  2014-09-29 12:19 Allen M.
@ 2014-09-29 15:41 ` Raymond Yau
  0 siblings, 0 replies; 11+ messages in thread
From: Raymond Yau @ 2014-09-29 15:41 UTC (permalink / raw)
  To: Allen M.; +Cc: alsa-devel

> >What is the value of the "Headphone Playback Volume" mixer control
> >(as shown by "amixer contents") above and below this threshold?
>
> using "amixer --device hw:Set contents"
> 36% yields "values=8,8"
> 34% yields "values=0,0"
>
> interestingly, using "alsamixer" shows that while (default) reports 36%,
> the C-media device reports 3%

Card: C-Media USB Headphone Set at usb-0000:00:12.0-1, full speed Unit: 9
Control: name="Headphone Playback Volume", index=0 Info: id=9, control=2,
cmask=0x3, channels=2, type="S16" Volume: min=-7264, max=-16, dBmin=-2837,
dBmax=-6

Unit: 10 Control: name="Auto Gain Control", index=0 Info: id=10, control=7,
cmask=0x0, channels=1, type="BOOLEAN" Volume: min=0, max=1, dBmin=0, dBmax=0

Do the automatic gain has any side effect when it normalise the volume?

Do you mean the sound card does not has 7248 steps ?

http://www.freedesktop.org/wiki/Software/PulseAudio/Backends/ALSA/Decibel/

You need to find out the value of c->res

https://bugzilla.redhat.com/show_bug.cgi?id=1065097

As you complain dB range -28.37 to -0.06 are not correct

You need to calibrate the dB range

https://bugs.freedesktop.org/show_bug.cgi?id=46236

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

* [BUG] Bad decibel data on C-Media USB sound card
@ 2014-09-29 22:29 Allen M.
  2014-09-30  8:27 ` Raymond Yau
  0 siblings, 1 reply; 11+ messages in thread
From: Allen M. @ 2014-09-29 22:29 UTC (permalink / raw)
  To: superquad.vortex2; +Cc: alsa-devel

Raymond Yau wrote:

>Do the automatic gain has any side effect when it normalise the volume?

I am unsure of how to go about testing that, 'alsamixer' does not appear
to allow me to modify automatic gain.


>Do you mean the sound card does not has 7248 steps?

I am not familiar with how to properly check, however dbverify indicates
'Element volume range is 0..151 (-28.37..-0.06 dB).'

Instructions for dbmeasure on the wiki indicates the need for a Line In,
the sound card only provides Line Out and Mic In. Will it automatically
make use of 'Mic In' if 'Line In' is absent? Or do I even need to use it?


>You need to find out the value of c->res
>As you complain dB range -28.37 to -0.06 are not correct

Quick testing done with dbverify: http://ix.io/eyi


>You need to calibrate the dB range

Volume Steps <=3 are mute while volume step 4 is audible,
based on dbverify testing. This 'seems' to indicate that the
minimum volume is somewhere between -27.81 dB to -27.63 dB?

Additional info logs:
Output of 'amixer -c2 contents': http://ix.io/eyq
Alsa info script output: http://ix.io/eyn

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

* Re: [BUG] Bad decibel data on C-Media USB sound card
  2014-09-29 22:29 Allen M.
@ 2014-09-30  8:27 ` Raymond Yau
  0 siblings, 0 replies; 11+ messages in thread
From: Raymond Yau @ 2014-09-30  8:27 UTC (permalink / raw)
  To: Allen M.; +Cc: alsa-devel

>
> >Do the automatic gain has any side effect when it normalise the volume?
>
> I am unsure of how to go about testing that, 'alsamixer' does not appear
> to allow me to modify automatic gain.
>

You have to specify card number

It affect your measurent if you are using the mic on your usb audio if the
automatic gain control is switch on

>
> >Do you mean the sound card does not has 7248 steps?
>
> I am not familiar with how to properly check, however dbverify indicates
> 'Element volume range is 0..151 (-28.37..-0.06 dB).'
>
> Instructions for dbmeasure on the wiki indicates the need for a Line In,
> the sound card only provides Line Out and Mic In. Will it automatically
> make use of 'Mic In' if 'Line In' is absent? Or do I even need to use it?
>

Background noise affect the result if you are not using line in and line
out with a loopback cable , this mean you have to minimize the background
noise

>
> >You need to find out the value of c->res
> >As you complain dB range -28.37 to -0.06 are not correct
>
> Quick testing done with dbverify:http://ix.io/eyi
>
>
> >You need to calibrate the dB range
>
> Volume Steps <=3 are mute while volume step 4 is audible,
> based on dbverify testing. This 'seems' to indicate that the
> minimum volume is somewhere between -27.81 dB to -27.63 dB?
>

How many steps need to reduce   amplitude of the recorded sine wave by half
when you play a sine wav through your usb audio and record it back using
audacity?

http://mailman.alsa-project.org/pipermail/alsa-devel/2010-September/032016.html

You many need to change the name of the volume control to headphone
playback volume in alsamixertest

> Additional info logs:
> Output of 'amixer -c2 contents':http://ix.io/eyq
> Alsa info script output:http://ix.io/eyn

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

* [BUG] Bad decibel data on C-Media USB sound card
@ 2014-09-30 20:22 Allen M.
  2014-10-01  9:51 ` Raymond Yau
  0 siblings, 1 reply; 11+ messages in thread
From: Allen M. @ 2014-09-30 20:22 UTC (permalink / raw)
  To: Raymond Yau; +Cc: alsa-devel

Raymond Yau wrote:

>It affect your measurent if you are using the mic on your usb audio if the
>automatic gain control is switch on

Automatic gain control is now switched off.


>Background noise affect the result if you are not using line in and line
>out with a loopback cable

I am using loopback, noise should not be an issue.


>How many steps need to reduce amplitude of the recorded sine wave by
>half when you play a sine wav through your usb audio and record it back
>using audacity?

Using recorded sine wav provided by 'speaker-test -t sin'
amplitude of recorded sine wave reduced by half at step 77

output of 'amixer -c 2 set Headphone 77':
 Simple mixer control 'Headphone',0
   Capabilities: pvolume pswitch pswitch-joined
   Playback channels: Front Left - Front Right
   Limits: Playback 0 - 151
   Mono:
   Front Left: Playback 77 [51%] [-13.94dB] [on]
   Front Right: Playback 77 [51%] [-13.94dB] [on]


>You many need to change the name of the volume control to headphone
>playback volume in alsamixertest

Done. alsamixertest output: http://ix.io/ezd

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

* Re: [BUG] Bad decibel data on C-Media USB sound card
  2014-09-30 20:22 Allen M.
@ 2014-10-01  9:51 ` Raymond Yau
  0 siblings, 0 replies; 11+ messages in thread
From: Raymond Yau @ 2014-10-01  9:51 UTC (permalink / raw)
  To: Allen M., david.henningsson; +Cc: alsa-devel

>
> >It affect your measurent if you are using the mic on your usb audio if
the
> >automatic gain control is switch on
>
> Automatic gain control is now switched off.
>
>
> >Background noise affect the result if you are not using line in and line
> >out with a loopback cable
>
> I am using loopback, noise should not be an issue.
>
>
> >How many steps need to reduce amplitude of the recorded sine wave by
> >half when you play a sine wav through your usb audio and record it back
> >using audacity?
>
> Using recorded sine wav provided by 'speaker-test -t sin'
> amplitude of recorded sine wave reduced by half at step 77
>
> output of 'amixer -c 2 set Headphone 77':
>  Simple mixer control 'Headphone',0
>    Capabilities: pvolume pswitch pswitch-joined
>    Playback channels: Front Left - Front Right
>    Limits: Playback 0 - 151
>    Mono:
>    Front Left: Playback 77 [51%] [-13.94dB] [on]
>    Front Right: Playback 77 [51%] [-13.94dB] [on]
>
>

Does this number of steps remain the same when your starting volume are not
at 151?

Your value 77 seem quite different from  alsamixertest

> >You many need to change the name of the volume control to headphone
> >playback volume in alsamixertest
>
> Done. alsamixertest output:http://ix.io/ezd

You may need David to analyse the result

Do those measured value match with those in datasheet?

Seem the measured dB range is larger than 27 dB

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/log/sound/usb?qt=grep&q=cm106

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

* [BUG] Bad decibel data on C-Media USB sound card
@ 2014-10-01 23:18 Allen M.
  2014-10-03  7:14 ` Raymond Yau
  0 siblings, 1 reply; 11+ messages in thread
From: Allen M. @ 2014-10-01 23:18 UTC (permalink / raw)
  To: Raymond Yau; +Cc: alsa-devel

Raymond Yau wrote:

>Does this number of steps remain the same when your starting volume are
not at 151?
>Your value 77 seem quite different from  alsamixertest

recording a sine wave with an amplitude of 1 in Audacity at step 151 shows
that the recorded
value is amplitude 0.885. Does this indicates some loss? The loopback cable
I am using
is 2 meters in length, is the resistance of the cable is too high?

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

* Re: [BUG] Bad decibel data on C-Media USB sound card
  2014-10-01 23:18 Allen M.
@ 2014-10-03  7:14 ` Raymond Yau
  0 siblings, 0 replies; 11+ messages in thread
From: Raymond Yau @ 2014-10-03  7:14 UTC (permalink / raw)
  To: Allen M.; +Cc: alsa-devel

>
> >Does this number of steps remain the same when your starting volume are
not at 151?
> >Your value 77 seem quite different from  alsamixertest
>
> recording a sine wave with an amplitude of 1 in Audacity at step 151
shows that the recorded
> value is amplitude 0.885. Does this indicates some loss? The loopback
cable I am using
> is 2 meters in length, is the resistance of the cable is too high?

Did you use mono or stereo in playback and capture?

Did your capture volume /boost set to 0dB?

Do your sound card support the sampling rate ?

It depends on frequency of sine wave, sampling rate, playback gain/atten
capture gain/atten

http://wiki.linuxaudio.org/apps/all/jaaa

Do the frequency response of your card look like a straight line at 0dB
similar to those cards loopback test ?

http://audio.rightmark.org/test_results.shtml

Refer to the datasheet and your alsamixertest result , the card seem not
has fixed gain for each step

> >You many need to change the name of the volume control to headphone
> >playback volume in alsamixertest
> > Done. alsamixertest output:http://ix.io/ezd

Are you using version 48.11?

Seem alsamixertest is not suitable for testing volume control with less
than 1dB per step or variable dB per step

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

* [BUG] Bad decibel data on C-Media USB sound card
@ 2014-10-03 15:48 Allen M.
  0 siblings, 0 replies; 11+ messages in thread
From: Allen M. @ 2014-10-03 15:48 UTC (permalink / raw)
  To: Raymond Yau; +Cc: alsa-devel

Raymond Yau wrote:

>Did you use mono or stereo in playback and capture?

mono


>Did your capture volume /boost set to 0dB?

yes


>Do your sound card support the sampling rate ?

Yes


>Refer to the datasheet and your alsamixertest result , the card seem not
>has fixed gain for each step

http://www.steila.com/USB4IO/CMedia/CM119.pdf
Card is using C-Media CM119.
Datasheet seems to show 38 volume control steps?
Should the steps be 38 instead of 151? Or are these values unrelated?


>Are you using version 48.11?

Yes

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

end of thread, other threads:[~2014-10-03 15:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-28 18:56 [BUG] Bad decibel data on C-Media USB sound card Allen M.
2014-09-29  7:51 ` Clemens Ladisch
  -- strict thread matches above, loose matches on Subject: below --
2014-09-29 12:19 Allen M.
2014-09-29 15:41 ` Raymond Yau
2014-09-29 22:29 Allen M.
2014-09-30  8:27 ` Raymond Yau
2014-09-30 20:22 Allen M.
2014-10-01  9:51 ` Raymond Yau
2014-10-01 23:18 Allen M.
2014-10-03  7:14 ` Raymond Yau
2014-10-03 15:48 Allen M.

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.