ALSA_IO(1)

๐Ÿ“ฆ
version 4 ยท 6 versions
, in arch rolling, debian trixie, fedora 43, fedora 44, nixos 26.05, ubuntu questing, ubuntu resolute, ubuntu stonking

๐ŸŽ€ ALSA_IO ๐ŸŽ€

okay bestie, this is the ALSA_IO page from the General Commands Manual and it's giving main character energy ๐Ÿ’…โœจ

โœจ NAME โœจ

so the name section says these are alsa_in and alsa_out, Jack clients that do I/O with an alternate audio interface ๐Ÿฆ‹

๐Ÿ’… SYNOPSIS ๐Ÿ’…

alsa_in [options]
alsa_out [options]

๐ŸŒธ DESCRIPTION ๐ŸŒธ

okay so a JACK client is basically a little helper that opens a specific audio interface (one that's different from the one the JACK server is using, if there even is one ๐Ÿ‘€) and shuttles audio back and forth between its JACK ports and that interface. alsa_in gives you data from the interface (potentially for capture), and alsa_out sends data to it (for playback) ๐ŸŽง

the audio interface used by alsa_in/alsa_out doesn't have to be synced with the JACK backend (or the hardware it's using) ๐Ÿ™ˆ instead, it tries to resample the output stream to make up for drift between the two clocks. โœจ

as of jack-0.116.3 this works almost perfectly ๐Ÿ˜ญ it just takes some time to reach absolute resample-rate stability, so give it some minutes (it's intended to run permanently anyways) ๐Ÿ’œ

๐ŸŽ€ OPTIONS ๐ŸŽ€

  • -j jack_client_name โ€” set the client name ๐Ÿ’–
  • -d alsa_device โ€” use this soundcard ๐Ÿ”Š
  • -v โ€” verbose mode! prints out the resample coefficient and other useful debugging params every 500ms, and also reports soft xruns ๐Ÿ“ฃ
  • -i โ€” instrumentation ๐Ÿงช logs the 4 important params of the samplerate control algorithm every 1ms. you can pipe it into a file and plot it. this is only needed if it's not working as expected and we need to tweak some obscure params. find me on irc.freenode.org in #jack to set it up correctly ๐Ÿซถ
  • -c channels โ€” set the number of channels ๐ŸŽถ
  • -r sample_rate โ€” set the sample rate. the program resamples as necessary, so you can connect a 44100 jackd to a soundcard that only supports 48000 ๐ŸŒˆ (default is the JACK sample_rate)
  • -p period_size โ€” set the period size. it's not related to the jackd period_size, but sometimes it affects the quality of the delay measurements ๐Ÿงš setting it lower than the jackd period_size only works if you use a higher number of periods
  • -n num_period โ€” set the number of periods. see the note for period_size โญ
  • -q quality โ€” set the resampler quality from 0 to 4. it can significantly reduce CPU usage ๐Ÿ“
  • -m max_diff โ€” the value at which a soft xrun occurs. basically the window in which the dma pointer may jitter. the author doesn't think you need to play with this anymore ๐Ÿ™ˆ
  • -t target_delay โ€” the delay alsa_io should try to approach. same deal as max_diff. it gets set up based on -p and -n, which is generally sufficient ๐Ÿ’œ
  • -s smooth_array_size โ€” controls the size of the array used for smoothing the delay measurement. its default is 256. if you use a pretty low period size, you can lower CPU usage a bit by decreasing this, but most CPU time is spent in the resampling, so it won't be much ๐Ÿงฎ
  • -C P โ€” Control Clamp ๐Ÿช„ if you have a PCI card, the default value (15) is too high for -p64 -n2... setting it to 5 should fix that.
be careful! setting this too low lets the HF noise on the delay measurement come through onto the resamplerate, which might degrade output quality. (but it's a threshold value, chosen to mask the noise of a USB card, whose amplitude is 50 times higher than a PCI card's, so 5 won't lose you any quality on a PCI card) โš ๏ธ
  • -S server_name โ€” the server to connect to. this lets you attach to a named jack2 server ๐Ÿ–ฅ๏ธ

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Torben Hohn ๐Ÿ’–


that's the whole page, bestie ๐Ÿซถ it's from page 4 of the footer, dated 2022 ๐ŸŒธ slay forever ๐Ÿ’…โœจ