Monday, May 23, 2011

Using JACK for GStreamer

Gstreamer includes a jackaudiosink in the gstreamer-plugins-bad package. To get started install this package. You would also need some more stuff to get the whole thing working so just follow the below apt-get command,
shell$ sudo apt-get install gstreamer0.10-plugins-bad jackd jack-rack jack-tools patchage
Now to route the gstreamer audio data via JACK you need to do some tweaking to the gstreamer properties in gconf-editor.
shell$ gconf-editor




Now navigate to /system/gstreamer/0.10/default. In the ‘audiosink’, musicaudiosink’ enter the following:

jackaudiosink connect=none

If you leave off the 'connect=none', the sink will automatically connect to the outputs of your soundcard in Jack. You may want this for default audio and chat (just remove 'connect=none'), but not for music if you want EQ, dynamics, etc. processing on it. You may want to change the description of the sinks as well...otherwise it just shows up as 'ALSA custom' in gnome-sound-properties.

Next, we make a rule for jack.plumbing. In the version of jackaudiosink that ships with Feisty, the outputs are by default named 'GStreamer:out_x'; In Gutsy, they are named by the program, so for Banshee, they would be 'Banshee:out_x'.

Save this in your home directory as '~/.jack.plumbing':

(connect "GStreamer:out_1" "jack_rack:in_1")
(connect "GStreamer:out_2" "jack_rack:in_2")
(connect "jack_rack:out_1" "alsa_pcm:playback_1")
(connect "jack_rack:out_2" "alsa_pcm:playback_2")

Now you need a script to automate it. Put this in a script (again, you may need to modify the jackd command to suit your set up, depending on what your primary soundcard is labeled as in ALSA, and if you have -RT kernel, running jack with '-R' will give you better performance), save it in your home folder, 'chmod +x' it:
jackd -dalsa -dhw:0 &
sleep 2
jack.plumbing &
sleep 1
jack-rack -n &


Now you're set. Try running that script, and if everything works, jack-rack should pop up. If it doesn't, jackd didn't start correctly. If you save a jack-rack file, you can tell jack-rack to load it in the script above by just adding the path to the file after the '-n'. If jack-rack popping up on every boot annoys you, get alltray (sudo apt-get install alltray) and run jack-rack like so: "alltray jack-rack -n &", and it will dock in your system tray.

Alternatively you could omit the jackd server start in the script and start it with the qjackctl and then run the above script for JACK plumbing.
Now run your favorite gstreamer audio application (exaile, banshee, rythymbox, etc.) and see if you have any sound when you hit play. If not, open patchage and manually connect the output pins from your sound application to the input pins of jack-rack (just drag and drop). Jack rack's output should already be connected to the outputs of your soundcard.

OR just to test with Gstreamer alone follow these steps:

Run the above script that pops up the JACK rack.

Now start your favourite gstreamer pipeline (example gst-launch0.10 audiotestsrc ! audiocovert ! jackaudiosink) and check if the audio data (sine in the example case) is routed via JACK.

