Re: [Alsa-user] Hardware loopback

2014-06-30 Thread Denis Shulyaka
Hi,

2014-01-16 12:04 GMT+04:00 Clemens Ladisch :

> Denis Shulyaka wrote:
> > 2014/1/14 Clemens Ladisch :
> >> This device's descriptor do not define a mixer control
> >> for this control.
> >>
> >> Apparently, you have to set the SPDIFMIX bit.
> >
> > Well, do you have any idea on how can I do it? I'm OK with compiling a
> > custom kernel, but I don't have any experience with ALSA code. Just a
> > small hint would be appreciated) Can I somehow define it in the
> > descriptor?
>
> This is not a mixer control that could be described with a descriptor;
> one needs to write a custom control that writes to that vendor-specific
> register.
>
> I'll write a patch ...
>
>
> Regards,
> Clemens
>

Well, I've finally managed to set the SPDIFMIX bit in by modifying the
snd_usb_cm6206_boot_quirk() function. However it led me to another problem:
PCM streams are played fine and are routed to the analog speakers without
CPU interaction, but DTS streams sound like a loud noise.
Do I understand it right that the card hardware is not able to decode DTS
itself and it merely relies on a proprietary software driver for DTS
support? Can Alsa and PulseAudio deal with DTS? I just need to get the idea
what DTS is...

Best regards,
Denis Shulyaka
--
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] Hardware loopback

2014-01-16 Thread Clemens Ladisch
Denis Shulyaka wrote:
> 2014/1/14 Clemens Ladisch :
>> This device's descriptor do not define a mixer control
>> for this control.
>>
>> Apparently, you have to set the SPDIFMIX bit.
>
> Well, do you have any idea on how can I do it? I'm OK with compiling a
> custom kernel, but I don't have any experience with ALSA code. Just a
> small hint would be appreciated) Can I somehow define it in the
> descriptor?

This is not a mixer control that could be described with a descriptor;
one needs to write a custom control that writes to that vendor-specific
register.

I'll write a patch ...


Regards,
Clemens

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] Hardware loopback

2014-01-14 Thread Denis Shulyaka
Hi,

2014/1/14 Clemens Ladisch :
> This device's descriptor do not define a mixer control
> for this control.
>
> Apparently, you have to set the SPDIFMIX bit.

Well, do you have any idea on how can I do it? I'm OK with compiling a
custom kernel, but I don't have any experience with ALSA code. Just a
small hint would be appreciated) Can I somehow define it in the
descriptor?

Best regards,
Denis Shulyaka

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] Hardware loopback

2014-01-14 Thread Clemens Ladisch
Denis Shulyaka wrote:
> 2014/1/14 Clemens Ladisch :
>> What is the output of "lsusb -v" for this device?
>
> The output is below, also sending it as an attachment.

This device's descriptor do not define a mixer control
for this control.

Apparently, you have to set the SPDIFMIX bit.


Regards,
Clemens

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] Hardware loopback

2014-01-14 Thread Denis Shulyaka
Hi,

2014/1/14 Clemens Ladisch :
> What is the output of "lsusb -v" for this device?

The output is below, also sending it as an attachment.

pi@speaker ~ $ sudo lsusb -v -s 001:006

Bus 001 Device 006: ID 0d8c:0102 C-Media Electronics, Inc. CM106 Like
Sound Device
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   1.10
  bDeviceClass0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize0 8
  idVendor   0x0d8c C-Media Electronics, Inc.
  idProduct  0x0102 CM106 Like Sound Device
  bcdDevice0.10
  iManufacturer   0
  iProduct2 USB Sound Device
  iSerial 0
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength  534
bNumInterfaces  4
bConfigurationValue 1
iConfiguration  0
bmAttributes 0x80
  (Bus Powered)
MaxPower  500mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   0
  bInterfaceClass 1 Audio
  bInterfaceSubClass  1 Control Device
  bInterfaceProtocol  0
  iInterface  0
  AudioControl Interface Descriptor:
bLength10
bDescriptorType36
bDescriptorSubtype  1 (HEADER)
bcdADC   1.00
wTotalLength  200
bInCollection   2
baInterfaceNr( 0)   1
baInterfaceNr( 1)   2
  AudioControl Interface Descriptor:
