LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-29-2015, 09:37 AM   #1
pcCoder
LQ Newbie
 
Registered: Apr 2014
Posts: 24

Rep: Reputation: Disabled
QEMU with ALSA->JACK


I'm having an odd problem running QEMU with sound.

My system has JACK installed and used by most of my other applications. Applications that use ALSA are redirected to JACK as follows:

Code:
pcm.jack {
    type jack
    playback_ports {
        0 system:playback_1
        1 system:playback_2
    }
    capture_ports {
        0 system.capture_1
        1 system.capture_2
    }
}

pcm.jackplug {
    type plug
    slave.pcm "jack"
    hint.description "JACK Audio Connection Kit"
}

pcm.!default {
    type plug
    slave { pcm "jack" }
}
While any other ALSA aplication works fine, and shows up in QJackCtl as connected to the system playback, when I run QEMU, the plug shows up in QJackCtl but it doesn't connect to system playback. When I try to connect, it fails, and when I use Patchage, I get the message:

Code:
JACK Unable to connect alsa-jack.jackP.8249.0:out_000 -> system:playback_1
I found that I can set QEMU_AUDIO_DRV=sdl, then set SDL_AUDIODRIVER=alsa to get it to work, the plug shows up in QJackCtl and connects, but this way I don't have audio input for the guest, only audio output.

My question is, when I use ALSA directly from QEMU, why doesn't the alsa-jack plug in QJackCtl connect to system playback when any other application's alsa-jack plug does?
 
Old 01-31-2015, 10:04 AM   #2
pcCoder
LQ Newbie
 
Registered: Apr 2014
Posts: 24

Original Poster
Rep: Reputation: Disabled
I had a similar issue with a media center PC I am setting up. JACK would not work at all when connected to hw:1,7 (HDMI output). I have some applications that use JACK, but quite a few that are ALSA on the media center PC, so I found that I could set up a dmix for hw:1,7, then force JACK to use that instead. ALSA applications use the default plug which uses the dmix. Since this worked on the media center PC, I applied the same settings to my PC as follows:

Code:
pcm.rawjack {
    type jack
    playback_ports {
        0 system:playback_1
        1 system:playback_2
    }
    capture_ports {
        0 system.capture_1
        1 system.capture_2
    }
}

pcm.jack {
    type plug
    slave.pcm "rawjack"
    hint.description "JACK Audio Connection Kit"
}

pcm.dmixed {
    type asym
    playback.pcm {
        type dmix
        ipc_key 2048
        ipc_perm 0660
        ipc_gid audio

        slave {
            pcm "hw:0"
            channels 2
            rate 48000
            format S16_LE;
            period_size 1024
            buffer_size 4096
        }
        bindings {
            0 0
            1 1
        }
    }
    capture.pcm "hw:0"
}

pcm.!default {
    type plug
    slave.pcm "dmixed"
}
I still have the JACK plug so I can send any ALSA applications I want/need to JACK, while normal ALSA applications will use the dmixed plug. I also configure QJackCtl to use 1024 samples, 4 periods, 48000 sample rate, and the "demixed" interface. Using "default", not "(default)", also works for the interface, but then JACK complains about being connected to a plug causing performance issues, while directly specifying "dmixed" doesn't show that warning.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
qemu-kvm + alsa + jack? Pearlseattle Linux - Software 0 12-16-2010 02:09 PM
Help: Mystified with ALSA+Jack..(almost there).. Barnix Linux - Hardware 3 06-02-2007 06:07 AM
jack and alsa problem zepphead5 Linux - Software 2 04-07-2006 11:39 AM
JACK, Ardour ALSA - Mandrake 10.1 trey85stang Linux - Software 2 05-22-2005 08:30 AM
alsa/jack/ardour foo_bar_foo Linux - Software 1 10-20-2004 04:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration