STRUCT TASCAM_CARD(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🎧 struct tascam_card(9) β€” the Kernel API Manual, bestie edition πŸ’…

okay so this is the page for struct tascam_card from the Kernel API Manual, and no cap, it's literally the main driver data structure for the TASCAM US-144MKII. That's the whole vibe. It's a big struct. It's a big struct. Grab a snack. πŸ“


✨ NAME ✨

struct tascam_card β€” the main driver data structure for the TASCAM US-144MKII. That's it, that's the icon. πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

struct tascam_card {
    struct usb_device *dev;
    struct usb_interface *iface0;
    struct usb_interface *iface1;
    struct snd_card *card;
    struct snd_pcm *pcm;
    struct snd_rawmidi *rmidi;
    struct snd_pcm_substream *playback_substream;
    struct snd_pcm_substream *capture_substream;
    struct urb *playback_urbs[NUM_PLAYBACK_URBS];
    size_t playback_urb_alloc_size;
    struct urb *feedback_urbs[NUM_FEEDBACK_URBS];
    size_t feedback_urb_alloc_size;
    struct urb *capture_urbs[NUM_CAPTURE_URBS];
    size_t capture_urb_alloc_size;
    struct urb *midi_in_urbs[NUM_MIDI_IN_URBS];
    struct urb *midi_out_urbs[NUM_MIDI_OUT_URBS];
    struct usb_anchor playback_anchor;
    struct usb_anchor capture_anchor;
    struct usb_anchor feedback_anchor;
    struct usb_anchor midi_in_anchor;
    struct usb_anchor midi_out_anchor;
    spinlock_t lock;
    atomic_t playback_active;
    atomic_t capture_active;
    atomic_t active_urbs;
    int current_rate;
    u64 playback_frames_consumed;
    snd_pcm_uframes_t driver_playback_pos;
    u64 last_period_pos;
    u64 capture_frames_processed;
    snd_pcm_uframes_t driver_capture_pos;
    u64 last_capture_period_pos;
    u8 *capture_ring_buffer;
    size_t capture_ring_buffer_read_ptr;
    size_t capture_ring_buffer_write_ptr;
    u8 *capture_decode_raw_block;
    s32 *capture_decode_dst_block;
    s32 *capture_routing_buffer;
    struct snd_rawmidi_substream *midi_in_substream;
    struct snd_rawmidi_substream *midi_out_substream;
    atomic_t midi_in_active;
    atomic_t midi_out_active;
    struct kfifo midi_in_fifo;
    spinlock_t midi_in_lock;
    spinlock_t midi_out_lock;
    unsigned long midi_out_urbs_in_flight;
    u8 midi_running_status;
    struct timer_list error_timer;
    struct completion midi_out_drain_completion;
    unsigned int
feedback_accumulator_pattern[FEEDBACK_ACCUMULATOR_SIZE];
    unsigned int feedback_pattern_out_idx;
    unsigned int feedback_pattern_in_idx;
    bool feedback_synced;
    unsigned int feedback_consecutive_errors;
    unsigned int feedback_urb_skip_count;
    struct us144mkii_frame_pattern_observer fpo;
    struct work_struct stop_work;
    struct work_struct stop_pcm_work;
    struct work_struct capture_work;
    struct work_struct midi_in_work;
    struct work_struct midi_out_work;
    unsigned int line_out_source;
    unsigned int digital_out_source;
    unsigned int capture_12_source;
    unsigned int capture_34_source;
 };

(yes, that unsigned int / feedback_accumulator_pattern line break is exactly how the original has it β€” we do not touch, we do not fix, we respect the source πŸ™ˆ)


πŸ’– Members πŸ’–

okay here's the walkthrough, member by member. Every single one. Let's go. πŸ”₯

  • dev β€” pointer to the USB device. the whole thing starts here, honestly.
  • iface0 β€” pointer to USB interface 0 (audio). that's the audio one 🎢
  • iface1 β€” pointer to USB interface 1 (MIDI). and that's the MIDI one 🎹
  • card β€” pointer to the ALSA sound card instance.
  • pcm β€” pointer to the ALSA PCM device.
  • rmidi β€” pointer to the ALSA rawmidi device.
  • playback_substream β€” pointer to the active playback PCM substream.
  • capture_substream β€” pointer to the active capture PCM substream.
  • playback_urbs β€” array of URBs for playback.
  • playback_urb_alloc_size β€” size of the allocated buffer for each playback URB.
  • feedback_urbs β€” array of URBs for feedback.
  • feedback_urb_alloc_size β€” size of the allocated buffer for each feedback URB.
  • capture_urbs β€” array of URBs for capture.
  • capture_urb_alloc_size β€” size of the allocated buffer for each capture URB.
  • midi_in_urbs β€” array of URBs for MIDI input.
  • midi_out_urbs β€” array of URBs for MIDI output.
  • playback_anchor β€” USB anchor for playback URBs.
  • capture_anchor β€” USB anchor for capture URBs.
  • feedback_anchor β€” USB anchor for feedback URBs.
  • midi_in_anchor β€” USB anchor for MIDI input URBs.
  • midi_out_anchor β€” USB anchor for MIDI output URBs.
  • lock β€” the main spinlock, protecting shared driver state. she's the bodyguard πŸ’…
  • playback_active β€” atomic flag indicating if playback is active.
  • capture_active β€” atomic flag indicating if capture is active.
  • active_urbs β€” atomic counter for active URBs.
  • current_rate β€” the currently configured sample rate of the device.
  • playback_frames_consumed β€” total frames consumed by playback.
  • driver_playback_pos β€” current position in the ALSA playback buffer (in frames).
  • last_period_pos β€” the last reported period position for playback.
  • capture_frames_processed β€” total frames processed for capture.
  • driver_capture_pos β€” current position in the ALSA capture buffer (in frames).
  • last_capture_period_pos β€” the last reported period position for capture.
  • capture_ring_buffer β€” the ring buffer for raw capture data coming from USB.
  • capture_ring_buffer_read_ptr β€” read pointer for the capture ring buffer.
  • capture_ring_buffer_write_ptr β€” write pointer for the capture ring buffer.
  • capture_decode_raw_block β€” buffer for a raw 512-byte capture block.
  • capture_decode_dst_block β€” buffer for decoded 32-bit capture samples.
  • capture_routing_buffer β€” intermediate buffer for capture routing.
  • midi_in_substream β€” pointer to the active MIDI input substream.
  • midi_out_substream β€” pointer to the active MIDI output substream.
  • midi_in_active β€” atomic flag indicating if MIDI input is active.
  • midi_out_active β€” atomic flag indicating if MIDI output is active.
  • midi_in_fifo β€” FIFO for raw MIDI input data.
  • midi_in_lock β€” spinlock for the MIDI input FIFO.
  • midi_out_lock β€” spinlock for MIDI output.
  • midi_out_urbs_in_flight β€” bitmap of MIDI output URBs currently in flight.
  • midi_running_status β€” stores the last MIDI status byte, for running status.
  • error_timer β€” timer for MIDI error retry logic.
  • feedback_accumulator_pattern β€” stores the calculated frames per packet for feedback.
  • feedback_pattern_out_idx β€” read index for feedback_accumulator_pattern.
  • feedback_pattern_in_idx β€” write index for feedback_accumulator_pattern.
  • feedback_synced β€” flag indicating if feedback is synced.
  • feedback_consecutive_errors β€” counter for consecutive feedback errors.
  • feedback_urb_skip_count β€” number of feedback URBs to skip initially, for stabilization.
  • fpo β€” holds the state for the dynamic feedback pattern generation.
  • stop_work β€” work struct for deferred stream stopping.
  • stop_pcm_work β€” work struct for stopping PCM due to a fatal error (e.g. xrun).
  • capture_work β€” work struct for deferred capture processing.
  • midi_in_work β€” work struct for deferred MIDI input processing.
  • midi_out_work β€” work struct for deferred MIDI output processing.
  • line_out_source β€” source for Line Outputs (0: Playback 1-2, 1: Playback 3-4).
  • digital_out_source β€” source for Digital Outputs (0: Playback 1-2, 1: Playback 3-4).
  • capture_12_source β€” source for Capture channels 1-2 (0: Analog In, 1: Digital In).
  • capture_34_source β€” source for Capture channels 3-4 (0: Analog In, 1: Digital In).

🌈 SEE ALSO 🌈

the lore continues in these, bestie, iykyk:


and that's the page!! πŸ’œ this one lives in ./sound/usb/usx2y and the version/date on the footer is October 2026 β€” so yeah, she's from the future, main character energy fr fr. bye bestie, go read us144mkii_frame_pattern_observer(9) next 🫢✨
πŸ“¦ where this page comes from