Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
Hardware

Streaming Multiple Live Channels? 19

Maxwell'sSilverLART asks: "I work for a University's Aviation Department. For several years now, we've run a streaming audio server to rebroadcast air traffic control communications over the web as an educational service to our students. This job had been handled by Winamp + SHOUTcast. We've just added a second channel to the system (we're now rebroadcasting approach control, in addition to the local tower), which means I need to find a way to get a second live audio stream into the system (signal comes from radio receivers tuned to the appropriate frequency), encoded (we're using 8-bit, 22kHz mono MP3, which is more than adequate given the source), and broadcast. Has anybody done this before? Surely I'm not the first to want to encode multiple live streams. How did you do it, and what were the pros/cons? Does anybody know of a good hardware device at a reasonable price (I'd need to sell my boss on two of them)? Ideas are always welcome."

"I thought about setting up a Linux box with two sound cards, but I know that can be problematic, and I was also having trouble finding streaming software that would work with multiple soundcards (LiveIce only seems to support one). I would prefer not to use multiple machines. I was looking for software, and it occurred to me that I might be going about this the wrong way--perhaps a hardware encoder/server would be better. I poked around on the web, and only found one (for $2800--I'll pass). If I do end up using a PC, I want the system to be daemonized, and initialize at startup; I'm sick of having to restart Winamp every time the power cycles. (I inherited this system; I would have done things differently)"

This discussion has been archived. No new comments can be posted.

Streaming Multiple Live Channels?

Comments Filter:
  • Partial Solution (Score:2, Informative)

    by bofkentucky ( 555107 )
    World famous perl hacker Lincoln Stein has apache::mp3 availabile for using apache as your mp3/ogg stream server. Apache is a daemon so now more reboot worries. Now you have to figure out how to feed two audio streams to their respective filehandle(s). Are you wanting two seperate streams or the two channels overlaid into a single stream, if it is the second option a simple 2-1 (Y) cable should be sufficent.
  • Stereo Solution (Score:5, Interesting)

    by Anonymous Coward on Friday January 31, 2003 @08:14PM (#5200643)
    I recommend putting channel one in the left side and the second channel in the right side. Make sure you encode in Stereo (as opposed to joint), and then let the listener pan to get their desired channel. Put on the headphones and you can listen to two conversations as once.
  • A PCI/onboard sound card and a TV tuner card could do the trick, just feed the 2nd audio stream into a VCR and the output to the coax on the back of the TV card, split the L/R channels and you are golden.
    • by Anonymous Coward
      You're really suggesting to use a TV tuner and VCR to replace the functionality of a $10 sound card?

      I've got some property in Wisconsin with a great view of the ocean. I think you'll be very interested.

      Sincerely yours,

      AC

      (Note to mods: Stay away from crack, k? thx.)
      • The poster said that he had problems with running 2 PCI sound cards, I'm not a Kernel/hardware hacker so I have no clue as to if this is actually a problem, but my solution is a assured method of getting a second stream of audio into the PC, if you have a cleaner solution, please speak up.
  • First, the obvious: If you're happy with what you've got, why not multiply it by 2? Toss another similar machine on the network, and operate it just as you have been the first one.

    Of course, this costs money, both short and long term, as boxes aren't free and hardware problems become twice as likely to pop up. But, given your background in ATC, I doubt such juggling would be much burden. ;)

    You could always run two instances of Winamp on the same machine, with the primary difficulty being the ability to instruct each to record from a different card. Winamp is really not built for this sort of work, so it may be trivial, or nearly insurmountable - I've not tried.

    Multiple soundcards are nowhere near as much of a problem with Linux as they are with Windows. Use ALSA as a sound driver, which will merrily provide excellent support for as many cards as you can physically squeeze into the machine. The stock kernel drivers work nearly as well, as does paid-for OSS from 4front. FreeBSD's stock drivers would also suffice nicely, if you want to avoid Linux.

    It doesn't matter that LiveICE doesn't support more than one card - just run two copies of it, each with different configs, one for each stream. The worst-case scenario is that the device names (ie, /dev/dsp) are hard-coded, in which case you can just compile two different LiveICE binaries. You've got the source, and it really is trivial to replace /dev/dsp with a more appropriate identifier.

    IceCast, the server-side component of *NIX MP3 streaming, will gladly support multiple streams out-of-the-box, so that's not an issue.

    Whatever you do, though, go ahead and increase the bit-depth from 8- to 16-bit. Running with 16-bit costs you nothing, and increases dynamic range and overall fidelity. Whether or not it matters given the sort of audio you're encoding is not relevent; everything is going to end up as 16-bit anyway, whether by action of your local MP3 encoder or the player on the other end, irrespective of what it begins as. The MP3 format itself is bit-depth agnostic.

    Good luck.

    • I just looked at IceCast homepage. It sounds like I will have to download and install a bunch of different libraries. Has anyone does this on Redhat 7.1? Does Redhat have precompiled packages available through up2date? How much hassle will this be? Would it be easier to use Redhat 8?

      And what software would I need to record live audio and video so that customers could listen pre-recorded marketing pitches or employees at remote sites could watch company meetings at remote sites either live or pre-recorded. Do I need to use something else for this like Real's Helix project?
      • I guess I don't care enough about karma to avoid being snide:

        Piss off, flagrant manager-type. Go back to your 8.3 ".htm" world and leave me be.

        The original question involved education. I like education. I'm willing to expend a little effort to help people educate others, whatever the field.

        Your question involves money. I like money. I'm willing to expend quite a bit of effort to help people make money, if I'm in on a share of it.

        If you want help with serving sales pitches and intracontinental AV meetings full of hot air, where your only interest is making money, hire someone skilled and knowledgeable to do the work for you. You'll find no aid from me, or quite likely anyone else, for free.

        I care not to line your pockets whilst I wander about trying to figure out how I'm going to eat next week.

        Good day, sir.

        • Won't you please make an exception Adolph? I need to put together a presentation before Monday for some investors in Tokyo. I'll be in the air all day tomorrow and I don't think they have an internet connection even for us first class passengers. And if I don't have the answers before Monday then the IPO for shinymetalobjects.com might not happen. Plus the champagne mimosas they serve always make me so sleepy and there is the jetlag working against me too. So I need it done tonight. Why don't you want me to make any money, are you communist or something? I bet you just don't know the answers. You are probably sitting there in your grease-spotted underpants with your un-American finger up your nose plotting to overthrow our great democracy so you can take my hard earned wealth away and give it to a bunch of undeserving derelicts. You are no friend of mine, Sir, and if you ever have the audacity to show up at my gate I will have security meet you and escort you away before you even get halfway to the main house!

          Respectfully,
          Andrew Kaufman

        • YHBT. HTH. HAND.

          -(()) (geez, wasn't it obvious?)
          • Could've been moreso, I guess. Though the relatively low user number should've given it away immediately, before ever getting so far as the text.

            *shrug*

            At least I felt better having written that. Countercorporate rants are good for the soul.

  • 2 sound cards
    either:
    xmms + Output stacker, both shoutcast servers configured for differnt ports
    or:
    two versions of xmms, using each differnt sound card

  • There's nothing to this. You probably don't need additional hardware. Maybe a sound card. I have a 500 Mhz P3 box simultaneously encoding two video+audio streams full time. One is Windows Media and one is Real. The box is more than enough. You're talking about encoding just audio. One computer should do fine.

    Get & install two soundcards. Connect the outputs of each source into the line in of each.

    Get a copy of Darwin Streaming Server [darwin.org] or Helix Server [helixcommunity.org] or any of the shoutcast MP3 streaming things.

    The benefit to using Darwin or Helix is that they're made to record from live input rather than just streaming files on the drive.

  • Mr. Coward
    Interesting concept, running two mono channels into a single stereo stream, but not quite what I'm looking for here. The two streams are totally independent, and that would be confusing to say the least (at least to most listeners). The listeners have been e-mailing me for two weeks asking my why they can't connect, when I've posted, at the top of the page, in boldface, that the server is temporarily down. Call me an elitist, but if they can't read that, I sincerely doubt they'll pick up on instructions to adjust the balance control. Good thinking, though; I hadn't even considered that sort of solution.

    bofhkentucky:
    Two separate channels, feeding two separate streams; mixing them would be bad. It'd be like trying to listen to two radio stations at the same time. While pilots do tend to step on each others' transmissions (frequently), I'd rather not make it worse.

    adolf:
    Lots of good points in your post; thanks for the good response. To clarify a few things:

    • While it works, I'm not particularly happy with what I have. I can't daemonize WinAmp, and I can't separate it from the display, and I can't control it via Remote Desktop (on 'doze), so I have to start it manually at boot time, and leave the machine logged in (locked, of course); I also have to leave VNC running in case I need to remote-admin it. It works, for very small values of "works."
    • I'm probably going to go to ALSA + two sound cards, but I expect to have trouble. Sound cards and I just don't get along under Linux. I just spent about four hours getting ALSA to (mostly) work under Linux on a different machine, and it's still missing a few things (like OSS emulation; mpg123 doesn't work at all, though the ALSA plugin for XMMS is working great).
    • I'll go ahead and increase the bit-depth; I don't know what I was thinking at the time, I should have known better. The machine had plenty of capability, too. Blarg.

    seann:
    I'm trying to avoid XMMS and other programs that want a display. Daemons are good here. That said, what's Output Stacker? I haven't heard of it, and I've poked around quite a bit.

    Rob (and everybody):
    I have a box that can handle it, if I can get the software working. I looked at Darwin Streaming Server, and it appears to be comparable to SHOUTcast and IceCast. I'm not having trouble finding a server, the problem lies in the source; I can't find a good program to connect the line-in to the streaming server. LiveIce appears to do what I want, but I don't know how it would handle multiple instances on the same machine, being fed by multiple sound cards (adolf: I'll have a look at the .confs/sources). When I said hardware, I was thinking of a dedicated device. The only one I found was the Telos Systems Audioactive [audioactive.com] live MP3 streamer, but at $2800 a copy, it's a bit out of my price range (we don't spend that much on aircraft radios!). I was looking for something that's a dedicated, single-purpose, plug and play device; configure it once, and that's the last I see or hear of it. I'm a lazy admin--the less I have to touch it, the happier I am. I didn't mean to imply that I was looking for special computer hardware, but for a standalone audio device.

    All: thanks for the suggestions. At the moment, it looks like I'm going to stick with Linux + two cards, if I can figure out how to get IceCast working (I've been having a bear of a time getting it to play nice; I honestly believe I'm cursed when Linux and sound are involved). If anybody else has any thoughts, I'd certainly love to hear them.

    • While it works, I'm not particularly happy with what I have. I can't daemonize WinAmp, and I can't separate it from the display, and I can't control it via Remote Desktop (on 'doze), so I have to start it manually at boot time, and leave the machine logged in (locked, of course); I also have to leave VNC running in case I need to remote-admin it. It works, for very small values of "works." I run a small open source project, called Halo 8 WWWinamp, that extends WWWinamp, a mini-http server that allows you to control winamp remotely. It's easily configurable, and with some changes, it can operate 2 separate instances of winamp. It also has the ability to start up winamp if it is not running. More info is abilable at http://projects.halo8.net/ or http://www.sourceforge.net/projects/halo8wwwinamp/ If you can get 2 instances of winamp running on the same computer, it would be possible to set up 2 instances of WWWinamp to run as services (windows has a built in option of running items as a service, wwwinamp does not have this capability [yet?]). If the machine is rebooted, WWWinamp will start as a service, and you can hit a webpage and start winamp remotely. It is possible to run wwwinamp without a window, i do so from work when i forget to turn on wwwinamp. Again, this all hinges off getting 2 instances of winamp to work from 2 different sources. I wouldn't think it's too difficult, but i may be proved wrong.

      • eeew, sorry about that. heh. here's the post as it was meant to be:

        While it works, I'm not particularly happy with what I have. I can't daemonize WinAmp, and I can't separate it from the display, and I can't control it via Remote Desktop (on 'doze), so I have to start it manually at boot time, and leave the machine logged in (locked, of course); I also have to leave VNC running in case I need to remote-admin it. It works, for very small values of "works."

        I run a small open source project, called Halo 8 WWWinamp, that extends WWWinamp, a mini-http server that allows you to control winamp remotely. It's easily configurable, and with some changes, it can operate 2 separate instances of winamp. It also has the ability to start up winamp if it is not running.

        More info is abilable at http://projects.halo8.net/ or http://www.sourceforge.net/projects/halo8wwwinamp/

        If you can get 2 instances of winamp running on the same computer, it would be possible to set up 2 instances of WWWinamp to run as services (windows has a built in option of running items as a service, wwwinamp does not have this capability [yet?]). If the machine is rebooted, WWWinamp will start as a service, and you can hit a webpage and start winamp remotely. It is possible to run wwwinamp without a window, i do so from work when i forget to turn on wwwinamp. Again, this all hinges off getting 2 instances of winamp to work from 2 different sources. I wouldn't think it's too difficult, but i may be proved wrong.

  • I've successfully had two sound cards in my leenoox box before, hooked up to a hardware mixer so I could play with mixing MP3's. Now I've moved to ogg, and don't have the second sound card anymore (it was a $10 ISA thing), but based on my experiences, it's pretty durned easy.

    Basically, just make sure you're using kernel modules for your sound card, and most of the sound card drivers support more than one card (you might need to read the documentation in the kernel source, or do some googling to figure out if any special parameters are needed).

    Then, you have /dev/dsp0, /dev/dsp1, and /dev/mic0, /dev/mic1, and use your normal encoding / streaming / etc methods.

    eg:
    # ln -s /dev/mic0 /dev/tower
    # ln -s /dev/mic1 /dev/ground
    $ oggenc /dev/tower -q0 | shoutcast -p1234 &
    $ oggenc /dev/ground -q0 | shoutcast -p1235 &
    $ watch uptime
    Whee. Easy peasy. The command formats from above are almost certainly wrong, but it should be enough to give you an idea. In the end, though, I would recommend the "stereo, 1 station per ear" method, because that's a lot easier / cheaper than any of the other solutions.

    --Robert
  • This would immediately seem obvious even to you, but the solution you are looking for -- indeed the simplest and cheapest solution is to put two or more sound cards into the machine. All major OS's support multiple sound devices, though some of the drivers out there struggle with two of the same card.

    For instance, the Linux driver for the SB128, Live series, and Audigy series' cards supports multiple devices just fine, but the Windows drivers do not. A lot of the less inexpensive (But not dirt cheap) Windows sound cards will support multiple cards just fine. I have used Aureal, Trident, Turtle Beach cards successfully in multiple configurations. Using SBLive series cards in conjunction with another soundcard often seems to cause weird PCI problems, so I'd recommend avoiding a configuration such as that.

    The other good solution is to use USB audio devices. You can get anywhere between 4 to 8 of them on the same USB bus doing 44.1khz stereo without problems, and 100% of the drivers I have seen can cope with multiple USB audio devices of the same type. You also get the (wonderful) benefit of not having to worry about IRQ or DMA starvation that can be caused by more than 2 internal soundcards. USB audio devices are the solution I use currently.

    Finally, when you get your two or three audio IO sources on your machine, just set your encoder to record from the right device. Audio software that won't let you select your sound card device either in Windows or Linux or MacOS is probably shitty software anyway. There are plenty of different soutcast encoders on many platforms, so if the one you are using now doesn't work for you, then get another one -- one that encodes multiple bitrates from the same source, for instance. You don't have to use winamp to run a shoutcast encoder. Get one that can be automated.

    ~GoRK
  • Why not just build an N-track analog mixer, and mix them in analog, then pipe it into your soundcard? Then you can adjust the gain and equalization on a per-channel basis. Its also more modular: signals know nothing about their mixing, mixing knows nothing about the encoding... down the road you can swap out components and leave the rest of the system as-is.

Don't steal; thou'lt never thus compete successfully in business. Cheat. -- Ambrose Bierce

Working...