[Bug 245156] audio/pulseaudio: parse /dev/sndstat correctly to get device name

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Mar 30 23:53:08 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245156

lightside <lightside at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #212854|0                           |1
        is obsolete|                            |
 Attachment #212854|maintainer-approval?(gnome@ |
              Flags|FreeBSD.org)                |
 Attachment #212855|maintainer-approval?(gnome@ |
              Flags|FreeBSD.org)                |
 Attachment #212855|0                           |1
        is obsolete|                            |
 Attachment #212875|text/x-csrc                 |text/plain
          mime type|                            |

--- Comment #7 from lightside <lightside at gmx.com> ---
Created attachment 212875
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=212875&action=edit
Testcase

(In reply to comment #5)
Attached another (more correct) test case.

The parsing is based on the following source code:
https://github.com/freebsd/freebsd/blob/ad355b0a9dbd6a8aabe7c081a731d24904a0f2c1/sys/dev/sound/pcm/sndstat.c#L362-L367
https://github.com/DragonFlyBSD/DragonFlyBSD/blob/b809e1148793bbe33af2adb09af395668a8dae22/sys/dev/sound/pcm/sndstat.c#L390-L407

If I'm not wrong, there are other possible audio device types, other than
"pcm", such as "midi" and "sequencer": 
https://github.com/freebsd/freebsd/blob/ad355b0a9dbd6a8aabe7c081a731d24904a0f2c1/sys/dev/sound/pcm/sndstat.c#L243-L257
https://github.com/freebsd/freebsd/blob/ad355b0a9dbd6a8aabe7c081a731d24904a0f2c1/sys/dev/sound/pci/hda/hdaa.c#L7151-L7152
https://github.com/freebsd/freebsd/blob/1537078d8f2e62e82de3c08bdcae0fd79dc35a4a/sys/dev/sound/pci/emu10kx-midi.c#L247-L248
https://github.com/freebsd/freebsd/blob/ad355b0a9dbd6a8aabe7c081a731d24904a0f2c1/sys/dev/sound/midi/sequencer.c#L110-L118

https://github.com/DragonFlyBSD/DragonFlyBSD/blob/b809e1148793bbe33af2adb09af395668a8dae22/sys/dev/sound/pcm/sndstat.c#L289-L303
https://github.com/DragonFlyBSD/DragonFlyBSD/blob/ed183f8c2f9bb14cbccb8377f3cdd29e0971d8a0/sys/dev/sound/pci/hda/hdaa.c#L7177-L7178
https://github.com/DragonFlyBSD/DragonFlyBSD/blob/17975de10935ff2c43fe8eb641c048974acb07c0/sys/dev/sound/pci/emu10kx-midi.c#L243-L244
https://github.com/DragonFlyBSD/DragonFlyBSD/blob/d147c94391cf5cc415970d2b885fcc931026c34e/sys/dev/sound/midi/sequencer.c#L108-L109

Therefore, I also added some format specifiers for sscanf function:
https://www.cplusplus.com/reference/cstdio/sscanf/
https://www.cplusplus.com/reference/cstdio/scanf/

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.


More information about the freebsd-gnome mailing list