Can netjack1/2 over a direct ethernet connection substitute for local ALSA audio?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Can netjack1/2 over a direct ethernet connection substitute for local ALSA audio?

crocket
I have a desktop computer and Raspberry Pi 3 B+.
I want Raspberry Pi to control my speakers and share my speakers with my desktop over a direct ethernet connection.

USB microphone is going to be connected to Raspberry Pi and be shared with the desktop computer over the ethernet connection, too.

Can netjack1/2 over a direct ethernet connection substitute for local ALSA audio?
Will video and audio synchronize if netjack was used over a direct ethernet connection?

_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Can netjack1/2 over a direct ethernet connection substitute for local ALSA audio?

Len Ovens
On 2019-03-27 22:35, crocket wrote:
> I have a desktop computer and Raspberry Pi 3 B+.
> I want Raspberry Pi to control my speakers and share my speakers with
> my desktop over a direct ethernet connection.

Netjack can do that yes. Or zita-njbridge.
>
> USB microphone is going to be connected to Raspberry Pi and be shared
> with the desktop computer over the ethernet connection, too.

Jack can not use two devices. speakers (via some kind of on board audio
device I assume) and the usb mic will not be in sync and so clicks and
pops would be assured. Some kind of sample rate conversion would be
needed. zita-ajbridge or alsa-in would work for that.

> Can netjack1/2 over a direct ethernet connection substitute for local
> ALSA audio?

No, not really. Many applications can talk to jack directly but many do
not... but then there are more and more that do not talk to alsa either.
Most linux desktop audio is not alsa (surprise) but pulse. Bridging
pulse to jack will allow desktop audio to feed jack directly. Pulse does
present an alsa port for things that do not know about pulse.

> Will video and audio synchronize if netjack was used over a direct
> ethernet connection?

No, but that is not a given with almost anything anyway. Your TV may
have video and audio in sync, but that sync will change just by moving
your chair closer or farther away. Audio can lag video by quite a lot
without being noticeable. Leading, not so much. Some video players (like
VLC) have a control to move the timing of the audio with respect to the
video. in this case, just changing the buffer size in jack will add more
delay. I think what you really want to know is if there will be a
noticeable difference between when the person on screen moves their lips
and their voice happens

However, without knowing what your expectations are and what your use
is, it is hard to know what to suggest. Pulse also has a plugin that
allows audio over ethernet and that may be all you need and simpler to
install. A usb mic is not a serious recording device though maybe ok for
podcast types of things. I won't say you can't use it for music as great
recordings have been made with sm57 mics after using them as hammers
too... but live recordings are more about being there than quality
sound. crowd noise etc. covers a lot.



--
Len Ovens
www.ovenwerks.net
_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Can netjack1/2 over a direct ethernet connection substitute for local ALSA audio?

crocket
On Thu, Mar 28, 2019 at 4:06 PM Len <[hidden email]> wrote:
Jack can not use two devices. speakers (via some kind of on board audio
device I assume) and the usb mic will not be in sync and so clicks and
pops would be assured. Some kind of sample rate conversion would be
needed. zita-ajbridge or alsa-in would work for that.

Can I not just run two jack servers on Raspberry Pi?
 
No, not really. Many applications can talk to jack directly but many do
not... but then there are more and more that do not talk to alsa either.
Most linux desktop audio is not alsa (surprise) but pulse. Bridging
pulse to jack will allow desktop audio to feed jack directly. Pulse does
present an alsa port for things that do not know about pulse.

My Gentoo Linux desktop doesn't have pulseaudio. It only has ALSA at this moment. I do not want pulseaudio.
On Gentoo Linux, everything can be compiled against ALSA.
Even, firefox is compiled against ALSA on my gentoo system.
In the same way, if an application uses jack API, I can make it use jack by compiling them against jack.
I can make firefox use jack by compiling it against ALSA and jack.
 
No, but that is not a given with almost anything anyway. Your TV may
have video and audio in sync, but that sync will change just by moving
your chair closer or farther away. Audio can lag video by quite a lot
without being noticeable. Leading, not so much. Some video players (like
VLC) have a control to move the timing of the audio with respect to the
video. in this case, just changing the buffer size in jack will add more
delay. I think what you really want to know is if there will be a
noticeable difference between when the person on screen moves their lips
and their voice happens

I want the voices to not lag too much behind the lips.
 
However, without knowing what your expectations are and what your use
is, it is hard to know what to suggest. Pulse also has a plugin that
allows audio over ethernet and that may be all you need and simpler to
install. A usb mic is not a serious recording device though maybe ok for
podcast types of things. I won't say you can't use it for music as great
recordings have been made with sm57 mics after using them as hammers
too... but live recordings are more about being there than quality
sound. crowd noise etc. covers a lot.

