You are not logged in.

#1 2010-09-25 15:06:18

poopship21
Member
Registered: 2009-05-13
Posts: 177

multiple instances of mplayer with jack

"_R_ealtime software mixing ?!?! wtf thats awesome--actually im not a studio junkie, i just need sound on one of them"

i understand that the casual nature of my involvement with jackd suggests a less-than-appropriate level of respect and diligence for what this almighty app is capable of serving up.  i just need to level audio volume on multiple instances of mplayer with software mixing (my sound card is cheap).

all my jackd configs are vanilla from the wiki as stated below.  if anyone has another solution or a request for information in regard to this solution please reply.  as always, thanks in advance


--here is some err... background
i have a some files that i would like to run with mplayer and a video file [with its own audio] that i would like to run concurrently.  it should be possible to use jackd to let one instance of mplayer show video with no sound while permitting the audio from the other instance to play at arbitrary volume.  without jack, i cannot control sound independantly since both instances seem to use the same device (PCM0).  furthermore i have found that starting multiple instances of mplayer leads to weird artifacts which persist after all running instances of mplayer concurrent with artifact appearance have been closed. 

so i installed jack-audio-connection-kit following the wiki verbatim.  then i installed qjackctl.  starting jackd as root and qjackctl with sudo allowed me to see the first instance of mplayer but not the second.

what is the difference between running mplayer through alsa and running mplayer through jack through alsa (not sure if the objects are accurately laid out there but whatever)?  the wiki basically provides an out of the box solution for software mixing a bunch of inputs (i have friends who do sound professionally though not with linux and im envisioning way more complicated stuff than my humble pair of mplayers smile

Last edited by poopship21 (2010-09-25 15:20:56)

Offline

#2 2010-09-25 15:12:01

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: multiple instances of mplayer with jack

How about creating one file with video from file1 and audio from file2?

Offline

#3 2010-09-25 15:33:07

poopship21
Member
Registered: 2009-05-13
Posts: 177

Re: multiple instances of mplayer with jack

karol wrote:

How about creating one file with video from file1 and audio from file2?

actually remuxing is the answer i would have gone with too but the situation calls for more flexibility. 

i was listening to a nice recording of brian greene's "the elegant universe" and i found myself on the couch, no longer typing whatever it was i was typing a minute ago.  then i thought it might be cool to throw some visuals up on the wall from BBC's "Planet Earth". 

yeah i know thats really cheesy but the point is that im dead set on being able to add visuals to an audio feed spontaneously as in "no longer than it takes to cache mplayer video" smile

okay now that im saying that, im realizing that it sounds petty.  i also confess a certain spiteful zeal in forcing jack to submit to my authority...

Offline

#4 2010-09-25 15:40:53

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: multiple instances of mplayer with jack

poopship21 wrote:

i also confess a certain spiteful zeal in forcing jack to submit to my authority...

LOL

OK, I still don't get it, but I think it's because I'm dog tired.

What happens if you run mplayer with alsa and not jack?
Do you run the mplayer instances with switches that block sound on one and video on the other? It's '-ao null' and '-vo null'.

Last edited by karol (2010-09-25 15:46:46)

Offline

#5 2010-09-26 09:26:50

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,362

Re: multiple instances of mplayer with jack

Why are you starting jackd as root? It should be started as your own user. And alsa's jack plugin isn't really very good, you may want to consider pulseaudio instead. Or using mplayer compiled to output to jack (am pretty sure that works).

And running mplayer through alsa won't be able to do what you want, simply because the mixing is fixed. JACK and pulseaudio are sound servers which allow you to control the mixing, both can do what you want.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#6 2010-09-26 11:14:05

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: multiple instances of mplayer with jack

ngoonee wrote:

And running mplayer through alsa won't be able to do what you want, simply because the mixing is fixed. JACK and pulseaudio are sound servers which allow you to control the mixing, both can do what you want.

If you run one file with '-ao null' and the other one with '-vo null' you can manipulate them independently, there's no sound mixing involved, it just allows you "to add visuals to an audio feed spontaneously". They can both be run with 'af scaletempo' to speed up / slow down etc.

Offline

#7 2010-09-26 12:22:39

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,362

Re: multiple instances of mplayer with jack

karol wrote:
ngoonee wrote:

And running mplayer through alsa won't be able to do what you want, simply because the mixing is fixed. JACK and pulseaudio are sound servers which allow you to control the mixing, both can do what you want.

If you run one file with '-ao null' and the other one with '-vo null' you can manipulate them independently, there's no sound mixing involved, it just allows you "to add visuals to an audio feed spontaneously". They can both be run with 'af scaletempo' to speed up / slow down etc.

Hmm, wonder if that's what the OP was looking for?


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#8 2010-09-26 12:48:04

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: multiple instances of mplayer with jack

ngoonee wrote:
karol wrote:
ngoonee wrote:

And running mplayer through alsa won't be able to do what you want, simply because the mixing is fixed. JACK and pulseaudio are sound servers which allow you to control the mixing, both can do what you want.

If you run one file with '-ao null' and the other one with '-vo null' you can manipulate them independently, there's no sound mixing involved, it just allows you "to add visuals to an audio feed spontaneously". They can both be run with 'af scaletempo' to speed up / slow down etc.

Hmm, wonder if that's what the OP was looking for?

From his first posts:

poopship21 wrote:

it should be possible to use jackd to let one instance of mplayer show video with no sound while permitting the audio from the other instance to play at arbitrary volume

Also, read his second post. <shrugs>

Offline

#9 2010-09-27 00:23:50

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,362

Re: multiple instances of mplayer with jack

Ah, I read the second to mean "arbitrary number of audio streams".

In that case yes, that would be a very simple solution.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

Board footer

Powered by FluxBB