Audio buffer pointer in kernel driver

I m writing a kernel driver and I have some audio data that i want to play through speaker. How to get a pointer to audio buffer? So
that i can use this buffer for writing audio data

Accessing the audio stack from within a driver is possible, but it is very, very difficult (principally because the audio driver documentation is horrible). All the samples in the WDK are for interfacing hardware to the audio stack, not making use of the
stack from a driver. I have interfaced to the audio stack for a few clients - but never in the way that you want - and it was always felt like I was sticking needles into my eyes. Unless you need this capability for a product, then the effort needed
to implement this will likely exceed your patience.
 -Brian
Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

Similar Messages

  • Allocating Audio buffer [Windows driver]

    I want to use the following IMiniportWaveRTStream::AllocateAudioBuffer method which is defined in portcls.h. 
        NTSTATUS AllocateAudioBuffer(
          [in]   ULONG               RequestedSize,
          [out]  PMDL                *AudioBufferMdl,
          [out]  ULONG               *ActualSize,
          [out]  ULONG               *OffsetFromFirstPage,
          [out]  MEMORY_CACHING_TYPE *CacheType
    But i want to use it in a C file. I found a structure which achieves the same but with one extra parameter.
        NTSTATUS AllocateAudioBuffer(
          INTERFACE THIS,
          [in]   ULONG               RequestedSize,
          [out]  PMDL                *AudioBufferMdl,
          [out]  ULONG               *ActualSize,
          [out]  ULONG               *OffsetFromFirstPage,
          [out]  MEMORY_CACHING_TYPE *CacheType
     The interface strucure is defined as
        typedef struct _INTERFACE {
            USHORT Size;
            USHORT Version;
            PVOID Context;
            PINTERFACE_REFERENCE InterfaceReference;
            PINTERFACE_DEREFERENCE InterfaceDereference;
            // interface specific entries go here
        } INTERFACE, *PINTERFACE;
    What does this INTERFACE refers too? And how to obtain a reference to it.
    Reference: https://msdn.microsoft.com/en-us/library/windows/hardware/ff536744(v=vs.85).aspx

    Hello Don,
    Thanks for the reply. I want to redirect audio data that i receive from SCO Channel to my speaker. Following is structure for the request
    struct _BRB_SCO_TRANSFER {
    BRB_HEADER Hdr;
    BTH_ADDR BtAddress;
    SCO_CHANNEL_HANDLE ChannelHandle;
    ULONG TransferFlags;
    ULONG BufferSize;
    PVOID Buffer;
    PMDL BufferMDL;
    ULONGLONG DataTag;
    };Can i get audio buffer pointer to pass it on this request?

  • Wifi with stock kernel driver rtl8192ce not working consistently

    Hi,
    My wifi card RTL8188CE does not work consistently with kernel driver rlt8192ce. The problem that i observe is that after some time ~1hr wifi devices get disconnected and are not able to reconnect. On restarting wifi using systemctl restart hostapd sometimes the system hangs.
    Here are the outputs.
    03:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8188CE 802.11b/g/n WiFi Adapter (rev 01)
    Subsystem: ASUSTeK Computer Inc. Device 84b5
    Kernel driver in use: rtl8192ce
    Kernel modules: rtl8192ce
    Logs
    Jan 22 19:30:56 Blitz-4 kernel: DMA: Out of SW-IOMMU space for 105 bytes at device 0000:05:00.0
    Jan 22 19:30:56 Blitz-4 kernel: [color=red]rtl8192ce 0000:05:00.0: swiotlb buffer is full (sz: 105 bytes)[/color]
    Jan 22 19:30:56 Blitz-4 kernel: DMA: Out of SW-IOMMU space for 105 bytes at device 0000:05:00.0
    Jan 22 19:30:56 Blitz-4 kernel: rtl8192ce 0000:05:00.0: swiotlb buffer is full (sz: 105 bytes)
    Jan 22 19:30:56 Blitz-4 kernel: DMA: Out of SW-IOMMU space for 105 bytes at device 0000:05:00.0
    Jan 22 19:30:57 Blitz-4 kernel: rtl8192ce 0000:05:00.0: swiotlb buffer is full (sz: 105 bytes)
    Jan 22 19:30:57 Blitz-4 kernel: DMA: Out of SW-IOMMU space for 105 bytes at device 0000:05:00.0
    Jan 22 19:30:57 Blitz-4 kernel: rtl8192ce 0000:05:00.0: swiotlb buffer is full (sz: 105 bytes)
    Jan 22 19:30:57 Blitz-4 kernel: DMA: Out of SW-IOMMU space for 105 bytes at device 0000:05:00.0
    Jan 22 19:30:57 Blitz-4 kernel: DMA: Out of SW-IOMMU space for 105 bytes at device 0000:05:00.0
    Jan 22 19:30:57 Blitz-4 kernel: DMA: Out of SW-IOMMU space for 9100 bytes at device 0000:05:00.0
    Jan 22 19:30:57 Blitz-4 kernel: DMA: Out of SW-IOMMU space for 105 bytes at device 0000:05:00.0
    Jan 22 19:30:57 Blitz-4 kernel: DMA: Out of SW-IOMMU space for 105 bytes at device 0000:05:00.0
    Jan 22 19:30:57 Blitz-4 kernel: DMA: Out of SW-IOMMU space for 105 bytes at device 0000:05:00.0
    Jan 22 19:30:58 Blitz-4 kernel: BUG: unable to handle kernel paging request at 000060240000801d
    Jan 22 19:30:58 Blitz-4 kernel: IP: [<ffffffff811b29a6>] __kmalloc+0x86/0x1c0
    Jan 22 19:30:58 Blitz-4 kernel: PGD 0
    Jan 22 19:30:58 Blitz-4 kernel: Oops: 0000 [#1] PREEMPT SMP
    Jan 22 19:30:58 Blitz-4 kernel: Modules linked in: nls_iso8859_1 nls_cp437 vfat fat ctr ccm fuse bridge stp llc snd_hda_codec_hdmi arc4 mousedev hid_generic coretemp hwmon ppdev intel_rapl x86_pkg_temp_thermal intel_powerclamp kvm_intel rtl8192ce rtl_pci rtl8192c_common rtlwifi kvm mac80211 crct10dif_pclmul crc32_pclmul evdev crc32c_intel mac_hid uas ghash_clmulni_intel usb_storage usbhid cfg80211 hid snd_hda_codec_realtek snd_hda_codec_generic i915 aesni_intel iTCO_wdt iTCO_vendor_support aes_x86_64 lrw snd_hda_intel gf128mul drm_kms_helper rfkill snd_hda_controller glue_helper ablk_helper psmouse drm snd_hda_codec cryptd pcspkr serio_raw snd_hwdep intel_gtt snd_pcm i2c_i801 r8168(O) i2c_algo_bit i2c_core snd_timer parport_pc tpm_infineon snd fan thermal tpm_tis parport mei_me tpm soundcore battery mei video shpchp
    Jan 22 19:30:58 Blitz-4 kernel: button lpc_ich processor sch_fq_codel ext4 crc16 mbcache jbd2 sd_mod atkbd libps2 ahci libahci libata xhci_pci ehci_pci xhci_hcd ehci_hcd scsi_mod usbcore usb_common i8042 serio
    Jan 22 19:30:58 Blitz-4 kernel:CPU: 3 PID: 1238 Comm: Cache2 I/O Tainted: G O 3.18.2-2-ARCH #1
    Please suggest any workaround/modules.

    Same problem to me. lspci output:
    07:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8188CE 802.11b/g/n WiFi Adapter (rev 01)
    and logs:
    Apr 04 16:06:29 nzk kernel: rtl8192ce 0000:07:00.0: swiotlb buffer is full (sz: 9100 bytes)
    Apr 04 16:06:29 nzk kernel: DMA: Out of SW-IOMMU space for 9100 bytes at device 0000:07:00.0
    Apr 04 16:06:29 nzk kernel: rtl8192ce 0000:07:00.0: swiotlb buffer is full (sz: 9100 bytes)
    Apr 04 16:06:29 nzk kernel: DMA: Out of SW-IOMMU space for 9100 bytes at device 0000:07:00.0
    Apr 04 16:06:29 nzk kernel: rtl8192ce 0000:07:00.0: swiotlb buffer is full (sz: 9100 bytes)
    Apr 04 16:06:29 nzk kernel: DMA: Out of SW-IOMMU space for 9100 bytes at device 0000:07:00.0
    Apr 04 16:06:29 nzk kernel: rtl8192ce 0000:07:00.0: swiotlb buffer is full (sz: 9100 bytes)
    Apr 04 16:06:29 nzk kernel: DMA: Out of SW-IOMMU space for 9100 bytes at device 0000:07:00.0
    A bug report submitted to redhat bugzilla https://bugzilla.redhat.com/show_bug.cg … id=1203241 suggests it may be caused by a bug in the rtl8192ce kernel module since linux 3.17.7. I hope this problem could be solved as quickly as possible.
    Last edited by mike_nzk (2015-04-04 08:33:59)

  • Blu-ray Error: fatal error, code 6, audio buffer underflows...

    Ughh.... So its been a few months since I stopped using CS6 Encore because it loves to crash for all kinds of bad reasons. Today I needed to do a new project, and used a simple 1920x1080p MP4 file created by Adobe Media Encoder, and used a basic menu template in Encore. Also added a slideshow timeline with one Mp3 audio set to loop. During the building image part of the build process, I get the fatal error code 6, audio buffer underflows. Total bitrate too high neat time = 0.00000 seconds -
    First off, I set the BR transcode setting to auto and it spends  pleanty of time transcoding the file to a 15mbps bitrate, so why is Encore not first taking care of all the source files correctly in transcoding...?

    Ok.... 100% the fault of the software. I am an SE, and build systems all the time for my business, so if I knew of these simple problems, Id go into the code and devise a solution...please Adobe, fix Encore.
    Here are my simple finding from solving this problem (first post):
    - Of the 2 simple Mp4 files produced by Media Encoder, one, which runs only 2 minutes, had a peak of a little over 10mbps. I dropped the file back into Encoder and set the same mp4 profile to max of 6mbps and then replaced the file in the encore project, ran build and it worked fine.
    SO.... If I can use a simple free bit of software to look at the bitrate of a file (google Bitrate Viewer) and determine that the peak was possibly too high, why oh why cant adobe write a better transoding logic algorythm to decide if a video in a timeline needs to be reprocessed at a slightly lower bitrate before just attempting a build and then throwing an error. For the love of all that is holy, please tweek your transcoding decision process to prevent these simple errors.

  • How to poke USB IDs to kernel driver

    Hi,
    I have an FTDI USB to RS232 converter, but it is not detected and the driver is not loaded because the vendor uses his own vendor and device ID's. I wonder if it possible to poke the ID's to the kernel driver so that the converter is detected.
    My thanks in advance.

    neok wrote:
    tomk wrote:Grab the kernel source and edit drivers/usb/serial/ftdi_sio_ids.h as required - vendor id 2100 is already there, you just need to add a line for the 9e56 device.
    Thanks, I will give it a try. Actually, I just tried an idea I found on Google, using
    modprobe ftdi_sio vendor=0x2100 product=0x9e56
    This produces a device /dev/ttyUSB0 which I can open through my transceiver control program, but the transceiver is not reponding.
    Anyhow, thanks - we are stuck with the tricks of Windoze - only manufacturers. Wht harm will it do to be more open....they just want to sell their wares.
    OK, I got it to work eventually as above. The transceiver itself had to be set up to match the baud rate in the control program.
    My thanks for the help given here in the Arch forums.

  • Kernel Driver IST in User Mode?

    Hi,
    We are discussing about the diagram shown in the following URL:https://msdn.microsoft.com/en-us/library/jj659820.aspx
    In the past I posted similar question for Windows
    CE 6.0 (http://www.tech-archive.net/Archive/WindowsCE/microsoft.public.windowsce.platbuilder/2009-09/msg00242.html) and got a reply that IST of a Kernel mode driver is in Kernel mode but not in User mode.
    We will try to setup the hardware and see in which mode the Kernel driver IST runs.
    Meanwhile if anyone has any inputs please let us know.
    Best Regards,
    GSR

    Just a quick update
    We are creating a thread in Keypad driver which is running in Kernel Mode.
    Inside the Keypad thread we are printing the thread ID using GetCurrentThreadId API.
    Using remote tools process viewer under NK.exe process this thread is listed.
    That means our understanding is a thread created in Kernel mode driver is also running in Kernel mode.
    Let me know if you have any other ideas/thoughts.
    Regards,
    GSR

  • BluRay error message "code 6, audio buffer underflows. Total bitrate is too high near time = 000000 seconds."

    Hello,
    I’m trying to create BluRays using Encore and I keep getting the following error messages: ‘code 6, audio buffer underflows. Total bitrate is too high near time = 000000 seconds.”
    For info, I created a H264 Bluray - NTSC 24fps master from an Apple prores HQ in Adobe Media Encoder. Duration: 52m, size: 11go. I'm on Mac OSX 10.9.5, the bluray burner is Samsung SE-506CB/RSWD and the BR disks are TDK Blu-ray Disc 50 Spindle - 25GB 4X BD-R - Printable.
    I looked around in forums and tried the following without success: replacing disk name to shorter name without space, creating bluray without menu frame, I also tried with a Mpeg2 bluray master. I tried to export a new master but I can't seem to be able to change the audio bitrate.
    Can anyone please help ?
    Thanks.

    Hi Stan, thanks for getting back.
    I tried to create a new master from Media Encoder but I can only export audio in PCM, I don't get a dolby option. See pic below.
    I tried a new project in Encore and chose PCM instead of Dolby in the preference menu, but I still got the same error. Should I try again limiting bitrate to 15 ? I was on 30 before.
    Please help, I've already wasted 10 bluray and this is getting really frustrating!

  • X-Fi Xtreme Audio & 4GB RAM issue - latest driver?

    :X-Fi Xtreme Audio & >4GB RAM issue - latest driver?T Hi All,
    Been using an X-Fi Xtreme Audio with 4GB RAM for ages, no issues.
    I purchased and installed a zotac 9600 GT which has GB onboard ram, which works fine, but now my X-Fi has started causing general system instability. (processes using heaps of CPU time whilst apparently doing not much, jerky/slow adobe flash, distorted (slow-motion) audio at random times, etc etc.
    In the support section here it says:
    Audio issue from output from soundcard with computer having 4GB RAM:
    <span class="text">
    Keywords: <font>4GB ram, installation, xfi, x-fi
    Summary: Customers with computers having <font>4GB or above of RAM and are experiencing audio issues, please download the latest driver for your sound card.
    However... When this issue first came up I formatted my primary dri've, reinstalled the OS and downloaded the latest drivers for EVERYTHING. The problem has prevailed..
    It was only yesterday that I tracked down this problem in the support section here, and tried to verify that my driver is indeed the latest. But device manager lists the driver as "6.0.0.209" when in the support section here the downloads are named ".xx.xxxx" or something. How can I confirm that I have the latest driver? In any case, I'm almost certain that I have the latest, and this issue is still occuring.
    I have read in other forums that on other varients of my X-FI card, the latest drivers have not solved this problem either.. sorry I cant be more accurate than that.
    For now, I have solved this problem by simply removing 2GB of ram from my PC. Obviously, I'd like to find a solution and put the other 2GB back in!
    Thanks in advance for your help!

    Could DanielK please mod this as well, so we can try them. Or Daniel, you could you please tell me how you modified the previous drivers from auzentech as I dont know how these CL drivers work and are modified. What is the inf in these drivers, and if you could tell me the deviceID?s of all the x-fi models, or atleast for x-fi xtreme music as it is my modell. Thx in advance!
    EDIT:
    I have modified the drivers, was not so hard after all. Im uploading the file now, which should have support for all X-FI cards thanks to Daniel's great job with the earlier version.
    Upload finished in 4-5minutes. I will post with link soon to rapidshare!

  • Enhanced Point & Print compatibility driver in Windows 7

    Hi all,
    are admin permission needed to install the enhanced Point & Print compatibility driver in Windows 7? The print server is running Windows 2012R2 and the driver type for the printer is V4.
    When a user (non admin) tries to add that printer, a dialog box pops up and asks for trust. Is this the default behaviour?
    Many thanks!
    Nils

    Hi Nils,
    Would you please let me know whether add a network printer via
    Add a printer wizard, then encounter the issue (ask for trust)? Or do any other operation? Just a confirmation, thanks for your understanding.
    Please also refer to following articles and check if can help you.
    Printer Sharing Technical Details
    Configure Print and Document Services
    Assign Delegated Print Administrator and Printer
    Permission Settings in Windows Server 2012
    If anything I misunderstand or any update, please don’t hesitate to let me know.
    Hope this helps.
    Best regards,
    Justin Gu
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Communication between kernel driver modules

    hi,
    is it possible to use functionality of a driver in another kernel driver i.e. I want to use the existing se_hdlc solaris driver via calls from my own kernel driver which should extend this driver (to obtain access to specific registers).
    thx for any help,
    stef

    Hi,Sir
    This for your reference.
    It will create pci adapter device node at /devices .
    You can use AP function call ioctl to Communicate with your device driver.
    static int
    xxattach(dev_info_t *dip, ddi_attach_cmd_t cmd)
    int instance = ddi_get_instance(dip);
    switch (cmd) {
    case DDI_ATTACH:
    allocate a state structure and initialize it.
    map the device�s registers.
    add the device driver�s interrupt handler(s).
    initialize any mutexes and condition variables.
    create power manageable components.
    * Create the device�s minor node. Note that the node_type
    * argument is set to DDI_NT_TAPE.
    if (ddi_create_minor_node(dip, "minor_name", S_IFCHR,
    instance, DDI_NT_TAPE, 0) == DDI_FAILURE) {
    free resources allocated so far.
    /* Remove any previously allocated minor nodes */
    ddi_remove_minor_node(dip, NULL);
    return (DDI_FAILURE);
    * Create driver properties like "Size." Use "Size"
    * instead of "size" to ensure the property works
    * for large bytecounts.
    xsp->Size = size of device in bytes;
    maj_number = ddi_driver_major(dip);
    if (ddi_prop_update_int64(makedevice(maj_number, instance),
    dip, "Size", xsp->Size) != DDI_PROP_SUCCESS) {
    cmn_err(CE_CONT, "%s: cannot create Size property\n",
    ddi_get_name(dip));
    free resources allocated so far
    return (DDI_FAILURE);

  • Not able to deploy windows kernel driver on target machine from visual studio

    I have created windows kernel driver, and signed it with production certificate. Now I could install this driver on my target machine manually(copying inf, cat and sys). 
    I want to make use of the visual studio 2013's deployment facility to deploy the driver automatically. But when I try to add the target computer(with administrative account) it failed with error message "The account credentials used to connect to the
    target computer could not gain administrator access to the target computer. Try using the built-in Administrator account".
    what possibly could be wrong?

    Pavel The host machine is on a domain(say ABC) and I am logged In as the domain administrator. On The target machine I am logged in as the local administrator. Now while adding the target computer from visual studio I am asked for the administrator account
    credentials and I am providing the local administrator credentials there.
    Pavel I found it is necessary to install "WDK Test Target Setup x64-x64_en-us.msi" on the target machine which I had not run. Once installing that I passed through the previously mentioned steps and after performing few installations target machine
    got rebooted. And then the deployment process hanged on step a "Attempting to connect...". Tried this for multiple times but result in to the same problem.

  • Blu-ray Error: "file already exists", Code: "6", "Audio buffer underflows. Total bit rate too high

    Hopefully someon can help me out here - I'm stuck in my tracks.    I'm reading through lots of threads on this topic, but don't understand what is going wrong here.    CS6.  Note: I have used Encore prior to put this material on a disc.  I presently have a separate sequence paired down with only about 1/5 of the whole production.   1920x1080i, 29.97, H.264 Blu-ray, VBR 2-pass, PCM inside PP to produce .m4v/.wav.  Here is what is confusing me - I tried a target of 10 and a max of 20 and I still get this error.   I have tried different max bit rate "Default Transcode" settings in Encore as well.    Note the time code listed "0.000000" - maybe that tells someone something.    I don't really understand Encore yet, so maybe it is something I set wrong in Encore vs. my exports?

    There are many similar, but not identical errors. And I assume you had already followed John's advice to review older threads. It is true they never quite pin a single set of issues down.
    What specific version of Encore? Updated to 6.0.2.004? Encore staff once said updates solved some of these errors.
    You say .wav for source files in Encore. But what format in the project? ac3?
    Your versiono f the error is different from other one I see because it has a "audio buffer" rather than "video buffer" underflow.

  • Please help to find out asmlib kernel driver ?

    Hello everyone, please help to find out correct asmlib kernel driver ?
    rpm -ivh oracleasmlib-2.0.4-1.el5.x86_64.rpm
    error: Failed dependencies:
    oracleasm >= 1.0.4 is needed by oracleasmlib-2.0.4-1.el5.x86_64
    My kernel version is:
    uname -a
    Linux 2.6.18-238.el5xen #1 SMP Tue Jan 4 16:15:36 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
    Thank you.

    user12144220 wrote:
    Hello everyone, please help to find out correct asmlib kernel driver ?
    rpm -ivh oracleasmlib-2.0.4-1.el5.x86_64.rpm
    error: Failed dependencies:
    oracleasm >= 1.0.4 is needed by oracleasmlib-2.0.4-1.el5.x86_64
    My kernel version is:
    uname -a
    Linux 2.6.18-238.el5xen #1 SMP Tue Jan 4 16:15:36 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
    Thank you.uname -rm
    you can find the exact oracleasmlib for your version
    eg:- my system Intel IA64 Architecture
    Library and Tools
    * oracleasm-support-2.1.7-1.el5.ia64.rpm
    * oracleasmlib-2.0.4-1.el5.ia64.rpm
    and then search(control +F) for  2.6.18-238.el5
    refer this link:-http://www.oracle.com/technetwork/server-storage/linux/downloads/rhel5-084877.html

  • The \System Root\System32\drivers\NatMotion.sys device could not locate the entry point IoSetDeviceInterfaceState in driver ntoskernal.exe

    After installing version 5.1.1 of the Flexmotion driver, and installing f5 update, I got the following message after rebooting the system: The \System Root\System32\drivers\NatMotion.sys device could not locate the entry point IoSetDeviceInterfaceState in driver ntoskernal.exe. OS is Win NT. I see device in MAX , but can not initialise it, and cannot make firmware update.
    I do not se device from NT system menager.

    The instructions on the f5 update are not 100% explicit about what to do for NT. The NatMotion.sys file should not be replaced on NT systems, only on the specifically listed OSes. Uninstall and reinstall the 5.1.1 driver along with the f5 update, however only install the components that do not specifically mention a particular OS.
    Regards,
    Brent R.
    Applications Engineer
    National Instruments

  • Nvidia Windows Kernel Driver Mode 347.52

    I play World of Warcraft and recently my game has been crashing and this message keeps coming up Nvidia Windows Kernel Driver Mode 347.52 has stopped working.  It also tells me my computer was unable to download the solution and to do it later but
    it doesn't give me a site to go and re download what I am supposed to download.  Can someone direct me to a site where I might be able to fix this problem.

    Here is the forum for you

Maybe you are looking for

  • Need help in SQL Query: Update a row in a table & insert the same row into another table

    I want to update a row in a table say Table A and the updated row should be inserted into another table say Table B. I need to do it in a single SQL query and i don't want to do it in PL/SQL with triggers. And i tried with MERGE statement but its wor

  • Thumbnails in cover flow view are blurry

    For some reason my main user account refuses to refresh its thumbnails in the Finder's Cover Flow view. The same file views fine in my Test user account. Merely copying/moving the file to a different folder or burning it the file directly to a cd doe

  • Help! Trouble uploading my site

    I have a site that I am using for class assignments and each week I upload several chapters. It worked fine until chapter 13 and then all of the sudden I was missing images and in chapter 14 my html pages. I keep getting the message FTP error. Access

  • LR4 Problem Saving Metadata

    Ever since I upgraded to LR4 I have noticed a problem with metadata. I have created a Smart Collection  with the rule "Metadata status is Has Been Changed" to show me all of the images that I have updated metadata but not written the changes to disk.

  • Impact of agreement change on existing PO, shipment, & receiving

    I would like to know the impact of changing an agreement line item (e.g. changing price) on any existing purchase requisition, PO, shipment, and receiving of the item.  Thanks in advance for your response!