LynxTWO presented as multiple stereo devices

OSS specific Linux discussion (x86/amd64)

Moderators: hannu, dev, cesium, kodachi

LynxTWO presented as multiple stereo devices

Postby wingfeather » Sun Apr 04, 2010 5:26 pm

Hi all,

I'm trying to write an application using Portaudio under Linux/amd64 for my Lynx TWO-B card. I want to stream stereo data in, process it, and stream 8 channels of data out. The design of Portaudio means it is by far the simplest if you are reading/writing data to and from a single device.

However, OSS presents the Lynx card as 8 stereo input devices, 8 stereo output devices, and an additional "7.1 channel" output device. This means it does not present a single device that will do what I need.

I guess what I'm really looking for is something resembling the Lynx ASIO driver in Windows, where you are presented with a single monolithic device controlling all of the hardware channels. Is there a way to configure OSS to behave this way, or, have I missed something silly?

Thanks in advance,
Matt
wingfeather
 
Posts: 6
Joined: Sun Sep 20, 2009 2:45 am

Re: LynxTWO presented as multiple stereo devices

Postby cesium » Sun Apr 04, 2010 6:35 pm

I'm not sure I understand you - does "out" means input to another program (recording), or output to speakers (playback)? In both cases you can use vmix for software mixing so the eight clients can use a single /dev/oss/... device. vmix can be attached to a device using the vmixctl utility. I don't think quality in the input case would be reduced by using vmix, but hardware mixing would benefit the output case.

I asked about having a single device on the oss-devel mailing list a while back. Per hannu OSS presents the devices separately because they can be configured with separate settings in the mixer. That's too restrictive IMHO... Changing that would require changing the driver though, and it's the only closed source one. So we'll have to ask 4front or someone that has the source, if you want to change that...
cesium
 
Posts: 903
Joined: Sun Aug 12, 2007 12:51 am

Re: LynxTWO presented as multiple stereo devices

Postby wingfeather » Sun Apr 04, 2010 8:26 pm

Hi Cesium.

I use my TWO-B for hi-fi purposes, and my application is to do realtime loudspeaker crossover processing. So I'm looking to take in a digital stereo pair as input, perform the filtering, and then send the data to multiple (nominally 6. but ideally more) outputs. Processing will be in integer format, so what I'm looking for is the ability to just copy the sample data from the digital input to my application, and then from my application to the analogue outputs. I don't want any numerical alteration in the driver - and there should not need to be any from a logistical point of view. I have achieved this previously with Portaudio using ASIO under Windows, so I know that Portaudio does not alter the data you give it.

The idea of using a vmix device is very interesting - can you elaborate? I'm totally unsure how to control this from the command line, and I'm finding the OSS user manual to be indecipherable (am I alone in this?). Is there a webpage which explains exactly how to configure vmix and what it's capable of?

Thanks!
Matt
wingfeather
 
Posts: 6
Joined: Sun Sep 20, 2009 2:45 am

Re: LynxTWO presented as multiple stereo devices

Postby cesium » Mon Apr 05, 2010 2:11 am

I can think of three options (maybe I'm missing something though):

1) Open all the separate device nodes and provide a stream to each one. This is more complex programatically but doable. See ossinfo source for how to get the node names.
2) Modify the driver. A problem here since this is the only closed source driver... 4Front may do this if you ask them, or maybe provide you with source under NDA. I know it allowed some other people to see/modify the source (e.g. summers 's post in the announcement forum).
3) Using vmix for software mixing.

vmix is a layer in OSS with several roles: software mixing (like dmix in ALSA), SRC conversion, and binding between output and input (for duplex and convenience purposes. Note that output and input don't have to be same device). It needs to be bound to a device node to work. Most drivers do this automatically, but some drivers for high end device do not (like lynxtwo). In these cases (or when the default is bad for some reason), the "vmixctl" utility can be used to attach vmix. See "vmixctl" manpage (via "man vmixctl" command), and here. The proper command is probably something like: "vmixctl attach /dev/oss/lynxtwo/pcm0 /dev/oss/lynxtwo/pcmin0".

Using vmix will create fake software "engines" (i.e. outputs) under the specified output device (you can see them in 'ossinfo -v2' output) which can be used for mixing purposes (each outputting program occupies an output engine), but they're possibly of inferior quality to the soundcard's hw mixing. In any event, it is certain you want to avoid the SRC conversion (usually decent, but unnecessary here, so can only lead to quality loss). To be sure no SRC is done, either set "vmix0-src" to OFF in the mixer (via ossmix or ossxmix), or use SNDCTL_DSP_COOKEDMODE or open the device in O_EXCL mode (however, this overrides vmix mixing too).
cesium
 
Posts: 903
Joined: Sun Aug 12, 2007 12:51 am

Re: LynxTWO presented as multiple stereo devices

Postby wingfeather » Mon Apr 05, 2010 7:06 pm

Hi cesium,

Thanks for the info. I'm going to investigate your Option 1 to begin with, as that appears to be the only way to get bit-accurate behaviour. Provided that Portaudio plays nice, it shouldn't be tooooo complicated for my application.

I've also sent a PM to summers to see how feasible it is to modify the source code. With luck this might be a relatively simple mod - no idea, though!

Ta :)
wingfeather
 
Posts: 6
Joined: Sun Sep 20, 2009 2:45 am

Re: LynxTWO presented as multiple stereo devices

Postby anna23 » Wed Aug 31, 2011 10:57 am

Good luck, inform us of the results :wink: I Flight Systems
anna23
 
Posts: 1
Joined: Wed Aug 31, 2011 10:55 am


Return to Linux

Who is online

Users browsing this forum: Yahoo [Bot] and 9 guests