bLength12
bDescriptorType36
bDescriptorSubtype  2 (INPUT_TERMINAL)
bTerminalID 1
wTerminalType  0x0101 USB Streaming
bAssocTerminal  0
bNrChannels 8
wChannelConfig 0x063f
  Left Front (L)
  Right Front (R)
  Center Front (C)
  Low Freqency Enhancement (LFE)
  Left Surround (LS)
  Right Surround (RS)
  Side Left (SL)
  Side Right (SR)
iChannelNames   0
iTerminal   0
  AudioControl Interface Descriptor:
bLength12
bDescriptorType36
bDescriptorSubtype  2 (INPUT_TERMINAL)
bTerminalID 4
wTerminalType  0x0201 Microphone
bAssocTerminal  0
bNrChannels 2
wChannelConfig 0x0003
  Left Front (L)
  Right Front (R)
iChannelNames   0
iTerminal   0
  AudioControl Interface Descriptor:
bLength10
bDescriptorType36
bDescriptorSubtype  6 (FEATURE_UNIT)
bUnitID 8
bSourceID   4
bControlSize1
bmaControls( 0)  0x01
  Mute Control
bmaControls( 1)  0x02
  Volume Control
bmaControls( 2)  0x02
  Volume Control
iFeature0
  AudioControl Interface Descriptor:
bLength10
bDescriptorType36
bDescriptorSubtype  6 (FEATURE_UNIT)
bUnitID 9
bSourceID   4
bControlSize1
bmaControls( 0)  0x01
  Mute Control
bmaControls( 1)  0x02
  Volume Control
bmaControls( 2)  0x02
  Volume Control
iFeature0
  AudioControl Interface Descriptor:
bLength25
bDescriptorType36
bDescriptorSubtype  4 (MIXER_UNIT)
bUnitID12
bNrInPins   3
baSourceID( 0)  1
baSourceID( 1)  9
baSourceID( 2) 11
bNrChannels 8
wChannelConfig 0x063f
  Left Front (L)
  Right Front (R)
  Center Front (C)
  Low Freqency Enhancement (LFE)
  Left Surround (LS)
  Right Surround (RS)
  Side Left (SL)
  Side Right (SR)
iChannelNames   0
bmControls 0x00
bmControls 0x00
bmControls 0x00
iMixer  0
junk at descriptor end: 00 00 00 00 00 00 00 00 00
  AudioControl Interface Descriptor:
bLength16
bDescriptorType36
bDescriptorSubtype  6 (FEATURE_UNIT)
bUnitID13
bSourceID  12
bControlSize1
bmaControls( 0)  0x01
  Mute Control
bmaControls( 1)  0x02
  Volume Control
bmaControl

Re: [Alsa-user] Hardware loopback

2014-01-13 Thread Clemens Ladisch
Denis Shulyaka wrote:
> 2014/1/13 Clemens Ladisch 
>> there should be a normal mixer control for the front output.
>
> Unfortunately I am unable to find such control myself.

What is the output of "lsusb -v" for this device?


Regards,
Clemens

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] Hardware loopback

2014-01-13 Thread Denis Shulyaka
Hi Clemens,

2014/1/13 Clemens Ladisch 
> As you can see in the block diagram, the S/PDIF input can be routed to
> both the S/PDIF output and to the analong front outputs.  "Loopback"
> usually means the same kind of connection, so there should be a normal
> mixer control for the front output.


Thank you for the response.

Unfortunately I am unable to find such control myself.
Below is my amixer output:

pi@speaker ~ $ amixer -c 0 info
Card hw:0 'Device'/'USB Sound Device at usb-bcm2708_usb-1.2.1, full speed'
  Mixer name: 'USB Mixer'
  Components: 'USB0d8c:0102'
  Controls  : 15
  Simple ctrls  : 6
pi@speaker ~ $ amixer -c 0 scontents
Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch pswitch-joined penum
  Playback channels: Front Left - Front Right - Rear Left - Rear Right
- Front Center - Woofer - Side Left - Side Right
  Limits: Playback 0 - 197
  Mono:
  Front Left: Playback 90 [46%] [-20.06dB] [on]
  Front Right: Playback 90 [46%] [-20.06dB] [on]
  Rear Left: Playback 90 [46%] [-20.06dB] [on]
  Rear Right: Playback 90 [46%] [-20.06dB] [on]
  Front Center: Playback 90 [46%] [-20.06dB] [on]
  Woofer: Playback 90 [46%] [-20.06dB] [on]
  Side Left: Playback 90 [46%] [-20.06dB] [on]
  Side Right: Playback 90 [46%] [-20.06dB] [on]
Simple mixer control 'PCM',0
  Capabilities: cvolume cswitch cswitch-joined penum
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 6928
  Front Left: Capture 4096 [59%] [0.01dB] [on]
  Front Right: Capture 4096 [59%] [0.01dB] [on]
Simple mixer control 'PCM Capture Source',0
  Capabilities: enum
  Items: 'Mic' 'Line' 'IEC958 In' 'Mixer'
  Item0: 'IEC958 In'
Simple mixer control 'Line',0
  Capabilities: pvolume cvolume pswitch pswitch-joined cswitch
cswitch-joined penum
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: Playback 0 - 8065 Capture 0 - 6928
  Front Left: Playback 6144 [76%] [0.01dB] [off] Capture 0 [0%] [-16.00dB] [off]
  Front Right: Playback 6144 [76%] [0.01dB] [off] Capture 0 [0%]
[-16.00dB] [off]
Simple mixer control 'Mic',0
  Capabilities: pvolume cvolume pswitch pswitch-joined cswitch
cswitch-joined penum
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: Playback 0 - 8065 Capture 0 - 6928
  Front Left: Playback 6153 [76%] [0.03dB] [off] Capture 4096 [59%]
[0.01dB] [on]
  Front Right: Playback 6153 [76%] [0.03dB] [off] Capture 4096 [59%]
[0.01dB] [on]
Simple mixer control 'IEC958 In',0
  Capabilities: cswitch cswitch-joined penum
  Capture channels: Mono
  Mono: Capture [on]


The two controls related to SPDIF In are 'PCM Capture Source' and
'IEC958 In'. I'm not sure what they mean. The latter seems to
enable/disable the mix of the SPDIF In into capture stream (i.e.,
Input). For the first one I have no idea.
I will try to experiment with different values of the controls, but
unfortunately for the following two weeks I will not have any SPDIF
signal source to play with.

Best regards,
Denis Shulyaka

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] Hardware loopback

2014-01-13 Thread Clemens Ladisch
Denis Shulyaka wrote:
> 2) USB sound card based on CM106 chip.
>
> For this to work as a SPDIF receiver I need to somehow connect SPDIF
> IN and analog out.
>
> 1) Configure a loopback on hardware level for the best latency and
>CPU usage
>
> I am currently trying to understand if my hardware supports Option 1.
> I have found a CM106 datasheet which suggests that setting bit 2
> (SPDIFLOOP) of register REG1 will enable SPDIF loop-back, however it
> is not clear whether the sound from SPDIF IN will be routed to SPDIF
> OUT or analog output

As you can see in the block diagram, the S/PDIF input can be routed to
both the S/PDIF output and to the analong front outputs.  "Loopback"
usually means the same kind of connection, so there should be a normal
mixer control for the front output.


Regards,
Clemens

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


[Alsa-user] Hardware loopback

2014-01-13 Thread Denis Shulyaka
Hi list,

Please forgive if it's the wrong place to post this question.

I'm trying to build a sound server connected to my speaker set  that will
act as:
1) SPDIF receiver from TV
2) Network sound server

My hardware:
1) Raspberry Pi
2) USB sound card based on CM106 chip.

My Software:
1) Raspbian
2) Linux 3.10.25
3) Pulseaudio 2.0 (will try to compile 4.0 tonight)

For this to work as a SPDIF receiver I need to somehow connect SPDIF IN and
analog out. So my question is, What is the best way to configure it? If I
get it right, I have three options here:
1) Configure a loopback on hardware level for the best latency and CPU usage
2) Configure a loopback on alsa level
3) Configure a loopback on pulseaudio level since I will use it for mixing
anyway

I am currently trying to understand if my hardware supports Option 1. I
have found a CM106 datasheet which suggests that setting bit 2 (SPDIFLOOP)
of register REG1 will enable SPDIF loop-back, however it is not clear
whether the sound from SPDIF IN will be routed to SPDIF OUT or analog
output and also whether this feature is what I'm looking for.

If the first option is not available, I would also ask for your advice on
which of the two last options is preferable.

Thanks in advance!

Best regards,
Denis Shulyaka
--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user