Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 47 12311 ... LastLast
Results 1 to 10 of 467
  1. #1
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    15,332

    Announce: WaveInput for Linux

    Summary
    This plugin enables Linux PC audio to be streamed through SqueezeCenter. Similar functionality to the WaveInput for Windows see http://forums.slimdevices.com/showthread.php?t=35718 ).

    This plugin assumes ALSA is the installed audio subsystem. This plugin will not work with an OSS audio subsystem.

    The plugin is minimal mainly 2 conf file so that an ALSA PCM stream is played through Squeezecenter. Normally the ALSA stream used will be the PC audio out but it can be any ALSA stream so that the stream could be a virtual soundcard (e.g. on a PC with no real audio hardware).

    A typical use of this plugin would to play internet streams which work on PC which cannot be played from SC (e.g. flash audio such as NPR or new BBC).

    Install
    Install by unpacking the attached .tar.gz file into the Plugins directory according to your distro. The new directory in Plugins will be called WaveInput. The most difficult part in getting this plugin to work will probably be the ALSA configuration. Typically the user will use an appropriate mixer application (e.g. amixer, alsamixer, Kmixer, Gnome-alsamixer) to configure the correct stream to be used in playback.

    A good installation will have a new FileType WaveInput under Settings/Advanced/File Types. The WaveInput FileType should have at least the WAV and Flac entries enabled - the mp3 entry will only be enabled if lame is installed. Do not confuse the WaveInput File Type with WAV and Wavpack File Types which are audio formats and are not related to this plugin.

    For SC 7.3 and later - use the Extension Downloader Plugins. Add the following URL to the repostory list in teh Extension Downloader settings
    http://bpaplugins.googlecode.com/svn/trunk/repo.xml


    How to use
    There is no user interface. The ALSA stream is played through the URL wavin:<PCM_STREAM> where <PCM_STREAM> is the ALSA PCM name. Typically this will be "default" (i.e. wavin:default ) but it could be any stream named in ALSA configuration files (e.g. .asoundrc, /etc/asound.conf) The user should create an entry in Favorites or My Radio Stations, the name is arbitrary and the URL will be typically wavin:default.

    Setup Hints
    The default custom-convert.conf file uses arecord (normally supplied as part of ALSA) to copy audio stream to SC. However arecord is not great when converting live streams and drops out can occur when overruns occur (i.e. arecord was too slow processing audio) A second conf file is supplied configured to use ecasound (see http://www.eca.cx/ecasound ) - the configuration supplied is much better than arecord but dropouts can still occur - however there are more ecasound options that can be explored. If you have ecasound installed - just save existing custom-convert.conf file in Plugins/WaveInput and then rename custom-convert.conf.eca to custom-convert.conf. Then restart SC.

    As stated above getting ALSA configured correctly may be the difficult part - you may find it easier to test different setting of the mixer while recording using an application such as Audacity, Krecord as they provide visual feedback rather using SC. Sometimes the problem may not be the correct source but incorrect level settings. The configuration settings of mixer will probably depend on the audio hardware and the associated driver. Some drivers do not support the mix facility and so this plugin will not work with those drivers.
    Last edited by bpa; 2008-12-25 at 12:07. Reason: File Type clarification

  2. #2
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    1,798

    OSS capability for Linux WaveInput plugin

    I've attached a custom-convert.conf file that works with OSS.

    As with ALSA you need to set the line-in levels with a mixer program.

    If your first dsp device is named /dev/dsp and NOT /dev/dsp0, which is usually the case with the OSS drivers, you need to use "wavin:" without the trailing zero for the first input device and "wavin:1" for the second, etc.

    Alternatively you could create a symbolic link from /dev/dsp to /dev/dsp0.

    cd /dev; ln -s dsp dsp0

    If you're using devfsd on a 2.4 kernel add the following lines to devfsd.conf and 'pkill -HUP devfsd' to have the daemon reread the conf file.

    REGISTER ^sound/dsp$ CFUNCTION GLOBAL mksymlink $devname dsp0
    UNREGISTER ^sound/dsp$ CFUNCTION GLOBAL unlink dsp0

    bpa

    I had to add -C to the command lines to have ecasound v2.4.6 exit after stopping the stream or clearing the playlist. I also added -z:xruns to have it exit if buffer over/underruns happen.

    You might want to update custom-convert.conf.eca with these changes.for the alsa users.

    Ralphy

    Updated:

    Apparently the -q option doesn't stop writing to stderr. I've also added -D and a redirect of stderr to /dev/null.

    Additional changes to custom-convert.conf for version 1.0.1
    Last edited by ralphy; 2008-07-19 at 13:50.

  3. #3
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    15,332
    I think there must be different build options or behaviour on different distro. On my system (Suse 10.1) ecasound (2.4.5) terminates with "broken pipe" which happens because SC closes the pipe when playing stops.

    Try running from a shell prompt and you should check to see if ecasound stops with "broken pipe".

  4. #4
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    1,798
    I'm running archlinux 0.7 on a qube 3, kernel version 2.4.36.4, my ecasound has --disable-arts --disable-jack --with-largefile specified on the configure line in the pkgbuild script. I did build the 2.4.6 package myself. I have both alsa and oss installed on this system, so I can load either sound driver for testing. I've been using SC 7.0.2-21032 for testing the plugin.

    When I start SC from an xterm after removing the /dev/null redirect of stderr I get the following messages;

    .....
    found key-value pair: ext-cmd-aac-input = "faad -w -b 1 -f 2 -d %f".
    found key-value pair: ext-cmd-aac-output = "faac -P -o %f -R %s -B %b -C %c -".

    (audioio-raw) Outputting to standard output [rw].

    Pressing pause on the player I get the following but ecasound continues to run;

    (audioio-db-client) WARNING: Overrun in writing to "stdout". Trying to recover.
    (audioio-db-client) WARNING: Overrun in writing to "stdout". Trying to recover.
    Warning: DBC_CHECK failed - "pserver_repp->is_running() != true", audioio-db-client.cpp, 217.
    Warning: DBC_REQUIRE failed - "is_running() != true", audioio-db-server.cpp, 160.
    (audioio-db-client) Serious trouble with the disk-io subsystem! (output)
    (audioio-db-client) WARNING: Overrun in writing to "stdout". Trying to recover.
    (audioio-db-client) Serious trouble with the disk-io subsystem! (output)
    (audioio-db-client) WARNING: Overrun in writing to "stdout". Trying to recover.
    Warning: DBC_CHECK failed - "pserver_repp->is_running() != true", audioio-db-client.cpp, 217.
    Warning: DBC_REQUIRE failed - "is_running() != true", audioio-db-server.cpp, 160.

    Press play and the audio starts up again.

    If I clear the wavin: playlist for the player I get this before ecasound exits.

    (audioio-db-client) Serious trouble with the disk-io subsystem! (output)
    ecasound: Warning! Errors detected during processing.
    (audioio-db-client) There were total 4 xruns.

  5. #5
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    15,332
    You can't expect pausing a live PC audio stream using SC to work indefinitely so at some point you will get overrun. The pipe buffer will determine the current max time (probably a few secs) . Similar things happen if you pause a live internet radio - it generally doesn't work.

    If you want to pause the PC audio output - you need to pause the PC application.

    If you really want to handle it - putting "dd" into the chain between ecasound and SC might help. I think dd may buffer more data better but it is still finite.

  6. #6
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    1,798
    You're right, I don't expect it to pause indefinitely, but I don't get the broken pipe message even after pausing for 60 seconds. I'll investigate some more and post my findings. Either way, thanks bpa for making a Linux version of this great plugin. Hopefully we can add OSS support in a future version.

    Ralphy.

  7. #7
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    15,332
    You'll only get "broken pipe" when you stop playing the stream - this means pressing and holding pause button or clearing the playlist. When a stream is stopped the pipe connected to Flac output is closed and so Flac terminated and then ecasound should terminate also as pipe to Flac is closed.

    Pressing pause button once will only pause the stream and all pipes are kept open. SC just stops reading from the Flac output pipe. There is no flow control and so intermediate buffers fill up and eventually you get overrun.

  8. #8
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    1,798
    That explains it. I'd disabled the flac and lame file types while testing.

  9. #9
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    15,332
    I think I'll post a mod to the plugin which will (optionally) stop rather than pause the stream when the user presses "pause".

  10. #10
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    1,798
    That would be great!

    Haven't had a chance to play with the OSS issues yet, with that change I shouldn't need too.

    Ralphy

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •