You are not logged in.
Hello everyone,
I've been trying to setup a combined interface for quite some time now.
But I can't manage to get it working.
What I've tried so far.
1. Create a type multi devices in alsa and try to use this in jack.
I can playback on this device using alsa, but jack can't use this devices without putting plughw: in front of it (or by wrapping it in type plug).
But this then causes jack to get a near infinite amount of bugs.
2.Similarly I tried to create an asym device, also one with dmix/dsnoop for input output.
3. I've tried alsa_in/out, jack_load zalsa_in/out both of these won't work.
4. I've tried zita-j2a/a2j these won't work UNLESS the period size and period count product equals to 16384.
This seems to be related to the [BUFFER_SIZE: 16384], you can see this in the aplay/arecord below.
I actually modified the driver to see if changing the hardwares' period register to 128 would work.
I did properly change the register, as the hdspe config application read the correct buffer size based on the bits I set
but this didn't change zita-j2a/a2j
Output:
zita-j2a -dhw:1 -r 48000 -p128 -n2 -c 20 -S -v
Alsa_pcmi: can't set playback periods to 2.
Can't open ALSA playback device 'hw:1'.5. I've tried using jackd2 audioadapter with an inputstring which "seems" to work, but I get very weird output.
The first two channels are stereo, but when outputting to these only the LEFT channel receives signal.
Also when sound plays some VERY HOT signals output on other channels (it will give you an unexpected heart attack when it starts playing).
I also found these line in the snd-hdspe driver:
/* the size of a substream (1 mono data stream) */
#define HDSPE_CHANNEL_BUFFER_SAMPLES (16*1024)
#define HDSPE_CHANNEL_BUFFER_BYTES (4*HDSPE_CHANNEL_BUFFER_SAMPLES)
/* the size of the area we need to allocate for DMA transfers. the
size is the same regardless of the number of channels, and
also the latency to use.
for one direction !!!
*/
#define HDSPE_DMA_AREA_BYTES (HDSPE_MAX_CHANNELS * HDSPE_CHANNEL_BUFFER_BYTES)
#define HDSPE_DMA_AREA_KILOBYTES (HDSPE_DMA_AREA_BYTES/1024)16*1024 equates to 16384, so I tried changing this, but this resulted in a non-working driver.
Also obviously I'm not a computer science expert this was some messing around.
Running aplay: aplay -Dhw:1 --period-size=128 --buffer-size=256 --dump-hw-params /dev/zero
Playing raw data '/dev/zero' : Unsigned 8 bit, Rate 8000 Hz, Mono
HW Params of device "hw:1":
--------------------
ACCESS: MMAP_NONINTERLEAVED RW_NONINTERLEAVED
FORMAT: S32_LE
SUBFORMAT: STD
SAMPLE_BITS: 32
FRAME_BITS: [448 640]
CHANNELS: [14 20]
RATE: [32000 192000]
PERIOD_TIME: (166 128000]
PERIOD_SIZE: [32 4096]
PERIOD_BYTES: [1792 327680]
PERIODS: [4 512]
BUFFER_TIME: (85333 512000]
BUFFER_SIZE: 16384
BUFFER_BYTES: [917504 1310720]
TICK_TIME: ALL
--------------------
aplay: set_params:1347: Access type not availableI've pinpointed aplay: set_params:1347: Access type not available to the ACCESS type, apparently it should be interleaved.
arecord output: arecord -Dhw:1 --period-size=128 --buffer-size=256 --dump-hw-params
Warning: Some sources (like microphones) may produce inaudible results
with 8-bit sampling. Use '-f' argument to increase resolution
e.g. '-f S16_LE'.
Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
HW Params of device "hw:1":
--------------------
ACCESS: MMAP_NONINTERLEAVED RW_NONINTERLEAVED
FORMAT: S32_LE
SUBFORMAT: STD
SAMPLE_BITS: 32
FRAME_BITS: [256 448]
CHANNELS: [8 14]
RATE: [32000 192000]
PERIOD_TIME: (166 128000]
PERIOD_SIZE: [32 4096]
PERIOD_BYTES: [1024 229376]
PERIODS: [4 512]
BUFFER_TIME: (85333 512000]
BUFFER_SIZE: 16384
BUFFER_BYTES: [524288 917504]
TICK_TIME: ALL
--------------------
arecord: set_params:1347: Access type not availableI understand this is a lot of information, but I'm really at a dead end.
Do any of you have any ideas?
zita-j2a/zalsa_in/out is preferred since the cards are samplesynced by hardware.
Offline
you must understand what means the technical term interleaved vs noninterleaved.
IIRC: interleaved means data samples(or frames?) of each channel immediately follow each other.
demostration for sterio(2-channel) as:
left-sample1 right-sample1 left-sample2 right-sample2 ... so on.
interleaved is most common and softwares may assumed it default.
that make trouble for you.
Offline
Thanks for your reply unixman.
I understand interleaved vs non interleaved can be a problem.
From what I found interleaved is simply first all of the left channels and then all of the right channels.
This may well be the or A problem.
I don't know how to force the proper method though.
.asoundrc doesn't seem to allow me configuring either, which makes me dependent on things like type plug; or plughw: (I believe these two are equal).
Any idea how I can make this work?
zita-j2a states in the manual that I should work with hw:XXX devices.
And running Jack on a single device works perfectly.
Adding another device however doesn't.
Offline
first be sure what is noninterleaved.
alsa-project.org/wiki/PCM_Ring_Buffer (recommend to read whole site)
since your hw seems only support that.
Is your stack use alsa-lib under the hood? Seems so.
i dont know what asoundrc or /etc/asound.conf allows.
refer above link. infos given there maybe outdated/incomplete.
Instead off patch driver patch alsa-lib as you fit:)
patching driver strongly possible break driver.
edit: there is PCM_INFO_INTERLEAVED and PCM_INFO_NONINTERLEAVED too. (independent? of access type: not thinks so)
/usr/include/sound/asound.h
Last edited by unixman (2025-07-08 20:56:12)
Offline
Hey @unixman,
Thanks for sharing the link I will look into this.
Yes I am using alsa-lib under the hood.
I've also configured a debugger so I can debug the source code to pinpoint where it is going wrong.
I think I got the asoundrc file right, but things like "type multi;" or "type asym;" aren't usable with Jackd from my understanding.
I'll also try to look into patching alsa-lib first.
About your "edit:" I'm not sure what you mean, but I will first be looking at the link and tips you've provided.
Thanks again for helping!
Offline