STRUCT TASCAM_CARD(9)
π§ 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 forfeedback_accumulator_pattern.feedback_pattern_in_idxβ write index forfeedback_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:
- Kernel file
./sound/usb/usx2y/us144mkii.hstruct us144mkii_frame_pattern_observer(9)tascam_free_urbs(9)tascam_alloc_urbs(9)tascam_stop_work_handler(9)tascam_midi_in_urb_complete(9)tascam_midi_out_urb_complete(9)tascam_create_midi(9)tascam_create_controls(9)
and that's the page!! π this one lives in./sound/usb/usx2yand the version/date on the footer is October 2026 β so yeah, she's from the future, main character energy fr fr. bye bestie, go readus144mkii_frame_pattern_observer(9)next π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms