Topic: Working .asoundrc for RME 9632

After some experiments and reading a lot of documentation I have a working LINUX ALSA .asoundrc for the RME Hammerfall DSP 9632. It allows to simultaneously playback several sounds,  to simultaneously record from several channels and to do a simultaneous capture and playback. Since I didn't find a .asoundrc which provides these functionality anywhere, I thought it could be could helpful to publish it here.

If you have any idea to improve it in these aspects
- number of offered channels for recording in audacity goes up to 128
- it's not possible to adjust the recording gain in audacity
- any feature I have overlooked
please contact me or write a comment to this post.

(Linux kernel 2.6.35.7, ALSA 1.0.23, 9632 Firmware 152, my own distribution)

Kind regards!

#
# RME 9632
#

# aplay   -D plughw:DSP         -> "Out 1" & "Out 2"
# aplay   -D RME-0506           -> "Out 5" & "Out 6"
# aplay   -D RME-1112           -> "Out 11" & "Out 12"
# arecord -D RME-0910           <- "In   9" & "In 10" (SPDIF)

# If you only have one sound for playback at a time, it works this simple way

# pcm_slave.rme0-44 {
#     pcm {
#         type hw
#         card "DSP" # <card #> or string from /proc/asound/cards
#     }
#     format "S32_LE" # default nearest
#     rate 44100      # default nearest or "unchanged"
#     channels 12     # default nearest or "unchanged"
# }
#
# pcm.RME-pb0102 { # playback to "Out 1" & "Out 2"
#     type plug
#     slave rme0-44
#     ttable.0.0 1
#     ttable.1.1 1
# }
#
# pcm.RME-pb0304 { # playback to "Out 3" & "Out 4"
#     type plug
#     slave rme0-44
#     ttable.0.2 1
#     ttable.1.3 1
# }
#
# ...
#

# But for simultaneous playback of serveral sounds it gets more complicated.
# You have to use the 'dmix' plugin for playback and the 'dsnoop' plugin
# for capturing.

# playback pcm definition
pcm.RMEpb {
    type dmix
    slave {
         pcm {
             type hw
             card "DSP" # <card #> or string from /proc/asound/cards
         }
         format "S32_LE" # default nearest
         rate 44100      # default nearest or "unchanged"
         channels 12     # default nearest or "unchanged", required for RME9632
         buffer_size 2048
         period_size 1024
    }
    ipc_key 16258
    ipc_key_add_uid TRUE
    ipc_gid {
        @func refer
        name defaults.pcm.ipc_gid
    }
    ipc_perm {
        @func refer
        name defaults.pcm.ipc_perm
    }
}

# capture pcm definition
pcm.RMEcap {
    type dsnoop
    slave {
         pcm {
             type hw
             card "DSP" # <card #> or string from /proc/asound/cards
         }
         format "S32_LE" # default nearest
         rate 44100      # default nearest or "unchanged"
         channels 12     # default nearest or "unchanged", required for RME9632
         buffer_size 2048
         period_size 1024
    }
    ipc_key 16260
    ipc_key_add_uid TRUE
    ipc_gid {
        @func refer
        name defaults.pcm.ipc_gid
    }
    ipc_perm {
        @func refer
        name defaults.pcm.ipc_perm
    }
}

# And for simultaneous playback and recording, the 'asym' plugin is used
pcm.RMEasym {
    type asym
    playback.pcm "RMEpb"
    capture.pcm "RMEcap"
}

# one definition for each stereo channel
pcm.RME-0102 {
    type plug
    slave.pcm "RMEasym"
    ttable.0.0 1
    ttable.1.1 1
}

pcm.RME-0304 {
    type plug
    slave.pcm "RMEasym"
    ttable.0.2 1
    ttable.1.3 1
}

pcm.RME-0506 {
    type plug
    slave.pcm "RMEasym"
    ttable.0.4 1
    ttable.1.5 1
}

pcm.RME-0708 {
    type plug
    slave.pcm "RMEasym"
    ttable.0.6 1
    ttable.1.7 1
}

pcm.RME-0910 {
    type plug
    slave.pcm "RMEasym"
    ttable.0.8 1
    ttable.1.9 1
}

pcm.RME-1112 {
    type plug
    slave.pcm "RMEasym"
    ttable.0.10 1
    ttable.1.11 1
}

Re: Working .asoundrc for RME 9632

Hello,

I'm trying to get more then 1 app working simultaneously under Maverick 10.10...Your help would be precious, thank you in advance.

http://www.rme-audio.de/forum/viewtopic.php?id=10595

Re: Working .asoundrc for RME 9632

Dear faucon50,

more than one app is working:

aplay -D RME-0102 <file1.wav> &
aplay -D RME-0506 <file2.wav> &

plays two files on 2 different channel pairs. But I didn't find a way to make it work together with a browser (firefox in my case).

If you find a way to tell the browser that it should use (lock) only 2 channels than the card totally, I would be interested in it.

Cheers,

rme9632

Re: Working .asoundrc for RME 9632

Hello,

try setting

"pcm.!default
{
    type plug
    slave.pcm RME-0102
}
"

this should overwrite the default device and firefox should use this (if it uses alsa)

Re: Working .asoundrc for RME 9632

Dear djselbeck,

thanks, that works. Do you know a way to specify the device/channels without changing .asoundrc, e.g. by specifying it on the command line like th -D option to aplay or an environment variable?

Cheers,

rme9632

6 (edited by faucon50 2011-03-21 16:55:20)

Re: Working .asoundrc for RME 9632

Hello Everybody,

Thank you for you answers, I'm gona try immediatly and see...

@ RME 9632: This is exactly what I woul'd like to do, playing simultaneously from the player and from the browser (chromium). HeadScratch

@ djselbeck: The only things, is to put your setting in a .asoundrc, right? I'have tried with your .asoundrc but if the player (deadbeef) is playing and I try to play something from youtube the answer is:

ALSA lib pcm.c:2208:(snd_pcm_open_noupdate) Unknown PCM RME-0102

For information, I use alsa and have removed pulse completely...When I try to change some setting in gstreamer-properties I got this when the player is on:

gst_alsasink_open (): /GstPipeline:pipeline0/GstAlsaSink:alsasink1:
Playback open error on device 'default': No such file]

But when the player is off I got this in gstramer when I try the sound test with the Hammerfall as device:

Error running pipeline 'ALSA — Advanced Linux Sound Architecture': Could not negotiate format [gstbasesrc.c(2755): gst_base_src_start (): /GstPipeline:pipeline0/GstAudioTestSrc:audiotestsrc2:
Check your filtered caps, if any]

In gstreamer I have the Hammerfall as device when the player is not started but default when the player is started, it's still play sound under default...I'm realy confused! :roll

Re: Working .asoundrc for RME 9632

Hello,

I took your .asoundrc as it is RME9632 and I don't have the errors of dmix anymore but where to put the djselbecks setting exactly? Thank you.

Re: Working .asoundrc for RME 9632

It should also be in the asoundrc. Try the bottom of the .asoundrc

Re: Working .asoundrc for RME 9632

Thank you but I got again the alsa error:  "ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave" and no sound and without there are no errors and no sound! I don't know what's wrong?

Re: Working .asoundrc for RME 9632

I think deadbeef isn't using the dmix output device and so blocks the whole hammerfall PCM device. Are you sure it's using the dmix?

11 (edited by faucon50 2011-03-22 09:59:55)

Re: Working .asoundrc for RME 9632

Thank you for your efforts djselbeck. That's a good questions if deadbeef uses dmix or not, the only thing that I know is that the player output whas set on PCM hammerfall (server_start) but I have tried to switch to default device (selected output plugin: ALSA output plugin) and I get sound to! I'm gona try with the default device selected and let you know. I'm shure that both sound (the browser and deadbeef) but I have to quit the player to let the browser play. Let try DeadHorse

I have tried but without success, more I try more I get confused about all that stuff...gstreamer-alsa-player-browser...who is doing what, inputs-outputs where through how and so on...I can be happy that even a sound is coming out of that nuclear musik station...And I even don't think about recording, I would directly die from a heart attack :-O

Re: Working .asoundrc for RME 9632

So, I'm a bit further in my experiments...I'm now able to play from the browser without closing deadbeef, I found in preferences>plugins>alsa plugin>configuration set "live device when stop", so the player doens't stop any access to alsa. Chromium as I understand, uses the default device to sound. So I put djselbeck setting in .asoundrc and tried again without success. But if I put the setting in asoundrc and live the session and back, the default device is not anymore DSP but the hdmi graphical device wich is not connected at all. Then logicaly the player and the browser won't play because of "device default, no such file" in xsession.errors.

I even so here: https://bbs.archlinux.org/viewtopic.php?pid=716538 that Chromium use oss.!? I'm probably not far but I don't know what to do further...any help is welcomed.

Re: Working .asoundrc for RME 9632

Ok FINALLY I got it working

I can now play simultaneously: Flash player through Chromium, vlc (radio stream) and Deadbeef on the output 01-02!!! This is the .asoundrc file that I found here http://ubuntuforums.org/archive/index.p … 59022.html and looks like that:

pcm.!default {
type asym
playback.pcm {
type plug
slave.pcm {
type dmix
ipc_key 5678292
ipc_gid {
@func refer
name defaults.pcm.ipc_gid
}
ipc_perm {
@func refer
name defaults.pcm.ipc_perm
}
slave {
pcm {
type hw
card "DSP"
}
format "S32_LE"
rate 48000
channels 12
buffer_size 2048
period_size 1024
}
}
}
capture.pcm {
type plug
slave.pcm {
type dsnoop
ipc_key 5678291
ipc_gid {
@func refer
name defaults.pcm.ipc_gid
}
ipc_perm {
@func refer
name defaults.pcm.ipc_perm
}
slave {
pcm {
type hw
card "DSP"
}
format "S32_LE"
rate 48000
channels 12
buffer_size 2048
period_size 1024
}
}
}
}

The only things that should be done in the players (deadbeef, vlc) is to use default device and alsa output. I hope it will help if the .asoundrc from #1 doesn't work like it whas the case by me, for an unknown reason!

Cheers :-D

Re: Working .asoundrc for RME 9632

Hello everyboby,

@ RME9632, could you please tell me where did you put this section exactly:

pcm.!default
{
    type plug
    slave.pcm RME-0102
}

I have compiled alsa 1.0.24 on ubuntu 10.10 and your .asoundrc works so well that it dicrased the CPU % usage by playing with vlc or deadbeef but if I put this section at the end or begin and start to play a file, hdspmixer is like overloaded on all channels together and satureded!

Can you by adding this section play per ex: vlc deadbeef or flash together? Now with your .asoundrc (without the section default) I can't...

Thank you for the help.