WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: ALSA and external USB Sound Card (UCA222)  (Read 15592 times)

Offline TaoTePuh

  • Full Member
  • ***
  • Posts: 172
ALSA and external USB Sound Card (UCA222)
« on: September 24, 2010, 08:40:49 PM »
I would like to pass the sound of my notebook digitally (optical) to my hi-fi system.

Now I have the following hardware : UCA222
http://www.behringer.com/EN/Products/UCA222.aspx

The hardware is recognized somehow, but it does not work (no sound) and ALSA plays always on the built-in sound card.

Can someone help me?

Some informations :

dmesg
Code: [Select]
usb 4-1: new full speed USB device using uhci_hcd and address 2
input: Burr-Brown from TI               USB Audio CODEC  as /devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.3/input/input4
generic-usb 0003:08BB:2902.0001: input: USB HID v1.00 Device [Burr-Brown from TI               USB Audio CODEC ] on usb-0000:00:1d.2-1/input3
usbcore: registered new interface driver snd-usb-audio

lsusb
Code: [Select]
Bus 004 Device 002: ID 08bb:2902 Texas Instruments Japan


Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: ALSA and external USB Sound Card (UCA222)
« Reply #1 on: September 25, 2010, 02:09:32 AM »
Do the inputs/outputs show up in alsamixer?

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: ALSA and external USB Sound Card (UCA222)
« Reply #2 on: September 25, 2010, 03:43:48 AM »
Hint:
Code: [Select]
alsamixer -c 0
alsamixer -c 1
to switch between cards.

Also, did you run 'alsaconf' after connecting the USB card?
The '-L' option might be useful.
Code: [Select]
-L|--log file  logging on the specified file (for debugging purpose only)
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

aus9

  • Guest
Re: ALSA and external USB Sound Card (UCA222)
« Reply #3 on: September 25, 2010, 04:19:04 AM »
hi

if you prefer internal not to load.FIRST...you might be better off setting up the internal as index=1 so when you plug in the usb, index=0 is available and is grabbed by the usb device

or if you prefer not to load internal AT all....blacklist its module as per the wiki

Either technique starts the same way with TC 3x series in that you run (with usb device NOT installed)

Code: [Select]
lsmod | grep snd to find out your modules for your internal and add that to your bootloader to blacklist it

b) if you never use internal ....you do no more....and plug in usb and enjoy the benefits

c) otherwise you add some lines to your bootlocal to create index=1 for your internal sound device.

http://wiki.tinycorelinux.com/Setting+up+Sound


2) which alsamixer setting are you referring to you for digital out....spdif ?
« Last Edit: September 25, 2010, 04:28:24 AM by aus9 »

Offline TaoTePuh

  • Full Member
  • ***
  • Posts: 172
Re: ALSA and external USB Sound Card (UCA222)
« Reply #4 on: September 25, 2010, 03:25:04 PM »
Thanks, you guys are great as always!

As expected, it was a hard- and software problem and it sits between my ears ...

After blacklisting all sound modules and loading the UCA222 manually as default (index 0) - I had the sound on the external device (ear phones and optical / spdif).

Meanwhile, I remembered that you can drive the sound devices separately out from mpd :

mpd.conf
Code: [Select]
audio_output {
        type            "alsa"
        name            "My ALSA Device 0"
        device          "hw:0,0"        # optional
...
}

audio_output {
        type            "alsa"
        name            "My ALSA Device 1"
        device          "hw:1,0"        # optional
...
}

Now I have "only" two problems left :

1.) Is it possible to run/configure ALSA in such a way that the sound will always be transmitted on multiple devices at the same time - without consideration of the program (so even if I play a song with vlc or something ...) ?
Currently my ALSA only plays on the default device (index=0).

2.) Currently alsamixer only shows me the mixer controls for PCM, but the device still has a lot more inputs and outputs. I thought I must read and understand the following, but now I am stuck ...
http://www.kernel.org/doc/Documentation/sound/alsa/ALSA-Configuration.txt - paragraph: Module snd-usb-audio
« Last Edit: September 25, 2010, 03:44:24 PM by TaoTePuh »

aus9

  • Guest
Re: ALSA and external USB Sound Card (UCA222)
« Reply #5 on: September 25, 2010, 07:32:41 PM »
hi

1) since you want 2 devices.....you initially blacklist your internal then re-create it to load with index=1, there is no need to force usb onto index=0.........I have failed to explain that bit to you eh?

Pls post the output of your bootlocal and your grub kernel line bootcode for blacklisting

and post in a code box the command pls.
Code: [Select]
lsmod
EDIT we will need the full list to see the usb stuff.

2) since I lack skills in mpd you may consider this link......tinypoodle or others may be able to mod it so you have
udev rules for usb sound device detected
then piping into both outputs at once.....while it appears to only swap at the moment
https://bbs.archlinux.org/viewtopic.php?pid=334988


3) leaping ahead.....I not sure what your sound module for usb is called

count the number of colour connectors......they are your stacks.

you have a spdif........not sure as I asked but maybe we got confused?.....pls specify if that is to be true output pls....so why the need for others?......I repeat.... which alsamixer setting are you referring to you for digital out....spdif ?

4) it might be useful to post a snapshot of your current alsamixer output screen?

5) it appears you may have only this to play with

Code: [Select]
Module snd-usb-audio
  --------------------

    Module for USB audio and USB MIDI devices.

    vid             - Vendor ID for the device (optional)
    pid             - Product ID for the device (optional)
    nrpacks        - Max. number of packets per URB (default: 8)
    async_unlink    - Use async unlink mode (default: yes)
    device_setup    - Device specific magic number (optional)
                    - Influence depends on the device
                    - Default: 0x0000
    ignore_ctl_error - Ignore any USB-controller regarding mixer
                   interface (default: no)

    This module supports multiple devices, autoprobe and hotplugging.

    NB: nrpacks parameter can be modified dynamically via sysfs.
        Don't put the value over 20.  Changing via sysfs has no sanity
    check.
    NB: async_unlink=0 would cause Oops.  It remains just for
        debugging purpose (if any).
    NB: ignore_ctl_error=1 may help when you get an error at accessing
        the mixer element such as URB error -22.  This happens on some
        buggy USB device or the controller.

so I am guessing we could try....in your bootlocal.....optional add index=0 but I think thats unnecessary

/sbin/modprobe  snd-usb-audio  vid=08bb  pid=2902
« Last Edit: September 25, 2010, 08:29:10 PM by aus9 »

aus9

  • Guest
Re: ALSA and external USB Sound Card (UCA222)
« Reply #6 on: September 25, 2010, 08:31:59 PM »
above post has been editted numerous times so pls read again depending on your timezone pls.

aus9

  • Guest
Re: ALSA and external USB Sound Card (UCA222)
« Reply #7 on: September 25, 2010, 08:40:49 PM »
TaoTePuh

forgive me for only just looking at maintainer of mpd and in particular
http://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/3.x/tcz/mpd.tcz.info

Playback Support:
                ALSA support ..................enabled
                FIFO support ..................enabled
                HTTP daemon support ...........enabled
                JACK support ..................enabled
                libao support .................enabled
                OSS support ...................enabled
                OS X support ..................disabled
                Pipeline output support .......disabled
                PulseAudio support ............enabled
                Media MVP support .............enabled
                SHOUTcast support .............enabled
                Solaris /dev/audio support ....disabled


2) Do you have any hate of pulseaudio?

If above replies do not generate a working solution for you.....pulseaudio....running as a sound server should be able to stream outputs to both sound devices?

....I am working on a pulseaudio wiki....but I am not overly fond of it....and have limited experience of it

and IMHO....pa is not what defines Tinycore?

EDIT....a wiki now exists

http://wiki.tinycorelinux.com/pa

3) I assume you know there is a forum of MPD?

http://www.musicpd.org/forum/

regards
« Last Edit: September 26, 2010, 09:04:49 AM by aus9 »

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: ALSA and external USB Sound Card (UCA222)
« Reply #8 on: September 27, 2010, 08:10:27 AM »
Alsamixer is not *that* great.
Try aplay -l and -L to see your alsa cards and outputs

> and IMHO....pa is not what defines Tinycore?

What does this mean?

Offline TaoTePuh

  • Full Member
  • ***
  • Posts: 172
Re: ALSA and external USB Sound Card (UCA222)
« Reply #9 on: September 27, 2010, 01:02:08 PM »
aus9, thank you for your efforts!

These are my current settings:

blacklisted modules in menu.lst
Code: [Select]
blacklist=snd_intel8x0 blacklist=snd_intel8x0m blacklist=snd_usb_audio

I start the devices like this - later I put it into the file boolocal.sh
Code: [Select]
sudo /sbin/modprobe snd_usb_audio ignore_ctl_error vid=0x08bb  pid=0x2902 index=0
sudo /sbin/modprobe snd_intel8x0  index=1
sudo /sbin/modprobe snd_intel8x0m index=2
sudo /sbin/modprobe snd_mixer_oss
sudo /sbin/modprobe snd_seq
sudo /sbin/modprobe snd-pcm-oss
sudo /sbin/modprobe snd_seq_midi_event
sudo /sbin/modprobe snd-seq-oss
sudo /sbin/modprobe snd_page_alloc

sudo /usr/local/etc/init.d/alsasound start

If done like that, I get sound on the UCA222 (ear phones and spdif).

lsmod (after loading the modules)
Code: [Select]
Module                  Size  Used by    Not tainted                                                                                       
snd_seq_dummy            648  0                                                                                                           
snd_seq_oss            15364  0                                                                                                           
snd_seq_midi_event      2624  1 snd_seq_oss                                                                                               
snd_pcm_oss            24484  0                                                                                                           
snd_seq                26036  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event                                                               
snd_mixer_oss           8648  1 snd_pcm_oss                                                                                               
snd_intel8x0m           6884  0                                                                                                           
snd_intel8x0           17724  0                                                                                                           
snd_ac97_codec         66516  2 snd_intel8x0m,snd_intel8x0                                                                                 
ac97_bus                 412  1 snd_ac97_codec                                                                                             
snd_usb_audio          44836  0                                                                                                           
snd_pcm                37628  5 snd_pcm_oss,snd_intel8x0m,snd_intel8x0,snd_ac97_codec,snd_usb_audio                                       
snd_timer              10564  2 snd_seq,snd_pcm                                                                                           
snd_page_alloc          4016  3 snd_intel8x0m,snd_intel8x0,snd_pcm                                                                         
snd_hwdep               3004  1 snd_usb_audio                                                                                             
snd_usb_lib             9104  1 snd_usb_audio                                                                                             
snd_rawmidi            10004  1 snd_usb_lib                                                                                               
snd_seq_device          2808  4 snd_seq_dummy,snd_seq_oss,snd_seq,snd_rawmidi                                                             
snd                    26200 14 snd_seq_oss,snd_pcm_oss,snd_seq,snd_mixer_oss,
                                snd_intel8x0m,snd_intel8x0,snd_ac97_codec,
                                snd_usb_audio,snd_pcm,snd_timer,snd_hwdep,
                                snd_usb_lib,snd_rawmidi,snd_seq_device                                                                             
soundcore               2640  1 snd                                                                                                       
radeon                379556  2                                                                                                           
ttm                    26292  1 radeon                                                                                                     
drm_kms_helper         15480  1 radeon                                                                                                     
drm                    93504  5 radeon,ttm,drm_kms_helper                                                                                 
i2c_algo_bit            2984  1 radeon                                                                                                     
cifs                  161640  8                                                                                                           
dm_mod                 35392  0                                                                                                           
ipw2200               101408  0                                                                                                           
libipw                 16292  1 ipw2200                                                                                                   
cfg80211               73276  2 ipw2200,libipw                                                                                             
lib80211                1984  2 ipw2200,libipw
i2c_i801                5748  0
intel_agp              16252  0
joydev                  5808  0
i2c_core                9380  5 radeon,drm_kms_helper,drm,i2c_algo_bit,i2c_i801
agpgart                15792  3 ttm,drm,intel_agp
squashfs               14728 117
ramzswap               10240  1
loop                    8068 234
pcmcia                 12756  0
scsi_wait_scan           276  0
yenta_socket           13432  1
sdhci_pci               4144  0
8139cp                 10860  0
rsrc_nonstatic          5780  1 yenta_socket
sdhci                  10392  1 sdhci_pci
mmc_core               27968  1 sdhci
8139too                12868  0
pcmcia_core            17332  3 pcmcia,yenta_socket,rsrc_nonstatic
serio_raw               2380  0

Quote
count the number of colour connectors......they are your stacks.

I did not understand. I have 2x cinch in, 2x cinch out, 1x earphone and 1x optical spdif at the UCA222. What do you mean by "stacks"?

Quote
you have a spdif........not sure as I asked but maybe we got confused?.....pls specify if that is to be true output pls....so why the need for others?......

My notebook has no spdif. My notebook only has an earphone output. So I got the UCA222.

Quote
......I repeat.... which alsamixer setting are you referring to you for digital out....spdif ?

I do not know exactly what you mean by "alsamixer setting". If I load the modules as decribed above, I get one controller (PCM) in alsamixer. This controller controls the volume of the earphone output on the UCA222. Unfortunately I have no controller for spdif.

Quote
4) it might be useful to post a snapshot of your current alsamixer output screen?



Quote
2) Do you have any hate of pulseaudio?

No, no hate but no experience. At first I wanted to know if I can do this (multiple outputs at the same time) directly with alsa.

Quote
EDIT....a wiki now exists
http://wiki.tinycorelinux.com/pa

Thanks! I will now try pulseaudio.


aus9

  • Guest
Re: ALSA and external USB Sound Card (UCA222)
« Reply #10 on: September 27, 2010, 06:43:00 PM »
hi

firstly you have one internal device ...yes? and it needs 2 intel modules so your sudo can change to

 
Code: [Select]
sudo /sbin/modprobe snd_usb_audio ignore_ctl_error=1 vid=0x08bb  pid=0x2902 index=0
sudo /sbin/modprobe snd_intel8x0m  index=1

Now either that will enable the other intel module you replace with the other line but if you have only one sound device you can't give the modules different indexs....so you have 0 or 1 not 0 + 1 + 2

The reason I think its snd_intel8x0m....is because your ac97 depends on snd_intel8x0m mentioned first and then the other one

2) pls do not include all the other modprobes....they will load automatically.

try it and report back if any probs

3) Have you tried the line with  ignore_ctl_error=1?

or without any mention?

I don't think it will work with no =0 or 1 against it.

4) hiro.....you are right...............aplay -L and -l are in the setting up sound wiki so TaoTePuh.....check your lsmod to confirm you need less modprobe lines ...........then post the output of the wiki commands for aplay pls

5) colour connectors and spdif .....I am referring to your usb device not your internal device.

Each colour connector has a colour for us simple folk......

Your link did not show those colours but did say it had a spdif ok?

so describe them pls

6) Your goal..............with alsamixer......sorry hiro...........is to show a mixer setting for your spdif

that means I suggest you do not load any intel modules but try a number of permutations for your usb sound module with or without
ignore_ctl_error=1 or ignore_ctl_error=0 or not mentioned until we get that mixer setting pls

good luck
« Last Edit: September 27, 2010, 06:45:08 PM by aus9 »

aus9

  • Guest
Re: ALSA and external USB Sound Card (UCA222)
« Reply #11 on: September 27, 2010, 06:55:32 PM »
there is also the  device_setup that can be added to modprobe but I have no experience as I have no usb devices so not sure if you input a PID or a location reference

aus9

  • Guest
Re: ALSA and external USB Sound Card (UCA222)
« Reply #12 on: September 28, 2010, 05:32:44 AM »
hi

and revisting this parameter

Code: [Select]
ignore_ctl_error - Ignore any USB-controller regarding mixer
                   interface (default: no)

so if you do not have it in your modprobe (manually or bootlocal) the default behaviour is to be no.....buts it contra-positive ....meaning if we used

ignore_ctl_error=1 (meaning yes) or  ignore_ctl_error=yes

then we won't get access to the mixer settings that the usb may be attempting to supply.

so thats not what we want .

therefore leave this parameter not mentioned in your  modprobe command.

sudo /sbin/modprobe snd_usb_audio vid=0x08bb  pid=0x2902

Offline TaoTePuh

  • Full Member
  • ***
  • Posts: 172
Re: ALSA and external USB Sound Card (UCA222)
« Reply #13 on: September 28, 2010, 07:01:18 PM »
Quote
firstly you have one internal device ...yes? and it needs 2 intel modules so your sudo can change to

No, I think there are two devices. One is for the modem "snd_intel8x0m" (m=modem ???).

Quote
2) pls do not include all the other modprobes....they will load automatically.
try it and report back if any probs

You're right, it's possible without. When I have tested 3 days ago, I could not start alsa.

Quote
3) Have you tried the line with  ignore_ctl_error=1?
or without any mention?

I have tested without success.

Quote
5) colour connectors and spdif .....I am referring to your usb device not your internal device.
Each colour connector has a colour for us simple folk......
Your link did not show those colours but did say it had a spdif ok?
so describe them pls

Sorry, but I still do not understand. The Box has 2 white connectors and 2 red connectors. Perhaps the following pictures helps:

http://www.behringer.com/EN/images/lightboxphotos/UCA222_P0A31_Front_XL.jpg
http://www.behringer.com/EN/images/lightboxphotos/UCA222_P0A31_Bottom_XL.jpg

Quote
6) Your goal..............with alsamixer......sorry hiro...........is to show a mixer setting for your spdif
that means I suggest you do not load any intel modules but try a number of permutations for your usb sound module with or without ignore_ctl_error=1 or ignore_ctl_error=0 or not mentioned until we get that mixer setting pls

Yes, I have tested all versions. But I get only one controller (PCM) in alsamixer (see picture above).

----------

I've just tried pulseaudio. Thanks for the wiki article!
« Last Edit: September 28, 2010, 07:08:20 PM by TaoTePuh »

aus9

  • Guest
Re: ALSA and external USB Sound Card (UCA222)
« Reply #14 on: September 29, 2010, 04:45:19 AM »
ahhh I should have looked at the diagram from your first link.

they appear to be rca audio plugs red for right and white for left speakers.

http://www.behringer.com/EN/images/photos/UCA222_fig3_web.png

2) hmmm so we still can't get spdif I wonder if oss will find it?

3) Have you tried wine with the file from behringer?

assuming 32 bit kernel

http://www.behringerdownload.de/_software/BEHRINGER_2902_WIN32_2.8.40.zip

good luck