Sound cards, multiple access, device busy

View: New views
5 Messages — Rating Filter:   Alert me  

Sound cards, multiple access, device busy

by telmnstr :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello all,

I'm trying to run a mp3 encoding application (darkice) against /dev/sound.

On freebsd, I was able to run two copies of the application against the
single /dev/dsp device. It's reading the input, both were able to read
concurrently.

On NetBSD, after one copy of darkice opens the sound device it becomes
busy.

I notice only one system utility can open the device at a time (strings
/dev/audio > /tmp/crap.txt&, do it again, device is busy).

Any way to get around this?

Re: Sound cards, multiple access, device busy

by Aaron J. Grier-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Jul 09, 2009 at 11:39:07AM -0400, telmnstr@... wrote:
> On freebsd, I was able to run two copies of the application against
> the single /dev/dsp device. It's reading the input, both were able to
> read concurrently.

freebsd has a kernel-level audio mixer.
 
> On NetBSD, after one copy of darkice opens the sound device it becomes
> busy.

netbsd is single-access.

> I notice only one system utility can open the device at a time (strings
> /dev/audio > /tmp/crap.txt&, do it again, device is busy).
>
> Any way to get around this?

install a userspace sound server like audio/pulseaudio from pkgsrc?

--
  Aaron J. Grier | "Not your ordinary poofy goof." | agrier@...

Re: Sound cards, multiple access, device busy

by telmnstr :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> freebsd has a kernel-level audio mixer.

Ah, okay.

> netbsd is single-access.

Gotcha. I was surprised it worked in FBSD. But I've hit other issues,
after long run times both OSes seem to fill swap. Haven't had a chance to
do more testing to figure out what's causing it.

> install a userspace sound server like audio/pulseaudio from pkgsrc?

I'm headed that way. Lots of deps (x11 stuff) as most likely it comes
packaged with a gui tool. No biggie. Thanks for the heads up. I looked at
it and it looks like what I need, jack doesn't suit this application.

Thanks again.



Re: Sound cards, multiple access, device busy

by Chuck Swiger-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi--

On Jul 16, 2009, at 12:54 PM, telmnstr@... wrote:
>> netbsd is single-access.
>
> Gotcha. I was surprised it worked in FBSD. But I've hit other  
> issues, after long run times both OSes seem to fill swap. Haven't  
> had a chance to do more testing to figure out what's causing it.

If something is leaking memory, that should be obvious from something  
like "top -o size"....

Regards,
--
-Chuck


Re: Sound cards, multiple access, device busy

by telmnstr :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> If something is leaking memory, that should be obvious from something like
> "top -o size"....
> Regards,

On the FreeBSD side it appeared to just crash after around 6 hours of use,
saying to increase one of the kernel parameters. Physical disk swap was 0
(logged by bsdsar) and memory was fine.

On NetBSD, it seemed to actually fill the disk. I kicked it off again (7
copies of darkice, not 14, one each per sound card) and after around 1
hour all copies had not increased in memory size at all since they first
launched, physical swap usage was at 0.

I need to see if I can catch it when it starts expanding but before it
falls over.