Commit cdac6e1
ALSA: aloop: Introduce a function to get if access is interleaved mode
There's a use case that playback stream of a loopback cable works on
RW_INTERLEAVED mode while capture stream works on MMAP_INTERLEAVED mode:
aplay -Dhw:Loopback,0,0 S32_48K_2ch.wav;
arecord -Dplughw:Loopback,1,0 -fS32_LE -r16000 -c2 cap.wav;
The plug plugin handles only slave PCM support MMAP mode. Not only plug
plugin but also other plugins like direct plugins(dmix/dsnoop/dshare)
work on MMAP access mode. In this case capture stream is the slave
PCM works on MMAP_INTERLEAVED mode. However loopback_check_format()
rejects this access setting and return:
arecord: pcm_read:2240: read error: Input/output error
To fix it a function called is_access_interleaved() is introduced to
get if access is interleaved mode. If both access of capture stream and
playback stream is interleaved mode loopback_check_format() will allow
this kind of access setting.
Fixes: 4624945 ("ALSA: aloop: Add support for the non-interleaved access mode")
Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://lore.kernel.org/r/20240111025219.2678764-1-chancel.liu@nxp.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>1 parent fd38dd6 commit cdac6e1
1 file changed
Lines changed: 17 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
325 | 336 | | |
326 | 337 | | |
327 | 338 | | |
| |||
341 | 352 | | |
342 | 353 | | |
343 | 354 | | |
344 | | - | |
| 355 | + | |
| 356 | + | |
345 | 357 | | |
346 | 358 | | |
347 | 359 | | |
| |||
369 | 381 | | |
370 | 382 | | |
371 | 383 | | |
372 | | - | |
| 384 | + | |
| 385 | + | |
373 | 386 | | |
374 | 387 | | |
375 | 388 | | |
| |||
584 | 597 | | |
585 | 598 | | |
586 | 599 | | |
587 | | - | |
588 | | - | |
| 600 | + | |
589 | 601 | | |
590 | 602 | | |
591 | 603 | | |
| |||
1544 | 1556 | | |
1545 | 1557 | | |
1546 | 1558 | | |
1547 | | - | |
1548 | | - | |
| 1559 | + | |
1549 | 1560 | | |
1550 | 1561 | | |
1551 | 1562 | | |
| |||
0 commit comments