Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Simultaneous analog and digital sound out

  1. #1
    Join Date
    Oct 2007
    Beans
    34

    Simultaneous analog and digital sound out

    Hi!
    I have sound working on my Asus P5B-Deluxe with the Intel AD198x chip. My question is if I can have the sound played back on the analog and digital device at the same time (if not playing a movie using passthrough AC3 or something like that - in that case I'm fine with digital only).

    My "aplay -l" looks like this:
    Code:
    **** List of PLAYBACK Hardware Devices ****
    card 0: Intel [HDA Intel], device 0: AD198x Analog [AD198x Analog]
      Subdevices: 0/1
      Subdevice #0: subdevice #0
    card 0: Intel [HDA Intel], device 1: AD198x Digital [AD198x Digital]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    And when in System->Preferences->Sound I can choose either
    • Autodetect
    • AD198x Digital
    • AD198x Analog
    • ALSA
    • OSS
    • PulseAudio

    Autodetect, OSS and PulseAudio all give the same errors:
    audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! gconfaudiosink: Failed to connect stream: Invalid argument
    The AD198x ones outputs sound exactly where one might expect: Receiver (digital) and Headphones (analog) respectively. And if I chose ALSA i get analog sound only.

    What I want is to select ALSA or PulseAudio and get output on both the analog and digital devices. Is this possible?

    Grateful for any help!
    /jlindbergh

  2. #2
    Join Date
    Oct 2007
    Beans
    34

    Re: Simultaneous analog and digital sound out

    I feel it's time to continue this thread.

    I've been doing fine with having my sound settings set to ALSA (not AD198x Analog/Digital) for around a week now. Somehow I got sound in both my headphones and digitally to my receiver, just the way I wanted. Don't ask me how that happened. I've even been playing an occasional video using (s)mplayer with AC3 S/PDIF pass-through. Worked great!

    Today I was listening to music as usual through my receiver, watching a movie (non-passthrough). Everything was ok until I played a video sample that used AC3 passthrough. After closing smplayer and trying to play some music through amarok I could no longer get regular audio to the receiver! I couldn't get audio to the receiver playing a regular (non-passthrough) movie either! I now have sound in my headphones only

    I tried re-opening smplayer, fiddling with enabling-disabling S/PDIF passthrough but no luck. I also tried the old Ctrl-Alt-BkSpace, but no difference. Same result after restarting the whole system..!
    I've went through and experimented with both the gnome volume control and alsamixer settings, but everything seems to be as it was earlier. I also went to System->Preferences->Sound and saw that all comboboxes were set to ALSA. I tried changing to AD198x Digital but I didn't even get a test beep to the receiver! Now when I just tried that again I actually got a beep in the receiver, but I still can't get sound from amarok or smplayer through. Well I can if I play pass-through material, but I'd like to have sound in my livingroom when playing regular music too!

    Long post, but I'm troubled and confused. Can anybody please shed some light on what it is that controls where (ALSA) sound gets output? Right now I feel like there's some kind of midget (or gnome?) in the computer that arbitrarily chooses where it likes to send my sound...

    Please help.

    regards
    /jlindbergh

  3. #3
    Join Date
    Oct 2007
    Beans
    34

    Re: Simultaneous analog and digital sound out

    Is there some way to duplicate my audio using something flashy in ~/.asoundrc
    copy hw:0,0 -> hw:0,1
    Perhaps..?

  4. #4
    Join Date
    Sep 2007
    Location
    Helsinki, Finland
    Beans
    42
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Simultaneous analog and digital sound out

    Hiyah,

    Not an expert on any of this, but I've been struggling with very much similar problems as you.

    First of all, I believe you've run into this bug when playing ac3 content:

    https://bugs.launchpad.net/ubuntu/+s...ver/+bug/25632

    Somehow in certain circumstances (playing ac3 and then trying to play something 'regular' through spdif locks the spdif eternally to passthrough). The bug was reported already years ago, but not fixed yet.


    Anyways I needed simultaneous playback through analog and digital as well and after some hours of asoundrc tweaking and occasional swearing I ended up with this kind of a file:

    Code:
    pcm.!default {
    	type plug
    	slave.pcm ttable
    
    }
    
    pcm.ana {
            type hw
            card 0
            device 0
    }
    
    pcm.digi {
            type hw
            card 0
            device 1
            format S16_LE
            rate 48000
    }
    
    pcm.both {
            type multi
            slaves {
                    a {
                            pcm "digi"
                            channels 2
                    }
                    b {
                            pcm "ana"
                            channels 2
                    }
            }
            bindings {
                    0 {
                            slave a
                            channel 0
                    }
                    1 {
                            slave a
                            channel 1
                    }
                    2 {
                            slave b
                            channel 0
                    }
                    3 {
                            slave b
                            channel 1
                    }
            }
    }
    
    pcm.ttable {
      type route
      slave.pcm "both"
      ttable.0.0 1
      ttable.1.1 1
      ttable.0.2 1
      ttable.1.3 1
    }
    I'm pretty convinced this could be done much more elegantly, but at least it works for me

    Hope this is of some help.

  5. #5
    Join Date
    Sep 2007
    Location
    Helsinki, Finland
    Beans
    42
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Simultaneous analog and digital sound out

    Like I suspected, something simpler can be used to achieve the same effect, namely:

    Code:
    pcm.!default {
    	type plug
    	slave.pcm "copper"
    }
    
    pcm.copper {
    	type copy
    	slave.pcm "hw:0,0"
    	slave.pcm "hw:0,1"
    	slave.pcm "hw:0,0"
    }
    Not sure why I need the third slave.pcm line in the copper part, but I'm suspecting it's got something to do with copying the first slave to the next ones. I'm figuring this out pretty much through trial and error here, as I'm having hard time finding any proper description of these asoundrc types etc.

  6. #6
    Join Date
    Sep 2007
    Location
    Helsinki, Finland
    Beans
    42
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Simultaneous analog and digital sound out

    Dang, this introduces a new problem. Apparently only on program can access this new 'device' at time. So if for example I'm surfing the net and something like youtube is accessing the audio device, I cannot start a music player. Actually I need to close the whole browser before I get sound from Rhythmbox even if the browser isn't playing any sounds at the moment.

    I'm guessing this has something to do with software/hardware mixing. I suppose if you directly play through hw:0,0 or something like that, some hardware mixing takes place. Further on, perhaps something built around dmix might be helpful here, but haven't figured out yet how to make it work.

    Any clues?

  7. #7
    Join Date
    Sep 2007
    Location
    Helsinki, Finland
    Beans
    42
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Simultaneous analog and digital sound out

    From the alsa-wiki:

    A very interesting and potentially extremely useful aspect of this plugin is using it combined with the default plugin name. In theory this means all applications that have native ALSA support will share the sound device. In practice not many applications are able to take advantage of this functionality yet.
    Is this up to date information? At times I get things working nicely, especially when simply testing with aplay on many consoles and so on, but for example starting up rhythmbox changes things so that sound disappears from the digital amp.

    Anyone reading these posts?

  8. #8
    Join Date
    Apr 2008
    Beans
    4,377
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Simultaneous analog and digital sound out

    You should be able to turn on the Digital Output in your sound mixer by clicking on the SPDIF or IEC958 check box. Some sound cards have a analog/digital check box that can disable your analog sound output so watch out for that.

    Anyway, you can look here for more info:

    http://alsa.opensrc.org/index.php/DigitalOut

  9. #9
    Join Date
    Oct 2007
    Beans
    34

    Re: Simultaneous analog and digital sound out

    Quote Originally Posted by Oswald1 View Post
    From the alsa-wiki:



    Is this up to date information? At times I get things working nicely, especially when simply testing with aplay on many consoles and so on, but for example starting up rhythmbox changes things so that sound disappears from the digital amp.

    Anyone reading these posts?
    Yes I'm reading, and I really appreciate you posting here!

    But... to be honest I'm in a period where I feel that my time is better spent on my Windows XP partition where I can do what I want without constantly running into situations where I have to spend hours googling, researching and tweaking to be able to accomplish the same things.

  10. #10
    Join Date
    Apr 2008
    Beans
    4,377
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Simultaneous analog and digital sound out

    OK, bye.

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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