Find the answer to your Linux question:
Results 1 to 5 of 5
Hi, I know it sounds too familiar for many of you. But allow me to explain my self: I googled around and read the following very carefully. But all these ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2011
    Posts
    3

    Question ALSA: properly setup for onboard & USB audio devices


    Hi,
    I know it sounds too familiar for many of you. But allow me to explain my self:
    I googled around and read the following very carefully. But all these guide does not help me resolve my problem.
    dmix - ALSA wiki
    .asoundrc - ALSA wiki
    Gentoo Linux ALSA Guide
    Multiple discussion on Arch Linux.

    All I want to do is: (1)Make USB DAC default output, (2)Make dmix works for default device.


    I tried suggestion in .asoundrc, the USB DAC became the default output ... for 1 stream only. The USB DAC is blocked when it's playing, and 2nd file played will go to onboard device. That's definitely NOT what I want. ( Didn't ALSA wiki promise me that dmix will work as default? lol )

    I tried dmix guide suggestion. But I try very hard. I just could NOT make dmix to fall back to onboard device if USB DAC is not connected.

    May somebody shed some light into this helpless lamb? Please.

  2. #2
    Linux Newbie BoDiddley's Avatar
    Join Date
    Oct 2010
    Location
    Plainfield, New Jersey
    Posts
    137
    Hi, I am Debian - but I have insight regarding ALSA. Did you run "alsactl init", accept the defaults and reboot system after.

    I also continued to have insufficiencies which were rectified by installing "esound"; "esound-clients", and "alsamixergui". (all package names).

  3. #3
    Just Joined!
    Join Date
    Sep 2011
    Posts
    3
    Quote Originally Posted by BoDiddley View Post
    Hi, I am Debian - but I have insight regarding ALSA. Did you run "alsactl init", accept the defaults and reboot system after.

    I also continued to have insufficiencies which were rectified by installing "esound"; "esound-clients", and "alsamixergui". (all package names).
    Thanks for replying.

    Shall I run #alsactl with my USBDAC connected or not?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Newbie BoDiddley's Avatar
    Join Date
    Oct 2010
    Location
    Plainfield, New Jersey
    Posts
    137
    "alsactl init" is to properly initialize your specific system sound driver within Linux. This would be phase one. After that, "esound", and "alsamixergui" is what I used to correct remaining deficiencies.

    Again, this is basic stuff. I always work from the bottom-up. Some people seem to try to work from the top-down. Once you have the basic sound installed properly, then you should sort out the rest. "alsamixergui" has sound levels, by device - which can be enabled or disabled.

  6. #5
    Just Joined!
    Join Date
    Sep 2011
    Posts
    3

    [Solved]

    Hi,
    This is solved after I read over and over and fiddled with mplayer for a long while. I'm replying for "Who happened to look for answer here."
    It turns out that I have to work around between 2 alsa device co-existing at the same time. Better not go windy by removing another device when my USB DAC plugged in.
    So here is my way:

    in .asoundrc

    Code:
    pcm.!default{
            type plug
            slave.pcm "usbdac_dmix"
    }
    
    pcm.usbdac {
               type hw # USB DAC device
               card 2     # check these value by "aplay -l" output!! something like "card 2: Device [USB PnP Sound Device], device 0"
               device 0  # check these value by "aplay -l" output!!
    }
    pcm.onboard {
                type hw
                card 0     # check these value by "aplay -l" output!! card 0: SB [HDA ATI SB], device 0: CONEXANT Analog [CONEXANT Analog]
                device 0  # check these value by "aplay -l" output!!
    }
    pcm.usbdac_dmix {
                    type dmix
                    ipc_key 1026 # must be unique!
                    slave {
                            pcm "usbdac"  
     ## all following in this dmix section should be set according to your hardware. If you're not sure, don't try to add them!
                            period_time 0
                            period_size 1024
                            buffer_size 8192
                            rate 48000  # Fireye 2 support up to 48000Hz, please refer to your hardware spec.
                          }
    }
    pcm.onboard_dmix {
    type dmix
    ipc_key 1025 # must be unique!
    slave {
            pcm "onboard"
     ## all following in this dmix section should be set according to your hardware. If you're not sure, don't try to add them!
            period_time 0
            period_size 1024
            buffer_size 8192
            rate 44100
          }
    }
    This will make 2 dmix output for each devices. Fortunately, mplayer support some advance argument to alsa control.

    Here is my "-ao" argument of mplayer:
    Code:
    alsa:device=plug=usbdac_dmix,alsa:device=plug=onboard_dmix
    you can put them into a line of ~/.mplayer/config like
    Code:
    ao=alsa:device=plug=usbdac_dmix,alsa:device=plug=onboard_dmix
    It now can play by USBDAC by default, and fallback to onboard if it's not available & with dmix working for both.

    Finally, you can tune all the apps to use mplayer to output. (for kde user, try phonon-mplayer)Then the problem is solved.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •