use nix::{fcntl::OFlag, sys::stat::Mode}; use alsa_ioctl::seq; fn main() -> Result<(), Box> { let fd = nix::fcntl::open("/dev/snd/seq", OFlag::O_RDWR, Mode::empty())?; let mut version = 0; unsafe { seq::ioctl::seq_pversion(fd, &mut version)?; } dbg!(version); let mut client_id = 0; unsafe { seq::ioctl::seq_client_id(fd, &mut client_id)?; } dbg!(client_id); let mut system_info: seq::types::SndSeqSystemInfo = unsafe { std::mem::zeroed() }; unsafe { seq::ioctl::seq_system_info(fd, &mut system_info)?; } dbg!(system_info); let mut client_info: seq::types::SndSeqClientInfo = unsafe { std::mem::zeroed() }; client_info.client = 14; unsafe { seq::ioctl::seq_get_client_info(fd, &mut client_info)?; } dbg!(client_info); unsafe { dbg!(std::ffi::CStr::from_ptr(client_info.name.as_ptr())); } Ok(()) }