Home of the Squeezebox™ & Transporter® network music players.
Page 47 of 47 FirstFirst ... 37454647
Results 461 to 470 of 470
  1. #461
    Senior Member
    Join Date
    Nov 2016
    Posts
    100
    I was trying to do it the way that is described in http://thomer.com/howtos/detect_sound.html, which basically creates short samples of what is played through the sound card, analyses their voulme with sox and make the Raspi do sth. (e.g. shutdown) when the volume level drops below certain value. But I wasn't able to solve the
    Code:
    ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave
    arecord: main:788: audio open error: Device or resource busy
    problem. Everything else worked perfectly, i.e. creating the wave samples, sox analysis etc., shutdown when no sound is detected in the sample - but only when Liquidsoap wasn't running at the same time.

    So I parked the project and opted for a hardware solution (button/switch). Hoping of course that sb. with better Linux skills and similar interests would do the job
    PCP (always latest version) on RasPi 3 with PhatDac (player & server)
    PCP on several RasPis 2 +3
    2 Airplay speakers (Sony SA-NS510) integrated via Airplay Bridge Plugin

  2. #462
    Senior Member
    Join Date
    Feb 2011
    Location
    Cheshire, UK
    Posts
    2,905
    Quote Originally Posted by streampunk View Post
    I was trying to do it the way that is described in http://thomer.com/howtos/detect_sound.html, which basically creates short samples of what is played through the sound card, analyses their voulme with sox and make the Raspi do sth. (e.g. shutdown) when the volume level drops below certain value. But I wasn't able to solve the
    Code:
    ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave
    arecord: main:788: audio open error: Device or resource busy
    problem. Everything else worked perfectly, i.e. creating the wave samples, sox analysis etc., shutdown when no sound is detected in the sample - but only when Liquidsoap wasn't running at the same time.

    So I parked the project and opted for a hardware solution (button/switch). Hoping of course that sb. with better Linux skills and similar interests would do the job
    I think it should be possible to do the blank detection inside Liquidsoap and use a handler to shut down the Pi but to date I haven't been able to get the syntax correct or work out how to set the delay

    Viz

    http://liquidsoap.fm/doc-dev/blank.html
    Pi3 pCp/LMS 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

  3. #463
    Senior Member
    Join Date
    Nov 2016
    Posts
    100
    Very interesting, didn't know that.
    I imagine it's not that easy as putting
    Code:
    def handler()
      system("/path/to/your/shutdown-script")
    end
    source = on_blank(handler,source)
    into the Liquidsoap recipe (*.liq file)
    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.178.200”", genre = "Misc", phono)
    ?

    Also, I didn't find information whether the length of the blank can be configured with on_blank in the same way as with strip_blank (strip_blank(max_blank=5...)?
    PCP (always latest version) on RasPi 3 with PhatDac (player & server)
    PCP on several RasPis 2 +3
    2 Airplay speakers (Sony SA-NS510) integrated via Airplay Bridge Plugin

  4. #464
    Senior Member
    Join Date
    Feb 2011
    Location
    Cheshire, UK
    Posts
    2,905
    Quote Originally Posted by streampunk View Post
    Very interesting, didn't know that.
    I imagine it's not that easy as putting
    Code:
    def handler()
      system("/path/to/your/shutdown-script")
    end
    source = on_blank(handler,source)
    into the Liquidsoap recipe (*.liq file)
    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.178.200”", genre = "Misc", phono)
    ?

    Also, I didn't find information whether the length of the blank can be configured with on_blank in the same way as with strip_blank (strip_blank(max_blank=5...)?
    In theory I think it is as simple as that

    In your example the code would be

    Code:
    def handler()
      system("/path/to/your/shutdown-script")
    end
    phono = on_blank(handler,phono)
    But like you I can't find any documentation that determines the length of on_blank.

    Also you have to remember that the shutdown script needs to take account of the user running Liquidsoap and the fact that the Pi will still have mains power i.e. it does not really switch off. To switch it back on would require toggling the power.
    Pi3 pCp/LMS 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

  5. #465
    Senior Member
    Join Date
    Nov 2016
    Posts
    100
    I'm testing remotely (via VPN) at the moment. The fact is that I can't connect to the Pi any longer.. But I'm not sure whether I actually managed to get it running or simply sent the Raspebery Pi into an eternal reboot loop, as there is no streaming (I had substituted shutdown by shutdown -r in the shell script).
    PCP (always latest version) on RasPi 3 with PhatDac (player & server)
    PCP on several RasPis 2 +3
    2 Airplay speakers (Sony SA-NS510) integrated via Airplay Bridge Plugin

  6. #466
    Senior Member
    Join Date
    Nov 2016
    Posts
    100
    Doesn‘t work. After modifying phono.liq, stream generation won‘t work at all. We‘ll need sb with more Liquidsoap expertise perhaps...
    PCP (always latest version) on RasPi 3 with PhatDac (player & server)
    PCP on several RasPis 2 +3
    2 Airplay speakers (Sony SA-NS510) integrated via Airplay Bridge Plugin

  7. #467

    Success: Waveinput with Max2Play and Pulseaudio for cirrus logic soundcard

    After quite some time spending with try and error I have been successful in installing the Waveinput under a Raspberry Max2Play setup, which uses Pulseaudio and a cirrus logic soundboard.
    Since Max2Play switches to Pulseaudio, when you install their bluetooth plugin, the default Alsa approach does not work and you have to deal with pulseaudio (I use the bluetooth plugin for streaming music from friends' phones to my squeezebox eco-system, which is quite handy for multi-room synchronization).
    Step for Step how it worked for myself:

    In Max2Play under Raspberry Settings
    - Enable Wolfson Cirrus Logic Soundcard, which uses a patched old kernel and writes in config.txt: "dtoverlay=rpi-cirrus-wm5102"
    - Disable Built-in Sound of Rasperry, which writes in config.txt: "dtparam=audio=off"
    - Enable I2S-MMAP Mixer, which writes into config.txt: "dtoverlay=i2s-mmap"

    Reboot

    Add User Rights for Pulse Access via SSH login (not sure if needed but useful for debugging):
    sudo usermod -a -G pulse-access squeezeboxserver
    sudo usermod -a -G pulse squeezeboxserver
    sudo usermod -a -G pulse-access pi
    sudo usermod -a -G pulse pi


    Set Soundcard to line-in:
    sudo /opt/max2play/wolfson/Reset_paths.sh
    sudo /opt/max2play/wolfson/Record_from_lineIn_Micbias.sh


    Check Available Cards:
    pactl list short
    Output for Cirrus Logic should contain a card called "alsa_input.platform-soc_sound.analog-stereo"


    connect line-in, play music to line-in and test recording into flac:
    cd ~
    parec -v -d alsa_input.platform-soc_sound.analog-stereo --file-format=flac recording.flc

    If flac contains music, we have been successful, add to Logitech favorites:
    wavin:alsa_input.platform-soc_sound.analog-stereo

    And we should be done.
    Usually the cirrus logic card should remember the input settings. However it might be handy to remember following commands, also if you want to capture the input from the SPDIF inpult. In my case I added them to the Severpowercontrol plugin for a quick execution via my squeezeboxes:

    sudo /opt/max2play/wolfson/Record_from_lineIn_Micbias.sh
    sudo /opt/max2play/wolfson/Reset_paths.sh
    sudo /opt/max2play/wolfson/SPDIF_record.sh
    sudo /opt/max2play/wolfson/Record_from_lineIn.sh

  8. #468
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    781
    Thinking aloud (having connected turntable to RPi via Behringer UFO202 and WaveInput plugin) ... would it be feasible to have WaveInput (or maybe LMS) have an option to save the captured content so that headless rips can be done?
    The save location could be specified as a folder somewhere with the filename based on date time ... then user could rename the file at leisure or import into, for example, Audacity to clean it up and split the tracks.
    It would make the process of archiving LPs easy.

  9. #469
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    15,479
    Quote Originally Posted by Paul Webster View Post
    Thinking aloud (having connected turntable to RPi via Behringer UFO202 and WaveInput plugin) ... would it be feasible to have WaveInput (or maybe LMS) have an option to save the captured content so that headless rips can be done?
    The save location could be specified as a folder somewhere with the filename based on date time ... then user could rename the file at leisure or import into, for example, Audacity to clean it up and split the tracks.
    It would make the process of archiving LPs easy.
    This hasn't been asked before and so it would seem to be a need of a very small number of users. It would make for a very complicated plugin (which in turn would require testing & maintenance) when there are already a number of dedicated applications for recording files from audio inputs.

    A simpler approach would be for the user to modify the custom-comvert.conf file to call a shell script rather than arecord which uses for example uses tee to save the waveinput session into a file.

  10. #470
    Senior Member
    Join Date
    Feb 2011
    Location
    Cheshire, UK
    Posts
    2,905
    I am getting close to having a fully working Pi3, Liquidsoap & Icecast server that will stream vinyl as FLAC to LMS while simultaneously recording the audio as WAV (my build is with a Behringer UCA202 off the tape loop on my amp but a UFO202 would also work).
    I now have silence detection that will stop the recording and switch off the Pi but am currently uncertain whether or not to boot directly into recording mode or whether to try to build it with a start / stop recording switch of some kind. A bit more trial and error is required on the boot direct to recording mode in terms of timing the boot up.

    PS Liquidsoap will do hourly WAVs auto named with date and time. My plan is to dump then via NFS to a location on my NAS and then split them at a later date using conventional vinyl recording software e.g Audacity, VinylStudio and mp3tag
    Last edited by d6jg; 2017-12-04 at 14:34.

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
  •