Home of the Squeezebox™ & Transporter® network music players.
Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 36

Thread: Alexa to LMS

  1. #21
    Senior Member
    Join Date
    Feb 2011
    Location
    Cheshire, UK
    Posts
    3,797
    Quote Originally Posted by bc-nero View Post
    Hi!

    Sorry, my mistake ... (google translate)

    wrong: I do not have a RP2 in the living room with the same USB sound card as the home server.
    right: I do have a RP3 in the living room with the same USB sound card as the home server.



    ==> here is a lag of 10 seconds and the sound was very bad (first try with one DAC)



    ==> does not work in my case, I get many error messages and I can not find the solution


    The pcp-streamer method does have a 10 second or so lag and I have found that the sound stutters a bit for a minute or so before it settles down. It will only accept one connection.

    The Raspbian, Liquidsoap, Icecast2 method on the other hand has no stutter and less of a lag circa 3-4 seconds and will accept multiple connections. It is more fiddly to set up but I believe a better solution if you want something remote from the LMS server.
    VB2.4 storage QNAP TS419p (NFS)
    Living Room - Joggler & SB3 -> Onkyo TS606 -> Celestion F20s
    Office - Pi3+Sreen -> Sony TAFE320 -> Celestion F10s / Pi2+DAC & SB3 -> Onkyo CRN755 -> Wharfedale Modus Cubes
    Dining Room -> SB Boom
    Kitchen -> UE Radio (upgraded to SB Radio)
    Bedroom (Bedside) - Pi2+DAC ->ToppingTP21 ->AKG Headphones
    Bedroom (TV) - SB Touch ->Sherwood AVR ->Mordaunt Short M10s
    Everything controlled by iPeng

  2. #22
    Junior Member
    Join Date
    Jul 2019
    Posts
    15
    Hi!

    @d6jg

    Quote Originally Posted by d6jg View Post
    The pcp-streamer method does have a 10 second or so lag and I have found that the sound stutters a bit for a minute or so before it settles down. It will only accept one connection.

    The Raspbian, Liquidsoap, Icecast2 method on the other hand has no stutter and less of a lag circa 3-4 seconds and will accept multiple connections. It is more fiddly to set up but I believe a better solution if you want something remote from the LMS server.
    Sorry, this one will not work: Raspbian, Liquidsoap, Icecast2

    Errors:
    1) can not install "liquidsoap-plugin-all" -> not in repository, should be inside "liquidsoap"
    2)

    Code:
    #!/usr/bin/liquidsoap
    
    # set the path and permissions for the logfile
    set(“log.file.path”,”/var/log/liquidsoap/phono.log”)
    set(“log.file.perms”,777)
    set(“log.unix_timestamps”,true)
    #input from soundcard
    phono = input.alsa(bufferize=true,fallible=false,device=”hw:1″)
    #stream it to local icecast, default port and password
    output.icecast(%ogg(%flac(samplerate=44100,channels=2,compression=5,bits_per_sample=16)), mount=”/phono”, name=”Phono”, format=”audio/ogg”, description=”Turntable FLAC”, url=”http://192.168.168.21#8221;, genre = “Misc”, phono)
    => first error: Line 3, char 6: Empty token!
    => after disable logs: Line 9, char 98: Empty token!

    @bpa

    this one is working great: "alsa_input.pci-0000_00_1b.0.analog-stereo"

    best regards Thomas

  3. #23
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    17,334
    Quote Originally Posted by bc-nero View Post
    @bpa

    this one is working great: "alsa_input.pci-0000_00_1b.0.analog-stereo"
    I assume this means you were able to record audio into a file and play it back OK.

    Now to modify LMS to use parec (which is PulaseAudio record) instead of the default arecord (which is ALSA record)

    1. Locate the Wavinput plugin - it will be installed in a Cache directory ending with the following. Cache/InstalledPlugins/Plugins/WaveInput . You can find location of the Cache folder/directory from the WebUI Settings/Info page
    2. Stop LMS
    3. Backup the custom-convert.conf file in the Plugins/WaveInput directory
    4. Edit the custom-convert.conf file to look like the following - make sure you use a tab not spaces before the "[parec]" and "# R"
    Code:
    #
    # wavin 
    #
    wavin pcm * * 
    	# R
    	[parec] --file-format=raw --format=s16le --rate=44100 --channels=2 -d $FILE$
    wavin mp3 * *
    	# RB:{BITRATE=-B %B}
    	[parec] --file-format=wav --format=s16le -d $FILE$ | [lame] --silent -q $QUALITY$ -v $BITRATE$ - -
    wavin flc * * 
    	# R
    	[parec] --file-format=wav --format=s16le -d $FILE$ | [flac] -cs --totally-silent --compression-level-0 -
    5. Save the changes and make sure the owner and group of custom-convert.conf is the same as all other files in the WaveInput directory
    6. Now you need to make sure the userid which runs LMS has permission to use PulseAudio and access Audio hardware. This is done by adding the userid which runs LMS (usually squeezeboxserver but check) to the groups pulse, pulse-access and audio. The following command should work
    Code:
    sudo usermod -aG audio squeezeboxserver
    sudo usermod -aG pulse squeezeboxserver
    sudo usermod -aG pulse-access squeezeboxserver
    7. Start LMS and check that WaveInput is installed OK (i.e. WebUI Setting/Advanced/FileTypes and look at WaveInput entries - should all be valid and have parec)
    8. Create a Favorite in LMS for the input device (i.e. in the URL box put wavin:alsa_input.pci-0000_00_1b.0.analog-stereo )
    9. Apply test music to Line-in and test new Favorite

  4. #24
    Junior Member
    Join Date
    Jul 2019
    Posts
    15
    Thanks, but unfortunately it still does not work ...

    I did everything as written, Waveinput also shows:

    Wave input
    FLAC = parec / flac
    MP3 = parec / lame
    PCM = parec

    But if I start the favorite with "wavin: alsa_input.pci-0000_00_1b.0.analog-stereo", then it starts for 1-3 seconds and then stops again, without even having played one sound ...

    Another idea?

    Thanks Thomas

  5. #25
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    17,334
    Quote Originally Posted by bc-nero View Post
    But if I start the favorite with "wavin: alsa_input.pci-0000_00_1b.0.analog-stereo", then it starts for 1-3 seconds and then stops again, without even having played one sound ...
    The clock is started when you press play - it means nothing specific - just a timer.

    Timer running for 3-10 secs and stops usually means parec or lame or flac have failed or device name is wrong or that permissions weren't set.

    Sometime permission changes need a system reboot to take effect.

    To check parec etc. - enable logging player.source to INFO and try to play the Favorite. After timer has stopped look at server.log file and copy the lines the look like the following to a post. - your output may indicate the cause

    Code:
    [19-07-13 07:41:09.7911] Slim::Player::TranscodingHelper::getConvertCommand2 (443) Error: Didn't find any command matches for type: wavin
    [19-07-13 07:41:09.7913] Slim::Player::Song::open (388) seek=false time=0 canSeek=0SEEK_ERROR_REMOTE
    [19-07-13 07:41:09.7917] Slim::Player::TranscodingHelper::getConvertCommand2 (446) Matched: wavin->flc via: [parec] --file-format=wav --format=s16le -d $FILE$ | [flac] -cs --totally-silent --compression-level-0 -
    [19-07-13 07:41:09.7919] Slim::Player::Song::open (409) Transcoder: streamMode=R, streamformat=flc
    [19-07-13 07:41:09.7921] Slim::Player::Song::open (462) Opening stream (no direct streaming) using Plugins::WaveInput::WAVIN [wavin:alsa_input.pci-0000_00_1b.0.analog-stereo]
    [19-07-13 07:41:09.7926] Slim::Player::TranscodingHelper::tokenizeConvertCommand2 (617) Using command for conversion: "/usr/bin/parec" --file-format=wav --format=s16le -d "alsa_input.pci-0000_00_1b.0.analog-stereo" | "/mnt/hddrive/home/ubuntu14.04/repos/7.9/latest/trunk/Bin/x86_64-linux/flac" -cs --totally-silent --compression-level-0 -
    [19-07-13 07:41:09.8000] Slim::Player::Song::open (483) URL is a song (audio): wavin:alsa_input.pci-0000_00_1b.0.analog-stereo, type=flc
    [19-07-13 07:41:09.8009] Slim::Player::StreamingController::_Stream (1283) 00:04:20:16:07:0e: stream
    [19-07-13 07:41:09.8017] Slim::Player::StreamingController::_Stream (1320) Song queue is now 0
    [19-07-13 07:41:09.8020] Slim::Player::StreamingController::_setPlayingState (2378) new playing state BUFFERING
    [19-07-13 07:41:09.8021] Slim::Player::StreamingController::_setStreamingState (2387) new streaming state STREAMING
    Failed to open audio file.
    [19-07-13 07:41:09.8175] Slim::Player::Source::_readNextChunk (373) end of file or error on socket, song pos: 0
    [19-07-13 07:41:09.8177] Slim::Player::Source::_readNextChunk (378) 00:04:20:16:07:0e mark end of stream
    [19-07-13 07:41:09.8178] Slim::Player::Source::_readNextChunk (386) Didn't stream any bytes for this song; mark it as failed
    [19-07-13 07:41:09.8179] Slim::Player::StreamingController::playerStreamingFailed (2249) 00:04:20:16:07:0e
    [19-07-13 07:41:09.8180] Slim::Player::StreamingController::_playersMessage (797) Problem: Can't open file for:: wavin:alsa_input.pci-0000_00_1b.0.analog-stereo
    [19-07-13 07:41:09.8183] Slim::Player::StreamingController::_Stop (611) Song queue is now 0
    [19-07-13 07:41:09.8185] Slim::Player::StreamingController::_setPlayingState (2378) new playing state STOPPED

  6. #26
    Junior Member
    Join Date
    Jul 2019
    Posts
    15
    Hi!

    Code:
    alsa_input.pci-0000_00_1b.0.analog-stereo
    ... is the right one, just tested as you have written 2 days ago


    Code:
    2019-07-13 09:01:28 squeezeboxserver_safe started.
    [19-07-13 09:01:29.8349] main::init (387) Starting Logitech Media Server (v7.9.1, 1522157629, Fri Mar 30 12:28:01 CEST 2018) perl 5.018002 - x86_64-linux-gnu-thread-multi
    [19-07-13 09:02:13.6576] Slim::Networking::SqueezeNetwork::_error (565) Unable to login to SN: mysqueezebox.com-Benutzername oder -Kennwort ungültig.
    [19-07-13 09:02:13.6578] Slim::Networking::SqueezeNetwork::_init_error (185) Unable to login to mysqueezebox.com, sync is disabled: mysqueezebox.com-Benutzername oder -Kennwort ungültig. (http://www.mysqueezebox.com)
    [19-07-13 09:02:13.6580] Slim::Networking::SqueezeNetwork::_init_error (201) mysqueezebox.com sync init failed: mysqueezebox.com-Benutzername oder -Kennwort ungültig., will retry in 184500 (http://www.mysqueezebox.com)
    ... this is the log file from today


    Code:
    sudo usermod -aG audio squeezeboxserver
    sudo usermod -aG pulse squeezeboxserver
    sudo usermod -aG pulse-access squeezeboxserver
    ... done, checked in webmin


    Code:
    -rw-r--r-- 1 squeezeboxserver nogroup  373 Jul 13 00:59 custom-convert.conf
    -rw-r--r-- 1 squeezeboxserver nogroup  478 Dez 17  2008 custom-convert.conf.eca
    -rw-r--r-- 1 squeezeboxserver nogroup  301 Jul  5  2008 custom-types.conf
    drwxr-xr-x 3 squeezeboxserver nogroup 4096 Jul 13 00:36 HTML
    -rwxr--r-- 1 squeezeboxserver nogroup  654 Aug  9  2011 install.xml
    -rw-r--r-- 1 squeezeboxserver nogroup 1671 Okt  9  2009 Plugin.pm
    -rw-r--r-- 1 squeezeboxserver nogroup 2031 Okt  9  2009 Settings.pm
    -rwxr--r-- 1 squeezeboxserver nogroup  538 Jul 18  2008 strings.txt
    -rw-r--r-- 1 squeezeboxserver nogroup 2293 Okt  9  2009 WAVIN.pm
    ... seams to me to be correct


    best regards thomas

  7. #27
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    17,334
    Quote Originally Posted by bc-nero View Post
    Code:
    alsa_input.pci-0000_00_1b.0.analog-stereo
    ... is the right one, just tested as you have written 2 days ago
    The test prove that Pulseaudio is working for a logged in user (i.e. not a service) and somewhere there is a device that is correct.
    When LMS is run in a service the Pulseaudio device names may change according to what devices are available to the LMS process. I need to check how to get devices name available to a LMS in a service.


    Code:
    2019-07-13 09:01:28 squeezeboxserver_safe started.
    [19-07-13 09:01:29.8349] main::init (387) Starting Logitech Media Server (v7.9.1, 1522157629, Fri Mar 30 12:28:01 CEST 2018) perl 5.018002 - x86_64-linux-gnu-thread-multi
    [19-07-13 09:02:13.6576] Slim::Networking::SqueezeNetwork::_error (565) Unable to login to SN: mysqueezebox.com-Benutzername oder -Kennwort ungültig.
    [19-07-13 09:02:13.6578] Slim::Networking::SqueezeNetwork::_init_error (185) Unable to login to mysqueezebox.com, sync is disabled: mysqueezebox.com-Benutzername oder -Kennwort ungültig. (http://www.mysqueezebox.com)
    [19-07-13 09:02:13.6580] Slim::Networking::SqueezeNetwork::_init_error (201) mysqueezebox.com sync init failed: mysqueezebox.com-Benutzername oder -Kennwort ungültig., will retry in 184500 (http://www.mysqueezebox.com)
    ... this is the log file from today
    You have not enabled the logging properly.

    WebUI Settings/Advaned/Logging - set player.source to INFO and click Apply.
    Then try playing the wavin Favorite.

  8. #28
    Junior Member
    Join Date
    Jul 2019
    Posts
    15
    OK!

    Code:
    [19-07-13 10:17:40.8933] Slim::Player::Playlist::removeTrack (349) Removing currently playing track.
    [19-07-13 10:17:40.8936] Slim::Player::StreamingController::stop (2097) b8:27:eb:dd:58:65
    [19-07-13 10:17:40.8941] Slim::Player::Source::playmode (96) b8:27:eb:dd:58:65: Current playmode: stop
    [19-07-13 10:17:45.2390] Slim::Player::StreamingController::play (2100) b8:27:eb:dd:58:65
    [19-07-13 10:17:45.2396] Slim::Player::StreamingController::_Stop (603) Song queue is now 0
    [19-07-13 10:17:45.2398] Slim::Player::StreamingController::_setPlayingState (2357) new playing state STOPPED
    [19-07-13 10:17:45.2400] Slim::Player::StreamingController::_setStreamingState (2366) new streaming state IDLE
    [19-07-13 10:17:45.2404] Slim::Player::Song::new (108) index 0 -> wavin:alsa_input.pci-0000_00_1b.0.analog-stereo
    [19-07-13 10:17:45.2407] Slim::Player::StreamingController::_setStreamingState (2366) new streaming state TRACKWAIT
    [19-07-13 10:17:45.2411] Slim::Player::StreamingController::_playersMessage (789) Streaminfos werden geladen...: wavin:alsa_input.pci-0000_00_1b.0.analog-stereo
    [19-07-13 10:17:45.2415] Slim::Player::Song::getNextSong (229) wavin:alsa_input.pci-0000_00_1b.0.analog-stereo
    [19-07-13 10:17:45.2417] Slim::Player::Song::getNextSong (251) scanning URL wavin:alsa_input.pci-0000_00_1b.0.analog-stereo
    [19-07-13 10:17:45.2423] Slim::Player::Song::getNextSong (229) wavin:alsa_input.pci-0000_00_1b.0.analog-stereo
    [19-07-13 10:17:45.2426] Slim::Player::StreamingController::_nextTrackReady (737) b8:27:eb:dd:58:65: nextTrack will be index 0
    [19-07-13 10:17:45.2428] Slim::Player::StreamingController::_Stream (1203) Song queue is now 0
    [19-07-13 10:17:45.2430] Slim::Player::StreamingController::_Stream (1206) b8:27:eb:dd:58:65: preparing to stream song index 0
    [19-07-13 10:17:45.2432] Slim::Player::Song::open (363) wavin:alsa_input.pci-0000_00_1b.0.analog-stereo
    [19-07-13 10:17:45.2439] Slim::Player::TranscodingHelper::getConvertCommand2 (443) Error: Didn't find any command matches for type: wavin
    [19-07-13 10:17:45.2441] Slim::Player::Song::open (387) seek=false time=0 canSeek=0SEEK_ERROR_REMOTE
    [19-07-13 10:17:45.2446] Slim::Player::TranscodingHelper::getConvertCommand2 (446) Matched: wavin->flc via: [parec] --file-format=wav --format=s16le -d $FILE$ | [flac] -cs --totally-silent --compression-level-0 -
    [19-07-13 10:17:45.2448] Slim::Player::Song::open (408) Transcoder: streamMode=R, streamformat=flc
    [19-07-13 10:17:45.2450] Slim::Player::Song::open (461) Opening stream (no direct streaming) using Plugins::WaveInput::WAVIN [wavin:alsa_input.pci-0000_00_1b.0.analog-stereo]
    [19-07-13 10:17:45.2457] Slim::Player::TranscodingHelper::tokenizeConvertCommand2 (617) Using command for conversion: "/usr/bin/parec" --file-format=wav --format=s16le -d "alsa_input.pci-0000_00_1b.0.analog-stereo" | "/usr/share/squeezeboxserver/Bin/x86_64-linux/flac" -cs --totally-silent --compression-level-0 -
    [19-07-13 10:17:45.2548] Slim::Player::Song::open (482) URL is a song (audio): wavin:alsa_input.pci-0000_00_1b.0.analog-stereo, type=flc
    [19-07-13 10:17:45.2562] Slim::Player::StreamingController::_Stream (1265) b8:27:eb:dd:58:65: stream
    [19-07-13 10:17:45.2578] Slim::Player::StreamingController::_Stream (1302) Song queue is now 0
    [19-07-13 10:17:45.2582] Slim::Player::StreamingController::_setPlayingState (2357) new playing state BUFFERING
    [19-07-13 10:17:45.2584] Slim::Player::StreamingController::_setStreamingState (2366) new streaming state STREAMING
    [19-07-13 10:17:45.2893] Slim::Player::TranscodingHelper::getConvertCommand2 (443) Error: Didn't find any command matches for type: wavin
    [19-07-13 10:17:45.3382] Slim::Player::Source::_readNextChunk (373) end of file or error on socket, song pos: 0
    [19-07-13 10:17:45.3385] Slim::Player::Source::_readNextChunk (378) b8:27:eb:dd:58:65 mark end of stream
    [19-07-13 10:17:45.3387] Slim::Player::Source::_readNextChunk (386) Didn't stream any bytes for this song; mark it as failed
    [19-07-13 10:17:45.3389] Slim::Player::StreamingController::playerStreamingFailed (2228) b8:27:eb:dd:58:65
    [19-07-13 10:17:45.3391] Slim::Player::StreamingController::_playersMessage (789) Problem: Datei kann nicht geöffnet werden für:: wavin:alsa_input.pci-0000_00_1b.0.analog-stereo
    [19-07-13 10:17:45.3397] Slim::Player::StreamingController::_Stop (603) Song queue is now 0
    [19-07-13 10:17:45.3400] Slim::Player::StreamingController::_setPlayingState (2357) new playing state STOPPED
    [19-07-13 10:17:45.3402] Slim::Player::StreamingController::_setStreamingState (2366) new streaming state IDLE
    [19-07-13 10:17:45.3406] Slim::Player::StreamingController::_willRetry (1391) no retry data
    [19-07-13 10:17:45.3409] Slim::Player::StreamingController::nextsong (882) The next song is number 0, was 0
    [19-07-13 10:17:45.3439] Slim::Player::TranscodingHelper::getConvertCommand2 (443) Error: Didn't find any command matches for type: wavin
    this is the log with :

    player.source to INFO and wavin to INFO

  9. #29
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    17,334
    OK - everything is as expected.

    I think I see the problem - it looks like parec doesn't like piping WAV output.

    I'll have to look for an alternative to parec.

  10. #30
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    17,334
    I dislike PulseAudio intensely - it solves problems that 99% of users don't have but makes life more complicated.

    For some reason parec will not pipe its output so a quick and dirty solution is to use "arecord" with an environment variable "PULSE_SOURCE" but that requires a shell script as LMS syntax doesn't support variables.

    Attached are 2 files in a zip file becuase forums doesn't support the file types as attachments,
    custom-convert.conf
    pulse.sh

    the custom-convert.conf now calls a shell script pulse.sh instead of parec. Also I have omitted mp3 encoding as I think it is not required.
    the pulse.sh script has to be put into the WaveInput Bin directory with same owner/group as resot of plugin but also it must be made executable (i.e. chmod +x pulse.sh)

    1. Stop LMS
    2. Download attached zip file and unzip - 2 files pulse.sh & custom-convert.conf
    3. Copy pulse.sh into WaveInput/Bin directory. Change owner & group to same as plugin and make file executable.
    4. Copy custom-convert.conf into the WaveInput plugin directory
    5. Start LMS
    6. Check Filetype for WaveInput are "pulse.sh" and "pulse.sh/flac". If they are disabled then pulse.sh is not exectuable or accessible by LMS - fix and restart LMS if necesssary
    7. Try playing wavin Fvaorite

    By default LMS will choose Flac - this will typically have a 3-5 sec delay.
    If you disable Flac WaveInput FileType (i.e. only PCM is enabled) - the delay will be around 1 sec but will be a heavy network load if sending stream to many synced players .

    Increasing sampling rate (e.g. 44100 to 9600) for Flac stream may reduce delay as delay is caused by time to compress dependent on compression CPU time and rate of data collected.
    Attached Files Attached Files

Posting Permissions

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