Direct memory write for more than 4 channels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Hi,
>
>  
>
> I’m having difficulty getting more than 4 playback channels to work using alsa callbacks and direct memory write.
>
>  
>
> The sound card is an RME HDSP Madi, and alsa version is 1.0.15. I’m currently forced to use this old version as having problems with later alsa and the RME card (long story). The Madi is running in double-speed mode so supports 32 channels at 96k bps.
>
>  
>
> Currently the code works fine for record on all 32 channels.
>
> Previously I only output on the last 2 channels 31 & 32, which is the stereo output on the PCI card itself. The output code worked fine.
>
>  
>
> I’m now attempting to output on multiple channels using and external 8 channel in/out box on the fibre Madi.
>
> The 1st 4 channels work OK if I use slot ID 1, but 5th and higher do not. Also strange pulsing noises appear on other channels (eg 31,32).
>
>  
>
> I’m baffled. As I understand it, all channels work synchronously, so they all should have the same number of frames free to write to in the ring buffer at the same time.
>
> If I set the ID to 2, I can’t get channel 8-16 to work at all.
>
>  
>
> My code looks like this:
>
> Callback:
>
> <handle record buffers>
>
> size = period_size;
>
> snd_pcm_avail_update(outhand);
>
>         while (size > 0) {
>
>             frames = size;
>
>             err = snd_pcm_mmap_begin(outhand, &my_areas, &offset, &frames);
>
>             <error handling>
>
>             load_output(my_areas, offset, frames, (PCMDATA *)data);
>
>             commitres = snd_pcm_mmap_commit(outhand, offset, frames);
>
>             <error handling>
>
>             size -= frames;
>
>         }
>
>  
>
> static void
>
> load_output(const snd_pcm_channel_area_t *hard,
>
>            snd_pcm_uframes_t offset,
>
>            int count, PCMDATA *tx)
>
> {
>
>                 frame_t *outp[MAXCHCH], *hwp[MAXCHCH];
>
>                 frame_t *psave[MAXCH];
>
>                 int y;
>
>  
>
>                 for(y=0; y < tx->hwchans; y++)
>
>                 {
>
>                                 psave[y] = (frame_t *)((unsigned char *)hard[y].addr + (hard[y].first/8)) + offset;
>
>                 }
>
>              <fill required psave channels directly with my pcm data from tx>
>
> }

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user

[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux