Announcement

Collapse
No announcement yet.

Picoreplayer directly play audio from usb/line-in

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Picoreplayer directly play audio from usb/line-in

    After searching for days, and still not finding what I am looking for, I now decided to register and create this thread.

    So, I have a raspberry pi 3b, running pcp, with an amp3 hat.
    Till now I was only using it for playing music from spotify.
    Now I was wondering, if I could use it, to output the TV audio through it, by adding usb soundcard to the pi, and choose it as audio input.
    I don't want to stream this input anywhere, but just directly output it.

    I hope you can help me with this, and also hope it's not something completely obvious, which I just overlooked.

    Dominik

    #2
    There is a line in plugin for LMS, which should do what you want, but I think it adds significant latency to the audio, so it would not be in sync with the TV.
    Usually running latest beta LMS nightly on Raspberry Pi OS with virtual players (Squeezelite and Airplay bridge). Occasionally using SB Radio, Boom or Classic.

    Comment


      #3
      Originally posted by RobbH View Post
      There is a line in plugin for LMS, which should do what you want, but I think it adds significant latency to the audio, so it would not be in sync with the TV.
      Do you know the name of it? Or a link to the developer page?
      I already tried to google for such a plugin, but all I could find was waveinput.

      Comment


        #4
        Not something i've ever tried but have a USB sound card which i'm not using so can have a test to see if it will work ie take the headphone output from the TV into the Pi running Picoreplayer then have it output to a set of speakers so fingers crossed

        Ps was just curious as run TVheadend on another Pi which i use to send live radio to my Picoreplayer but it can also play audio from live TV and sync wise it was surprisingly good, if i have the audio from the TV running plus my Picoreplayer you can tell it's out a little but turn off the audio from the TV and most people wouldn't be able to tell

        Comment


          #5
          Originally posted by DerTeufel View Post

          Do you know the name of it? Or a link to the developer page?
          I already tried to google for such a plugin, but all I could find was waveinput.
          Edit:
          Sorry, I was entirely wrong. I didn't follow the logic of the signal path you described. Totally my fault, nothing wrong with what you said. So I thought you were talking about an analog signal. I'll leave my original reply here, rather than trying to pretend I didn't say it.


          Original, irrelevant reply:
          My previous posting was not quite correct, and I apologize. There is, indeed, a plugin named "line in," but it is only for use with the Boom.

          There is, as you found, a plugin named WaveInput, and that is what I was thinking of, and I think it should be possible to do what you want with it, as long as latency is not an issue for you. You will find the main forum thread about it here:



          There are certainly other threads about that plugin. There might already be one that deals specifically with a project like yours. I have no experience trying to use it with LMS on piCorePlayer, so I do not know how easy it might be, or even if it's feasible.
          Last edited by RobbH; 2023-03-22, 23:40.
          Usually running latest beta LMS nightly on Raspberry Pi OS with virtual players (Squeezelite and Airplay bridge). Occasionally using SB Radio, Boom or Classic.

          Comment


            #6
            Originally posted by Eyerex View Post
            Not something i've ever tried but have a USB sound card which i'm not using so can have a test to see if it will work ie take the headphone output from the TV into the Pi running Picoreplayer then have it output to a set of speakers so fingers crossed

            Ps was just curious as run TVheadend on another Pi which i use to send live radio to my Picoreplayer but it can also play audio from live TV and sync wise it was surprisingly good, if i have the audio from the TV running plus my Picoreplayer you can tell it's out a little but turn off the audio from the TV and most people wouldn't be able to tell
            Would be really great, if you could do this test with your usb soundcard for me


            Originally posted by RobbH View Post

            Edit:
            Sorry, I was entirely wrong. I didn't follow the logic of the signal path you described. Totally my fault, nothing wrong with what you said. So I thought you were talking about an analog signal. I'll leave my original reply here, rather than trying to pretend I didn't say it.


            Original, irrelevant reply:
            My previous posting was not quite correct, and I apologize. There is, indeed, a plugin named "line in," but it is only for use with the Boom.

            There is, as you found, a plugin named WaveInput, and that is what I was thinking of, and I think it should be possible to do what you want with it, as long as latency is not an issue for you. You will find the main forum thread about it here:



            There are certainly other threads about that plugin. There might already be one that deals specifically with a project like yours. I have no experience trying to use it with LMS on piCorePlayer, so I do not know how easy it might be, or even if it's feasible.
            Thx. I'll take a look. Maybe there is a way to combine arecord and aplay with a pipe ... just, i don't want to ssh to the pi, just for activating tv sound out

            Comment


              #7
              Quick question to anyone who's used the Waveinput plugin does the LMS, Waveinput plugin and say Soundcard have to be running on the same device say a Pi or will it work on say a separate Pi running the LMS server and other Pi running Picoreplayer with the USB Soundcard ?

              Comment


                #8
                Originally posted by DerTeufel View Post
                After searching for days, and still not finding what I am looking for, I now decided to register and create this thread.

                So, I have a raspberry pi 3b, running pcp, with an amp3 hat.
                Till now I was only using it for playing music from spotify.
                Now I was wondering, if I could use it, to output the TV audio through it, by adding usb soundcard to the pi, and choose it as audio input.
                I don't want to stream this input anywhere, but just directly output it.

                I hope you can help me with this, and also hope it's not something completely obvious, which I just overlooked.

                Dominik
                No idea what this is, may do what you want? pCP "Tweaks" page > Audio tweaks. Better asking on one of the piCorePlayer

                Click image for larger version

