From owner-freebsd-multimedia@FreeBSD.ORG Fri Sep 16 11:19:33 2011 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B367106566C for ; Fri, 16 Sep 2011 11:19:33 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from sola.nimnet.asn.au (paqi.nimnet.asn.au [115.70.110.159]) by mx1.freebsd.org (Postfix) with ESMTP id 571E18FC08 for ; Fri, 16 Sep 2011 11:19:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by sola.nimnet.asn.au (8.14.2/8.14.2) with ESMTP id p8GAnLCI090647; Fri, 16 Sep 2011 20:49:22 +1000 (EST) (envelope-from smithi@nimnet.asn.au) Date: Fri, 16 Sep 2011 20:49:21 +1000 (EST) From: Ian Smith To: Victor Sudakov In-Reply-To: <20110916045027.GA95062@admin.sibptus.tomsk.ru> Message-ID: <20110916202532.O37546@sola.nimnet.asn.au> References: <20110912074323.GA81311@admin.sibptus.tomsk.ru> <20110913193919.GQ3098@funkthat.com> <20110916045027.GA95062@admin.sibptus.tomsk.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-multimedia@freebsd.org Subject: Re: /dev/dsp to RTP X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2011 11:19:33 -0000 On Fri, 16 Sep 2011, Victor Sudakov wrote: > John-Mark Gurney wrote: > > > Excuse me for asking in this developers' list, but I have tried > > > freebsd-questions and Google without much success. > > > > > > What software can I use to obtain sound from /dev/dsp and multicast it > > > into the network? I need no sophisticated codecs, HTTP interfaces etc. > > > A plain 8-bit PCM sound that I could listen to with some multicast RTP > > > client like VLC would do. > > > > > > Thanks in advance for any input. > > > > You could look at rat: > > http://mediatools.cs.ucl.ac.uk/nets/mmedia/wiki/RatWiki#RobustAudioToolRAT > > > > It does contain a GUI though. It's be quite a few years since I used > > it though... > > I remember once using mbone/vic, and there were also mbone/vat and > mbone/rat, but the whole mbone directory is now gone from the ports > tree. I cannot find rat in the ports tree any more. > > > > Other possibilities are ffmpeg or vlcserver. > > Multicasting with ffmpeg works fine. The command line > ffmpeg -i file.mp3 -acodec copy -f rtp rtp://239.8.8.8:5000 -re > > does send a multicast stream which can be listened to with VLC (but > not mplayer for some reason) on multiple hosts. Thanks guys, that's good to know. Now that's sorted out .. > Now I need to figure out how to stream live sound from /dev/dsp. All > my attemps to record sound from a USB audio interface, as simple as > > ffmpeg -f oss -i /dev/dsp1 out.wav > > have resulted so far in a severely distorted growl instead of normal > voice. Do you know how to figure out the sampling rate and other > parameters of the sound card? "cat /dev/sndstat" does not output > anything really useful. > > The audio interface is not to blame because I use it all the time with > linphone for SIP calls. Sounds like a job for sox(1). We've used it for various jobs including data logging for a radio station. Possible examples from scripts: nice -15 sox -t ossdsp -c 2 -w -s -r 44100 /dev/dsp -t wav - | \ nice -15 lame -r -s 44.1 -h -b 32 $1 $2 $3 $4 - "$nowFile" sox -t ossdsp -c $dspchan -w -s -r $dsprate /dev/dsp \ -t raw -c $dspchan -w -s -r $dsprate - \ | tee $pipe0 > $pipe1 & Garbled sound from reversed bytes is usually cured with -x switch. sox is pretty small and light on resources in my experience. jack is another possibility. We're using it on a debian box to split pre-transmitter audio to a) a logging task and b) a shoutcast stream (both via lame, at different bitrates) but I've not used it on FreeBSD, where building it appears to depend on X; on debian it's fine headless. On debian it uses ALSA but I expect the FreeBSD one will work with OSS. cheers, Ian