I just want Raspberry Pi and my desktop to share my speakers. Raspberry Pi will serve as a morning alarm, and I need to watch videos on my desktop computer.
I use a USB microphone for foreign language practice and audio calls.
I can technically buy a USB hub that supports per-port power switching to have my USB microphone turned off most of the time.
But, since Raspberry Pi 3 B+ supports per-port power switching, I wanted to know whether I could use Raspberry Pi as a network USB hub or a network USB microphone.

_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Can netjack1/2 over a direct ethernet connection substitute for local ALSA audio?

crocket
In reply to this post by Len Ovens
On Thu, Mar 28, 2019 at 4:06 PM Len <[hidden email]> wrote:
Your TV may have video and audio in sync, but that sync will change just by moving
your chair closer or farther away. Audio can lag video by quite a lot
without being noticeable. Leading, not so much. Some video players (like
VLC) have a control to move the timing of the audio with respect to the
video. in this case, just changing the buffer size in jack will add more
delay. I think what you really want to know is if there will be a
noticeable difference between when the person on screen moves their lips
and their voice happens

netjack1 incurs 8ms latency over a direct ethernet connection.
8ms latency is quite good. I'm not going to notice 8ms latency when I watch videos.
A direct ethernet connection directly connects my desktop computer and Raspberry Pi.

_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Can netjack1/2 over a direct ethernet connection substitute for local ALSA audio?

Len Ovens
In reply to this post by crocket
On Thu, 28 Mar 2019, crocket wrote:

> On Thu, Mar 28, 2019 at 4:06 PM Len <[hidden email]> wrote:
>       Jack can not use two devices. speakers (via some kind of on board
>       audio
>       device I assume) and the usb mic will not be in sync and so clicks
>       and
>       pops would be assured. Some kind of sample rate conversion would be
>       needed. zita-ajbridge or alsa-in would work for that.
>
>
> Can I not just run two jack servers on Raspberry Pi?
How would that help you? As soon as you want to use the mic and your
speakers with the same application you will have under and over runs
between one and the other. The only way around that is to use SRC which
can be provided by either zita-ajbridge or alsa-in/out (the second comes
with jack, but the first is better and may now be a part of jackd1). Do
note that using netjack with the device on the Pi means that the internal
audio on your desktop can't be used at the same time for the same reason.
The backend for the jack server on your desktop is the jack server on the
Pi so any audio device on your desktop would also have to be added via an
SRC client such as zita-ajbridge or alsa_in/out. This means you desktop
relies on your Pi for a solid sync... if you are usng your desktop audio
for anything important that requires solid sync, I would use the local
device as backend and use zita-njbridge to join the two jack servers on
the two machines.

> My Gentoo Linux desktop doesn't have pulseaudio. It only has ALSA at this moment.
> I do not want pulseaudio.

No problem (no skype either, but you may not need it) Lots of people use a
jack to alsa bridge

> I want the voices to not lag too much behind the lips.
>  
> I just want Raspberry Pi and my desktop to share my speakers. Raspberry Pi will
> serve as a morning alarm, and I need to watch videos on my desktop computer.
> I use a USB microphone for foreign language practice and audio calls.

That is what pulse (and the up and coming... maybe, Pipewire) is made for,
but lots of people do not want to use it, Jack with alsa will get you
there too. Latency shouldn't be a problem for that use, even with jack
running 1024/2, though 128/2 should still be stable abd much better.

> I can technically buy a USB hub that supports per-port power switching to have my
> USB microphone turned off most of the time.
> But, since Raspberry Pi 3 B+ supports per-port power switching, I wanted to know
> whether I could use Raspberry Pi as a network USB hub or a network USB
> microphone.

Not sure I know what you mean by that... if any of my guesses are right,
the answer is I don't know.

--
Len Ovens
www.ovenwerks.net

_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Can netjack1/2 over a direct ethernet connection substitute for local ALSA audio?

crocket
It seems I should just save headaches and use only ALSA for local audio devices.
This means I am going to use a pair of good speakers for my desktop computer and a pair of cheap speakers for Raspberry Pi.
Raspberry Pi will be responsible for turning on and off speakers via relays.

On Fri, Mar 29, 2019 at 12:46 AM Len Ovens <[hidden email]> wrote:
On Thu, 28 Mar 2019, crocket wrote:

> On Thu, Mar 28, 2019 at 4:06 PM Len <[hidden email]> wrote:
>       Jack can not use two devices. speakers (via some kind of on board
>       audio
>       device I assume) and the usb mic will not be in sync and so clicks
>       and
>       pops would be assured. Some kind of sample rate conversion would be
>       needed. zita-ajbridge or alsa-in would work for that.
>
>
> Can I not just run two jack servers on Raspberry Pi?

How would that help you? As soon as you want to use the mic and your
speakers with the same application you will have under and over runs
between one and the other. The only way around that is to use SRC which
can be provided by either zita-ajbridge or alsa-in/out (the second comes
with jack, but the first is better and may now be a part of jackd1). Do
note that using netjack with the device on the Pi means that the internal
audio on your desktop can't be used at the same time for the same reason.
The backend for the jack server on your desktop is the jack server on the
Pi so any audio device on your desktop would also have to be added via an
SRC client such as zita-ajbridge or alsa_in/out. This means you desktop
relies on your Pi for a solid sync... if you are usng your desktop audio
for anything important that requires solid sync, I would use the local
device as backend and use zita-njbridge to join the two jack servers on
the two machines.

> My Gentoo Linux desktop doesn't have pulseaudio. It only has ALSA at this moment.
> I do not want pulseaudio.

No problem (no skype either, but you may not need it) Lots of people use a
jack to alsa bridge

> I want the voices to not lag too much behind the lips.
>  
> I just want Raspberry Pi and my desktop to share my speakers. Raspberry Pi will
> serve as a morning alarm, and I need to watch videos on my desktop computer.
> I use a USB microphone for foreign language practice and audio calls.

That is what pulse (and the up and coming... maybe, Pipewire) is made for,
but lots of people do not want to use it, Jack with alsa will get you
there too. Latency shouldn't be a problem for that use, even with jack
running 1024/2, though 128/2 should still be stable abd much better.

> I can technically buy a USB hub that supports per-port power switching to have my
> USB microphone turned off most of the time.
> But, since Raspberry Pi 3 B+ supports per-port power switching, I wanted to know
> whether I could use Raspberry Pi as a network USB hub or a network USB
> microphone.

Not sure I know what you mean by that... if any of my guesses are right,
the answer is I don't know.

--
Len Ovens
www.ovenwerks.net
_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user

_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Can netjack1/2 over a direct ethernet connection substitute for local ALSA audio?

crocket
In reply to this post by Len Ovens
Although I may not use jack servers, I want to address a few concerns.

On Fri, Mar 29, 2019 at 12:46 AM Len Ovens <[hidden email]> wrote:
This means you desktop
relies on your Pi for a solid sync... if you are usng your desktop audio
for anything important that requires solid sync, I would use the local
device as backend and use zita-njbridge to join the two jack servers on
the two machines.

I don't know what you mean by solid sync. According to https://en.wikipedia.org/wiki/AptX#aptX_Low_Latency
40ms latency seems to be the threshold beyond which humans detect synchronization issues when they watch videos.
 
No problem (no skype either, but you may not need it) Lots of people use a
jack to alsa bridge

The new skype client can use either ALSA, JACK, or pulseaudio.

_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Can netjack1/2 over a direct ethernet connection substitute for local ALSA audio?

crocket
On Fri, Mar 29, 2019 at 8:34 AM crocket <[hidden email]> wrote:
The new skype client can use either ALSA, JACK, or pulseaudio.

It seems the new skype client is configured to use only ALSA on Gentoo Linux. 

_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Can netjack1/2 over a direct ethernet connection substitute for local ALSA audio?

crocket
In reply to this post by Len Ovens
On Fri, Mar 29, 2019 at 12:46 AM Len Ovens <[hidden email]> wrote:
if you are usng your desktop audio
for anything important that requires solid sync, I would use the local
device as backend and use zita-njbridge to join the two jack servers on
the two machines.

I decided to not give up just yet. I just understood zita-njbridge and zita-ajbridge.

1. Is a video call going to have synchronization issues if my desktop connects to speakers and a USB microphone on Raspberry Pi over a direct ethernet connection?
2. Am I going to notice synchronization issues when I watch youtube videos on my desktop?

_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Can netjack1/2 over a direct ethernet connection substitute for local ALSA audio?

Fons Adriaensen-3
In reply to this post by crocket
On Fri, Mar 29, 2019 at 08:34:55AM +0900, crocket wrote:

> The new skype client can use either ALSA, JACK, or pulseaudio.

Do you have any reference or link that could confirm that
skype can now use Jack ? I found nothing at all.

Ciao,

--
FA



_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Can netjack1/2 over a direct ethernet connection substitute for local ALSA audio?

crocket
I made a mistake. skypeforlinux supports only ALSA on Gentoo Linux.

On Sat, Mar 30, 2019 at 10:08 AM Fons Adriaensen <[hidden email]> wrote:
On Fri, Mar 29, 2019 at 08:34:55AM +0900, crocket wrote:

> The new skype client can use either ALSA, JACK, or pulseaudio.

Do you have any reference or link that could confirm that
skype can now use Jack ? I found nothing at all.

Ciao,

--
FA



_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user

_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user