Name:	Audio tweaks.jpg
Views:	271
Size:	89.2 KB
ID:	1634673
                Server - LMS 8.4.0 RPi4B 4GB/NanoSound ONE case/pCP 8.1.0 - 75K library, playlists & LMS cache on Sata SSD (ntfs)

                Lounge - DAC32 - AudioEngine B2
                Office - RPi 3B+/HiFiBerry DAC HAT/RPi screen - Edifier D12
                Bedroom - Echo Show 8

                Spares - 1xSB Touch, 1xSB3, 4xRPi, AVI DM5 speakers

                Comment


                  #9
                  Didn't even see that so will have a test cheers

                  Comment


                    #10
                    So far i've tried two USB sound cards a U-Green and a Logitech and both work for audio out like a normal player but when i try to send line-in audio and add the url to fav's in the LMS ie http://ipaddress:9100/S16_LE/44100/2/F it tells me the stream has loaded but i don't hear any audio plus the player doesn't register it's doing anything ie meters are not moving

                    Will keep at it as may have done something wonky

                    Comment


                      #11
                      Originally posted by kidstypike View Post

                      No idea what this is, may do what you want? pCP "Tweaks" page > Audio tweaks. Better asking on one of the piCorePlayer

                      Click image for larger version  Name:	Audio tweaks.jpg Views:	34 Size:	89.2 KB ID:	1634673
                      Yes, I had seen this option already. But this (again) seems to be used for streaming the line-in to other clients. Do you think the server could just listen to the stream itself created?
                      But I feel, creating a stream and grabbing it, would cause (too much?) delay.


                      Originally posted by Eyerex View Post
                      So far i've tried two USB sound cards a U-Green and a Logitech and both work for audio out like a normal player but when i try to send line-in audio and add the url to fav's in the LMS ie http://ipaddress:9100/S16_LE/44100/2/F it tells me the stream has loaded but i don't hear any audio plus the player doesn't register it's doing anything ie meters are not moving

                      Will keep at it as may have done something wonky
                      Thx for your testing. I didn't expect this being this complicated...I just thought I missed finding the proper plugin or option.

                      Is my idea of doing this, that outlandish?!

                      Comment


                        #12
                        I did some testing now, with my linux pc, and a headset connected. In general, there seem to be two ways, to capture and directly output this audio.

                        Code:
                        arecord -D plughw:1,0 -d 5 -f S16_LE -c1 -r44100 | aplay -D plughw:1,0
                        The arecord cmd is very close to what WaveInput plugin does, just it pipes the input to the output directly. Unfortunately, I got about 1 sec delay.

                        Code:
                        alsaloop -C plughw:1,0 -P plughw:1,0 -c 1 -t 20000​
                        alsaloop was actually working really great with my pc and headset... but i guess there's no plugin available, which makes use of it?!

                        Comment


                          #13
                          Maybe you can use Event Trigger plugin to automate this.

                          How do you envision using it?
                          In other words .... imagine you are listening to music via LMS to this output device and then you want to switch to the TV as a direct source.
                          What action would you want to take?
                          Then similar for the reverse ... to switch from listening to the TV to listening to "LMS".
                          Paul Webster
                          Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, ABC Australia and CBC/Radio-Canada
                          and, via the extra "Radio Now Playing" plugin lots more - see https://forums.slimdevices.com/showt...Playing-plugin

                          Comment


                            #14
                            Originally posted by Paul Webster View Post
                            Maybe you can use Event Trigger plugin to automate this.

                            How do you envision using it?
                            In other words .... imagine you are listening to music via LMS to this output device and then you want to switch to the TV as a direct source.
                            What action would you want to take?
                            Then similar for the reverse ... to switch from listening to the TV to listening to "LMS".
                            I was thinking/hoping, that it could be done by adding the plugin to favorites or "own apps", to then be able to select it by using android app "squeezer" (which even is open source and could be modified by me, if needed).

                            Comment


                              #15
                              I see it as a script that does something like ....

                              Code:
                              If alsaloop running then
                                kill alsaloop
                              else
                                tell LMS to pause PlayerX
                                start alsaloop
                              endif
                              Then you simply need a way to launch the script.

                              So first step would be to create such a script and see how well it works.
                              It all goes well then you just need to find a way to launch a script from the required control points
                              Paul Webster
                              Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, ABC Australia and CBC/Radio-Canada
                              and, via the extra "Radio Now Playing" plugin lots more - see https://forums.slimdevices.com/showt...Playing-plugin

                              Comment

                              Working...
                              X