15 comments:

  1. Thanks for this HowTo. It actually helped me to run guayadeque over gstreamer to jack thanks to jack.plumbing.

    But what is the point about using jack-rack in the first place? Sure it's nice to be able to alter the sound you get from gstream-applications, but it's not mandatory.

    Greetings

    ReplyDelete
  2. I thought the topics you posted on were very interesting. I tried to add your RSS to my feed reader and it a few. take a look at it, hopefully I can add you and follow.

    Packers and Movers Mylapore

    ReplyDelete
  3. We are giving you best shifting services in India and our services is very inexpensive. We have well skilled employees of packers and movers services. We also provide insurance of your goods.

    Packers and Movers in Mumbai
    Packers and Movers in Gurgaon

    ReplyDelete

  4. شركة البيت السعيد

    شركة كشف تسربات المياه
    تعتبر شركة البيت السعيد شركة كشف تسربات المياه بالرياض
    من أفضل الشركات التي تقوم
    بأفضل خدمات كشف تسربات المياه بالرياض
    بدون الحاجة إلى تكسير الأرضيات و الحوائط فيتم كشف تسربات المياه
    من
    خلال طرق الكشف المبكر التي تعمل على حماية المباني من الأضرار التي يمكن أن تلحق
    بها

    شركة البيت السعيد
    كشف تسربات المياه بالرياض

    0543578920
    http://www.elbaytelsaeed.com/2017/04/08/%d9%83%d8%b4%d9%81-%d8%aa%d8%b3%d8%b1%d8%a8%d8%a7%d8%aa-%d8%a7%d9%84%d9%85%d9%8a%d8%a7%d9%87-%d8%a8%d8%a7%d9%84%d8%b1%d9%8a%d8%a7%d8%b6-%d8%a7%d9%84%d8%a8%d9%8a%d8%aa-%d8%a7%d9%84%d8%b3%d8%b9%d9%8a/

    ReplyDelete

  5. تتشرف شركة الشامل بخدمتكم كافضل شركة مكافحة حشرات بالدمام والخبر والجبيل والقطيف وراس تنورة  والتي تقدم خدمات ابادة كافة الحشرات المنزلية الزاحفة او الطائرة عن طريق استخدام افضل المبيدات المستوردة والتي تعطي فاعلية مضمونة حيث نقدم كافة الخدمات مع الضمان من ٣ شهور وحتي عام كامل شركة مكافحة الحشرات بالدمام
    شركات مكافحة حشرات بالخبر والدمام فنحن فى مؤسسة الشرق الأوسط للنظافة نهتم ونحرص وعلى وجه الخصوص برش المنازل بأجود أنواع المبيدات الحشرية لمكافحة الحشرات بكافة أنواعها, فنقوم بإزالة الموكيت والأثاث لرش الأرضيات والفواصل التي بين البلاط كما أن لدينا في شركة مكافحة حشرات بالخبر شركة مكافحة الحشرات بالقطيف
    شركة مكافحة النمل الابيض بالدمام
    فشركتنا تقوم باعمال المكافحة لاى نوع من الحشرات من النمل الابيض – البق – الفئران – الابراص – الصراصير – التعابين – ……. وغيرها من اى نوع من انواع الحشرات المتواجده فى المكان فاذا اراد ان تقضى على اى نوع من الحشرات فاستعن بينا على الفور فى القيام بهذه الخدمة الان. تعد شركة الشامل الدماما من اهم وافضل شركة مكافحة حشرات بالدمام والتى تعتمد على عدد من الخدمات الاساسية شركة مكافحة الفئران بالقطيف

    ReplyDelete

  6. حن شركة متخصصة في ابادة كافة الحشرات المنزلية خاصة الصراصير و بق الفراش وذلك لاننا نستخدم معدات رش مبيد سائل حديثة ومجربة كما اننا نقدم الضمان الساري علي كافة اعمال شركة مكافحة الحشرات بالدمام والجبيلو الخبر مع تفعيل خدمات الضمان الفوري علي كافة اعمال الشركة شركة مكافحة النمل الابيض بالخبر
    شركة مكافحة النمل الابيض بالقطيف
    اذا كنت تبحث عن شركة مكافحة بق الفراش فى الدمام او الخبر او القطيف والجبيل وراس تنورة  فاننا افضل شركة مكافحة حشرات بالدمام والخبر والجبيل كما اننا شركة تتميز بالكفاءة وحسن التعامل مع العملاء ،هل تعلم ان حشرة بق الفراش من الحشرات التي تتغذى بشكل أساسي على الدماء حيث تمتص حشرة بق الفراش شركة مكافحة البق بالقطيف
    شركة مكافحة البق بالدمام

    ReplyDelete
  7. Well known trainer and leader, who has two decades of hard-core experience in education and administration of IAS/KAS coaching classes- frequently, we have demonstrated our quality in the area of competitive examinations. Aside from that, we are also recognized as the first IAS/KAS coaching association in India to assist online work to take the UPSC test course at J&K, as well as in India. Get more info Call - 9419145317 / 9796736420.

    KAS Coaching in Jammu

    ReplyDelete
  8. CAT coaching from Career success Jammu will provide you learning in your preferred mode such as online, Face to Face or even if you are opting for self study then free resources on our portal will help you immensely. Our Counseling team is here to help you in clearing your doubts regarding various exam and courses. We also provide large no. of free resources such as article, study materials, mock test available 24*7online. Get more info Call - 9419145317 / 9796736420.

    CAT Coaching in Jammu

    ReplyDelete
  9. Career success academy is kwon as astonishing establishment for CLAT Coaching in Jammu. We give the direction for different subject of CLAT examination. From earlier year we got 97% result from CLAT guiding classes. Our inside and out directed staff members and most experienced teachers for various subjects. They convey with them arranged plentitude of data. Get more info Call - 9419145317 / 9796736420.

    CLAT Classes in Jammu

    ReplyDelete
  10. Excellent post! I must thank you for this informative read. I really enjoyed reading it,c you’re a great author.Please visit here @
    Packers And Movers Gurgaon
    Packers And Movers Mirpur Gurgaon
    Packers And Movers Khor Gurgaon
    Packers And Movers Jawasi Gurgaon

    ReplyDelete
  11. Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. I wanted to thank you for this websites! Thanks for sharing. Great websites! Packers And Movers Delhi
    Packers And Movers Dwarka Delhi
    Packers And Movers Anand Vihar Delhi
    Packers And Movers Mayur Vihar Delhi
    Packers And Movers Sonia Vihar Delhi

    ReplyDelete