jack alsa driver unable to initialize capture-only mode

Bug #494223 reported by TraumFlug
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
jack-audio-connection-kit (Ubuntu)
Triaged
Low
Unassigned

Bug Description

I came along this trying to make my usb mic (capture only device, has no outputs) working as "master" device, while piping output with alsa_out (jack) or jack_load audioadapter (jack2) via resampling to a soundcard. using the soundcard as output device in straight jack configuration "works", but gives xruns unless latency is too high for monitoring.

symptomatic: jackd reports "impossible sample width (1) discovered!" and stops initialization, whenever no output device is specified (also with the "capture only" command line parameter for jackd). not only for devices that have no playback channels, but also for duplex devices when output is to be ommitted. I noticed this since ubuntu 9.04, with 8.10 it was still working.

I've also already found a "fix" for this problem that can be applied in the alsa driver sources...please forgive me for not just posting a diff, I'm new to linux and have still lot's to learn. the same sollution applies for both jack and jack2, as they share the same alsa driver code.

in file drivers/alsa/alsa_driver.c, line 234, is the function "alsa_driver_setup_io_function_pointers". it seems to register the dithering/memcopy routines for the driver; however, when trying to setup one for playback, and the sample width is neither 2,3 or 4 (seems to be initialized to 1 when no output is specified) it "exits" whole jackd with the error message above.

my sollution was to encompass the whole "switch (driver->playback_sample_bytes)" construction with an "if (driver->playback_handle) { ...switch statement here... }", and also the next switch statement similliarly with "if (driver->capture_handle) {...}" for consistency. this is done in the whole rest of the code, I think, and I guess it was just forgotten in that routine when the driver code was refactured... ;)

I'm not sure if this is foolproof - I don't know the overall code well, but "patched" jack 116 as well as jack2 ran fine in capture-only mode after being compiled by me.

Revision history for this message
TraumFlug (raumtrug) wrote :

forget it, someone was already faster than me: http://trac.jackaudio.org/changeset/3848

Emmet Hikory (persia)
Changed in jack-audio-connection-kit (Ubuntu):
importance: Undecided → Low
status: New → Triaged
tags: added: patch
Revision history for this message
Emmet Hikory (persia) wrote :

I believe I've succesfully adjusted the patch referenced in the changeset to apply to the current sources in Ubuntu, but I'm not going to be able to reproduce this bug today. If anyone is up for reproducing and testing to see if the attached patch fixes it, just drop it in debian/patches in the source package from lucid and rebuild to make the change. I'll return to this issue later, and try to reproduce and confirm that the ported patch (jack2 -> jack1) still resolves the issue.

Revision history for this message
Nigel Babu (nigelbabu) wrote :

This patch seems to be cherrypicked from an upstream comment, hence adding patch-accepted-upstream tag.

tags: added: patch-accepted-upstream
removed: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.